ActivityPub-federated video streaming platform using P2P directly in your web browser
Follow the angular styleguide for the directories structure
Chocobozzz41a2aee38cf8
diff --git a/client/.gitignore b/client/.gitignoreindex 0ab218d718..81e4a1cf7d 100644--- a/client/.gitignore+++ b/client/.gitignore@@ -1,6 +1,8 @@typings-angular/**/*.js-angular/**/*.map-angular/**/*.css+app/**/*.js+app/**/*.map+app/**/*.cssstylesheets/index.cssbundles+main.js+main.js.mapdiff --git a/client/angular/app/app.component.html b/client/app/app.component.htmlsimilarity index 100%rename from client/angular/app/app.component.htmlrename to client/app/app.component.htmldiff --git a/client/angular/app/app.component.scss b/client/app/app.component.scsssimilarity index 100%rename from client/angular/app/app.component.scssrename to client/app/app.component.scssdiff --git a/client/angular/app/app.component.ts b/client/app/app.component.tssimilarity index 55%rename from client/angular/app/app.component.tsrename to client/app/app.component.tsindex 722d0dca03..c94ff79a79 100644--- a/client/angular/app/app.component.ts+++ b/client/app/app.component.ts@@ -1,17 +1,20 @@import { Component } from '@angular/core';-import { RouteConfig, ROUTER_DIRECTIVES, ROUTER_PROVIDERS, Router } from '@angular/router-deprecated';import { HTTP_PROVIDERS } from '@angular/http';+import { RouteConfig, Router, ROUTER_DIRECTIVES, ROUTER_PROVIDERS } from '@angular/router-deprecated';-import { VideosAddComponent } from '../videos/components/add/videos-add.component';-import { VideosListComponent } from '../videos/components/list/videos-list.component';-import { VideosWatchComponent } from '../videos/components/watch/videos-watch.component';-import { VideosService } from '../videos/videos.service';-import { FriendsService } from '../friends/services/friends.service';-import { UserLoginComponent } from '../users/components/login/login.component';-import { AuthService } from '../users/services/auth.service';-import { AuthStatus } from '../users/models/authStatus';-import { SearchComponent } from './search.component';-import { Search } from './search';+import { FriendService } from './friends/index';+import { Search, SearchComponent } from './shared/index';+import {+ UserLoginComponent,+ AuthService,+ AuthStatus+} from './users/index';+import {+ VideoAddComponent,+ VideoListComponent,+ VideoWatchComponent,+ VideoService+} from './videos/index';@RouteConfig([{@@ -22,35 +25,35 @@ import { Search } from './search';{path: '/videos/list',name: 'VideosList',- component: VideosListComponent,+ component: VideoListComponent,useAsDefault: true},{path: '/videos/watch/:id',name: 'VideosWatch',- component: VideosWatchComponent+ component: VideoWatchComponent},{path: '/videos/add',name: 'VideosAdd',- component: VideosAddComponent+ component: VideoAddComponent}])@Component({selector: 'my-app',- templateUrl: 'app/angular/app/app.component.html',- styleUrls: [ 'app/angular/app/app.component.css' ],+ templateUrl: 'client/app/app.component.html',+ styleUrls: [ 'client/app/app.component.css' ],directives: [ ROUTER_DIRECTIVES, SearchComponent ],- providers: [ ROUTER_PROVIDERS, HTTP_PROVIDERS, VideosService, FriendsService, AuthService ]+ providers: [ ROUTER_PROVIDERS, HTTP_PROVIDERS, VideoService, FriendService, AuthService ]})export class AppComponent {isLoggedIn: boolean;search_field: string = name;- choices = [ ];+ choices = [ ];- constructor(private _friendsService: FriendsService,+ constructor(private _friendService: FriendService,private _authService: AuthService,private _router: Router@@ -83,7 +86,7 @@ export class AppComponent {}makeFriends() {- this._friendsService.makeFriends().subscribe(+ this._friendService.makeFriends().subscribe(status => {if (status === 409) {alert('Already made friends!');@@ -96,7 +99,7 @@ export class AppComponent {}quitFriends() {- this._friendsService.quitFriends().subscribe(+ this._friendService.quitFriends().subscribe(status => {alert('Quit friends!');},diff --git a/client/angular/friends/services/friends.service.ts b/client/app/friends/friend.service.tssimilarity index 96%rename from client/angular/friends/services/friends.service.tsrename to client/app/friends/friend.service.tsindex cb34323e44..d143ec40d0 100644--- a/client/angular/friends/services/friends.service.ts+++ b/client/app/friends/friend.service.ts@@ -3,7 +3,7 @@ import { Http, Response } from '@angular/http';import { Observable } from 'rxjs/Rx';@Injectable()-export class FriendsService {+export class FriendService {private _baseFriendsUrl = '/api/v1/pods/';constructor (private http: Http) {}diff --git a/client/app/friends/index.ts b/client/app/friends/index.tsnew file mode 100644index 0000000000..0adc256c43--- /dev/null+++ b/client/app/friends/index.ts@@ -0,0 +1 @@+export * from './friend.service';diff --git a/client/app/shared/index.ts b/client/app/shared/index.tsnew file mode 100644index 0000000000..a49a4f1a95--- /dev/null+++ b/client/app/shared/index.ts@@ -0,0 +1,3 @@+export * from './search-field.type';+export * from './search.component';+export * from './search.model';diff --git a/client/angular/app/search.ts b/client/app/shared/search-field.type.tssimilarity index 50%rename from client/angular/app/search.tsrename to client/app/shared/search-field.type.tsindex c4e771b477..846236290c 100644--- a/client/angular/app/search.ts+++ b/client/app/shared/search-field.type.ts@@ -1,6 +1 @@export type SearchField = "name" | "author" | "podUrl" | "magnetUri";--export interface Search {- field: SearchField;- value: string;-}diff --git a/client/angular/app/search.component.html b/client/app/shared/search.component.htmlsimilarity index 100%rename from client/angular/app/search.component.htmlrename to client/app/shared/search.component.htmldiff --git a/client/angular/app/search.component.ts b/client/app/shared/search.component.tssimilarity index 85%rename from client/angular/app/search.component.tsrename to client/app/shared/search.component.tsindex e21b91fcef..519810f9b9 100644--- a/client/angular/app/search.component.ts+++ b/client/app/shared/search.component.ts@@ -2,11 +2,12 @@ import { Component, EventEmitter, Output } from '@angular/core';import { DROPDOWN_DIRECTIVES} from 'ng2-bootstrap/components/dropdown';-import { Search, SearchField } from './search';+import { Search } from './search.model';+import { SearchField } from './search-field.type';@Component({selector: 'my-search',- templateUrl: 'app/angular/app/search.component.html',+ templateUrl: 'client/app/shared/search.component.html',directives: [ DROPDOWN_DIRECTIVES ]})diff --git a/client/app/shared/search.model.ts b/client/app/shared/search.model.tsnew file mode 100644index 0000000000..932a6566c4--- /dev/null+++ b/client/app/shared/search.model.ts@@ -0,0 +1,6 @@+import { SearchField } from './search-field.type';++export interface Search {+ field: SearchField;+ value: string;+}diff --git a/client/app/users/index.ts b/client/app/users/index.tsnew file mode 100644index 0000000000..4f08b8bc7e--- /dev/null+++ b/client/app/users/index.ts@@ -0,0 +1,2 @@+export * from './login/index';+export * from './shared/index';diff --git a/client/app/users/login/index.ts b/client/app/users/login/index.tsnew file mode 100644index 0000000000..69c16441fb--- /dev/null+++ b/client/app/users/login/index.ts@@ -0,0 +1 @@+export * from './login.component';diff --git a/client/angular/users/components/login/login.component.html b/client/app/users/login/login.component.htmlsimilarity index 100%rename from client/angular/users/components/login/login.component.htmlrename to client/app/users/login/login.component.htmldiff --git a/client/angular/users/components/login/login.component.scss b/client/app/users/login/login.component.scsssimilarity index 100%rename from client/angular/users/components/login/login.component.scssrename to client/app/users/login/login.component.scssdiff --git a/client/angular/users/components/login/login.component.ts b/client/app/users/login/login.component.tssimilarity index 72%rename from client/angular/users/components/login/login.component.tsrename to client/app/users/login/login.component.tsindex d339353ef6..33590ad4c5 100644--- a/client/angular/users/components/login/login.component.ts+++ b/client/app/users/login/login.component.ts@@ -1,14 +1,12 @@import { Component } from '@angular/core';import { Router } from '@angular/router-deprecated';-import { AuthService } from '../../services/auth.service';-import { AuthStatus } from '../../models/authStatus';-import { User } from '../../models/user';+import { AuthService, AuthStatus, User } from '../shared/index';@Component({selector: 'my-user-login',- styleUrls: [ 'app/angular/users/components/login/login.component.css' ],- templateUrl: 'app/angular/users/components/login/login.component.html'+ styleUrls: [ 'client/app/users/login/login.component.css' ],+ templateUrl: 'client/app/users/login/login.component.html'})export class UserLoginComponent {diff --git a/client/angular/users/models/authStatus.ts b/client/app/users/shared/auth-status.model.tssimilarity index 100%rename from client/angular/users/models/authStatus.tsrename to client/app/users/shared/auth-status.model.tsdiff --git a/client/angular/users/services/auth.service.ts b/client/app/users/shared/auth.service.tssimilarity index 94%rename from client/angular/users/services/auth.service.tsrename to client/app/users/shared/auth.service.tsindex 099563d43b..1cb042db57 100644--- a/client/angular/users/services/auth.service.ts+++ b/client/app/users/shared/auth.service.ts@@ -1,9 +1,9 @@import { Injectable } from '@angular/core';-import { Http, Response, Headers, URLSearchParams, RequestOptions } from '@angular/http';+import { Headers, Http, RequestOptions, Response, URLSearchParams } from '@angular/http';import { Observable, Subject } from 'rxjs/Rx';-import { AuthStatus } from '../models/authStatus';-import { User } from '../models/user';+import { AuthStatus } from './auth-status.model';+import { User } from './user.model';@Injectable()export class AuthService {diff --git a/client/app/users/shared/index.ts b/client/app/users/shared/index.tsnew file mode 100644index 0000000000..c6816b3c68--- /dev/null+++ b/client/app/users/shared/index.ts@@ -0,0 +1,4 @@+export * from './auth-status.model';+export * from './auth.service';+export * from './token.model';+export * from './user.model';diff --git a/client/angular/users/models/token.ts b/client/app/users/shared/token.model.tssimilarity index 100%rename from client/angular/users/models/token.tsrename to client/app/users/shared/token.model.tsdiff --git a/client/angular/users/models/user.ts b/client/app/users/shared/user.model.tssimilarity index 90%rename from client/angular/users/models/user.tsrename to client/app/users/shared/user.model.tsindex 3367e3bb52..73fd4ddc05 100644--- a/client/angular/users/models/user.ts+++ b/client/app/users/shared/user.model.ts@@ -1,4 +1,4 @@-import { Token } from './token';+import { Token } from './token.model';export class User {username: string;diff --git a/client/app/videos/index.ts b/client/app/videos/index.tsnew file mode 100644index 0000000000..1c80ac5e5c--- /dev/null+++ b/client/app/videos/index.ts@@ -0,0 +1,4 @@+export * from './shared/index';+export * from './video-add/index';+export * from './video-list/index';+export * from './video-watch/index';diff --git a/client/app/videos/shared/index.ts b/client/app/videos/shared/index.tsnew file mode 100644index 0000000000..c535c46fc7--- /dev/null+++ b/client/app/videos/shared/index.ts@@ -0,0 +1,5 @@+export * from './loader/index';+export * from './pagination.model';+export * from './sort-field.type';+export * from './video.model';+export * from './video.service';diff --git a/client/app/videos/shared/loader/index.ts b/client/app/videos/shared/loader/index.tsnew file mode 100644index 0000000000..ab22584e4c--- /dev/null+++ b/client/app/videos/shared/loader/index.ts@@ -0,0 +1 @@+export * from './loader.component';diff --git a/client/angular/videos/loader.component.html b/client/app/videos/shared/loader/loader.component.htmlsimilarity index 100%rename from client/angular/videos/loader.component.htmlrename to client/app/videos/shared/loader/loader.component.htmldiff --git a/client/angular/videos/loader.component.scss b/client/app/videos/shared/loader/loader.component.scsssimilarity index 100%rename from client/angular/videos/loader.component.scssrename to client/app/videos/shared/loader/loader.component.scssdiff --git a/client/angular/videos/loader.component.ts b/client/app/videos/shared/loader/loader.component.tssimilarity index 51%rename from client/angular/videos/loader.component.tsrename to client/app/videos/shared/loader/loader.component.tsindex 24329432e3..666d43bc34 100644--- a/client/angular/videos/loader.component.ts+++ b/client/app/videos/shared/loader/loader.component.ts@@ -2,8 +2,8 @@ import { Component, Input } from '@angular/core';@Component({selector: 'my-loader',- styleUrls: [ 'app/angular/videos/loader.component.css' ],- templateUrl: 'app/angular/videos/loader.component.html'+ styleUrls: [ 'client/app/videos/shared/loader/loader.component.css' ],+ templateUrl: 'client/app/videos/shared/loader/loader.component.html'})export class LoaderComponent {diff --git a/client/angular/videos/pagination.ts b/client/app/videos/shared/pagination.model.tssimilarity index 100%rename from client/angular/videos/pagination.tsrename to client/app/videos/shared/pagination.model.tsdiff --git a/client/angular/videos/components/list/sort.ts b/client/app/videos/shared/sort-field.type.tssimilarity index 100%rename from client/angular/videos/components/list/sort.tsrename to client/app/videos/shared/sort-field.type.tsdiff --git a/client/angular/videos/video.ts b/client/app/videos/shared/video.model.tssimilarity index 100%rename from client/angular/videos/video.tsrename to client/app/videos/shared/video.model.tsdiff --git a/client/angular/videos/videos.service.ts b/client/app/videos/shared/video.service.tssimilarity index 89%rename from client/angular/videos/videos.service.tsrename to client/app/videos/shared/video.service.tsindex d5438fd828..78789c3cc9 100644--- a/client/angular/videos/videos.service.ts+++ b/client/app/videos/shared/video.service.ts@@ -2,14 +2,14 @@ import { Injectable } from '@angular/core';import { Http, Response, URLSearchParams } from '@angular/http';import { Observable } from 'rxjs/Rx';-import { Pagination } from './pagination';-import { Video } from './video';-import { AuthService } from '../users/services/auth.service';-import { Search } from '../app/search';-import { SortField } from './components/list/sort';+import { Pagination } from './pagination.model';+import { Search } from '../../shared/index';+import { SortField } from './sort-field.type';+import { AuthService } from '../../users/index';+import { Video } from './video.model';@Injectable()-export class VideosService {+export class VideoService {private _baseVideoUrl = '/api/v1/videos/';constructor (private http: Http, private _authService: AuthService) {}diff --git a/client/app/videos/video-add/index.ts b/client/app/videos/video-add/index.tsnew file mode 100644index 0000000000..79488e8515--- /dev/null+++ b/client/app/videos/video-add/index.ts@@ -0,0 +1 @@+export * from './video-add.component';diff --git a/client/angular/videos/components/add/videos-add.component.html b/client/app/videos/video-add/video-add.component.htmlsimilarity index 100%rename from client/angular/videos/components/add/videos-add.component.htmlrename to client/app/videos/video-add/video-add.component.htmldiff --git a/client/angular/videos/components/add/videos-add.component.scss b/client/app/videos/video-add/video-add.component.scsssimilarity index 100%rename from client/angular/videos/components/add/videos-add.component.scssrename to client/app/videos/video-add/video-add.component.scssdiff --git a/client/angular/videos/components/add/videos-add.component.ts b/client/app/videos/video-add/video-add.component.tssimilarity index 84%rename from client/angular/videos/components/add/videos-add.component.tsrename to client/app/videos/video-add/video-add.component.tsindex f1652be19c..ca583a1036 100644--- a/client/angular/videos/components/add/videos-add.component.ts+++ b/client/app/videos/video-add/video-add.component.ts@@ -1,24 +1,23 @@import { Component, ElementRef, OnInit } from '@angular/core';import { Router } from '@angular/router-deprecated';-import { PROGRESSBAR_DIRECTIVES } from 'ng2-bootstrap/components/progressbar';import { BytesPipe } from 'angular-pipes/src/math/bytes.pipe';+import { PROGRESSBAR_DIRECTIVES } from 'ng2-bootstrap/components/progressbar';-import { AuthService } from '../../../users/services/auth.service';-import { User } from '../../../users/models/user';+import { AuthService, User } from '../../users/index';// TODO: import it with systemjsdeclare var jQuery:any;@Component({selector: 'my-videos-add',- styleUrls: [ 'app/angular/videos/components/add/videos-add.component.css' ],- templateUrl: 'app/angular/videos/components/add/videos-add.component.html',+ 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 VideosAddComponent implements OnInit {+export class VideoAddComponent implements OnInit {user: User;fileToUpload: any;progressBar: { value: number; max: number; } = { value: 0, max: 0 };diff --git a/client/app/videos/video-list/index.ts b/client/app/videos/video-list/index.tsnew file mode 100644index 0000000000..1f6d6a4e71--- /dev/null+++ b/client/app/videos/video-list/index.ts@@ -0,0 +1,3 @@+export * from './video-list.component';+export * from './video-miniature.component';+export * from './video-sort.component';diff --git a/client/angular/videos/components/list/videos-list.component.html b/client/app/videos/video-list/video-list.component.htmlsimilarity index 100%rename from client/angular/videos/components/list/videos-list.component.htmlrename to client/app/videos/video-list/video-list.component.htmldiff --git a/client/angular/videos/components/list/videos-list.component.scss b/client/app/videos/video-list/video-list.component.scsssimilarity index 100%rename from client/angular/videos/components/list/videos-list.component.scssrename to client/app/videos/video-list/video-list.component.scssdiff --git a/client/angular/videos/components/list/videos-list.component.ts b/client/app/videos/video-list/video-list.component.tssimilarity index 67%rename from client/angular/videos/components/list/videos-list.component.tsrename to client/app/videos/video-list/video-list.component.tsindex 56230e3311..a88fb379a4 100644--- a/client/angular/videos/components/list/videos-list.component.ts+++ b/client/app/videos/video-list/video-list.component.ts@@ -1,27 +1,28 @@import { Component, OnInit } from '@angular/core';-import { ROUTER_DIRECTIVES, RouteParams, Router } from '@angular/router-deprecated';+import { Router, ROUTER_DIRECTIVES, RouteParams } from '@angular/router-deprecated';import { PAGINATION_DIRECTIVES } from 'ng2-bootstrap/components/pagination';-import { AuthService } from '../../../users/services/auth.service';-import { Pagination } from '../../pagination';-import { User } from '../../../users/models/user';-import { VideosService } from '../../videos.service';-import { Video } from '../../video';+import {+ LoaderComponent,+ Pagination,+ SortField,+ Video,+ VideoService+} from '../shared/index';+import { Search, SearchField } from '../../shared/index';+import { AuthService, User } from '../../users/index';import { VideoMiniatureComponent } from './video-miniature.component';-import { Search, SearchField } from '../../../app/search';import { VideoSortComponent } from './video-sort.component';-import { SortField } from './sort';-import { LoaderComponent } from '../../loader.component';@Component({selector: 'my-videos-list',- styleUrls: [ 'app/angular/videos/components/list/videos-list.component.css' ],- templateUrl: 'app/angular/videos/components/list/videos-list.component.html',+ styleUrls: [ 'client/app/videos/video-list/video-list.component.css' ],+ templateUrl: 'client/app/videos/video-list/video-list.component.html',directives: [ ROUTER_DIRECTIVES, PAGINATION_DIRECTIVES, VideoMiniatureComponent, VideoSortComponent, LoaderComponent ]})-export class VideosListComponent implements OnInit {+export class VideoListComponent implements OnInit {user: User = null;videos: Video[] = [];pagination: Pagination = {@@ -36,7 +37,7 @@ export class VideosListComponent implements OnInit {constructor(private _authService: AuthService,- private _videosService: VideosService,+ private _videoService: VideoService,private _routeParams: RouteParams,private _router: Router) {@@ -63,9 +64,9 @@ export class VideosListComponent implements OnInit {let observable = null;if (this.search.value !== null) {- observable = this._videosService.searchVideos(this.search, this.pagination, this.sort);+ observable = this._videoService.searchVideos(this.search, this.pagination, this.sort);} else {- observable = this._videosService.getVideos(this.pagination, this.sort);+ observable = this._videoService.getVideos(this.pagination, this.sort);}observable.subscribe(diff --git a/client/angular/videos/components/list/video-miniature.component.html b/client/app/videos/video-list/video-miniature.component.htmlsimilarity index 100%rename from client/angular/videos/components/list/video-miniature.component.htmlrename to client/app/videos/video-list/video-miniature.component.htmldiff --git a/client/angular/videos/components/list/video-miniature.component.scss b/client/app/videos/video-list/video-miniature.component.scsssimilarity index 100%rename from client/angular/videos/components/list/video-miniature.component.scssrename to client/app/videos/video-list/video-miniature.component.scssdiff --git a/client/angular/videos/components/list/video-miniature.component.ts b/client/app/videos/video-list/video-miniature.component.tssimilarity index 66%rename from client/angular/videos/components/list/video-miniature.component.tsrename to client/app/videos/video-list/video-miniature.component.tsindex 383c2c609d..817636768c 100644--- a/client/angular/videos/components/list/video-miniature.component.ts+++ b/client/app/videos/video-list/video-miniature.component.ts@@ -1,15 +1,14 @@-import { Component, Input, Output, EventEmitter } from '@angular/core';import { DatePipe } from '@angular/common';+import { Component, Input, Output, EventEmitter } from '@angular/core';import { ROUTER_DIRECTIVES } from '@angular/router-deprecated';-import { Video } from '../../video';-import { VideosService } from '../../videos.service';-import { User } from '../../../users/models/user';+import { Video, VideoService } from '../shared/index';+import { User } from '../../users/index';@Component({selector: 'my-video-miniature',- styleUrls: [ 'app/angular/videos/components/list/video-miniature.component.css' ],- templateUrl: 'app/angular/videos/components/list/video-miniature.component.html',+ styleUrls: [ 'client/app/videos/video-list/video-miniature.component.css' ],+ templateUrl: 'client/app/videos/video-list/video-miniature.component.html',directives: [ ROUTER_DIRECTIVES ],pipes: [ DatePipe ]})@@ -22,7 +21,7 @@ export class VideoMiniatureComponent {hovering: boolean = false;- constructor(private _videosService: VideosService) {}+ constructor(private _videoService: VideoService) {}onHover() {this.hovering = true;@@ -38,7 +37,7 @@ export class VideoMiniatureComponent {removeVideo(id: string) {if (confirm('Do you really want to remove this video?')) {- this._videosService.removeVideo(id).subscribe(+ this._videoService.removeVideo(id).subscribe(status => this.removed.emit(true),error => alert(error));diff --git a/client/angular/videos/components/list/video-sort.component.html b/client/app/videos/video-list/video-sort.component.htmlsimilarity index 100%rename from client/angular/videos/components/list/video-sort.component.htmlrename to client/app/videos/video-list/video-sort.component.htmldiff --git a/client/angular/videos/components/list/video-sort.component.ts b/client/app/videos/video-list/video-sort.component.tssimilarity index 79%rename from client/angular/videos/components/list/video-sort.component.tsrename to client/app/videos/video-list/video-sort.component.tsindex 0373cea382..d00d7ed496 100644--- a/client/angular/videos/components/list/video-sort.component.ts+++ b/client/app/videos/video-list/video-sort.component.ts@@ -1,11 +1,11 @@-import { Component, Input, Output, EventEmitter } from '@angular/core';+import { Component, EventEmitter, Input, Output } from '@angular/core';-import { SortField } from './sort';+import { SortField } from '../shared/index';@Component({selector: 'my-video-sort',// styleUrls: [ 'app/angular/videos/components/list/video-sort.component.css' ],- templateUrl: 'app/angular/videos/components/list/video-sort.component.html'+ templateUrl: 'client/app/videos/video-list/video-sort.component.html'})export class VideoSortComponent {diff --git a/client/app/videos/video-watch/index.ts b/client/app/videos/video-watch/index.tsnew file mode 100644index 0000000000..2228b6ed7a--- /dev/null+++ b/client/app/videos/video-watch/index.ts@@ -0,0 +1 @@+export * from './video-watch.component';diff --git a/client/angular/videos/components/watch/videos-watch.component.html b/client/app/videos/video-watch/video-watch.component.htmlsimilarity index 100%rename from client/angular/videos/components/watch/videos-watch.component.htmlrename to client/app/videos/video-watch/video-watch.component.htmldiff --git a/client/angular/videos/components/watch/videos-watch.component.scss b/client/app/videos/video-watch/video-watch.component.scsssimilarity index 100%rename from client/angular/videos/components/watch/videos-watch.component.scssrename to client/app/videos/video-watch/video-watch.component.scssdiff --git a/client/angular/videos/components/watch/videos-watch.component.ts b/client/app/videos/video-watch/video-watch.component.tssimilarity index 74%rename from client/angular/videos/components/watch/videos-watch.component.tsrename to client/app/videos/video-watch/video-watch.component.tsindex e551e1f9a1..891e6563f4 100644--- a/client/angular/videos/components/watch/videos-watch.component.ts+++ b/client/app/videos/video-watch/video-watch.component.ts@@ -1,25 +1,22 @@-import { Component, OnInit, ElementRef } from '@angular/core';-import { RouteParams, CanDeactivate, ComponentInstruction } from '@angular/router-deprecated';+import { Component, ElementRef, OnInit } from '@angular/core';+import { CanDeactivate, ComponentInstruction, RouteParams } from '@angular/router-deprecated';import { BytesPipe } from 'angular-pipes/src/math/bytes.pipe';-import { LoaderComponent } from '../../loader.component';+import { LoaderComponent, Video, VideoService } from '../shared/index';// TODO import it with systemjsdeclare var WebTorrent: any;-import { Video } from '../../video';-import { VideosService } from '../../videos.service';-@Component({selector: 'my-video-watch',- templateUrl: 'app/angular/videos/components/watch/videos-watch.component.html',- styleUrls: [ 'app/angular/videos/components/watch/videos-watch.component.css' ],+ templateUrl: 'client/app/videos/video-watch/video-watch.component.html',+ styleUrls: [ 'client/app/videos/video-watch/video-watch.component.css' ],directives: [ LoaderComponent ],pipes: [ BytesPipe ]})-export class VideosWatchComponent implements OnInit, CanDeactivate {+export class VideoWatchComponent implements OnInit, CanDeactivate {video: Video;downloadSpeed: number;uploadSpeed: number;@@ -30,7 +27,7 @@ export class VideosWatchComponent implements OnInit, CanDeactivate {private client: any;constructor(- private _videosService: VideosService,+ private _videoService: VideoService,private _routeParams: RouteParams,private _elementRef: ElementRef) {@@ -40,7 +37,7 @@ export class VideosWatchComponent implements OnInit, CanDeactivate {ngOnInit() {let id = this._routeParams.get('id');- this._videosService.getVideo(id).subscribe(+ this._videoService.getVideo(id).subscribe(video => this.loadVideo(video),error => alert(error));diff --git a/client/index.html b/client/index.htmlindex db4b76613c..bc750dde7a 100644--- a/client/index.html+++ b/client/index.html@@ -7,27 +7,27 @@<meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1">- <link rel="stylesheet" href="/app/stylesheets/index.css">+ <link rel="stylesheet" href="client/stylesheets/index.css"><!-- 1. Load libraries --><!-- IE required polyfills, in this exact order -->- <script src="/app/node_modules/es6-shim/es6-shim.min.js"></script>- <script src="/app/node_modules/zone.js/dist/zone.js"></script>- <script src="/app/node_modules/reflect-metadata/Reflect.js"></script>- <script src="/app/node_modules/systemjs/dist/system.src.js"></script>+ <script src="client/node_modules/es6-shim/es6-shim.min.js"></script>+ <script src="client/node_modules/zone.js/dist/zone.js"></script>+ <script src="client/node_modules/reflect-metadata/Reflect.js"></script>+ <script src="client/node_modules/systemjs/dist/system.src.js"></script>- <script src="/app/node_modules/jquery/dist/jquery.js"></script>- <script src="/app/node_modules/jquery.ui.widget/jquery.ui.widget.js"></script>- <script src="/app/node_modules/blueimp-file-upload/js/jquery.fileupload.js"></script>+ <script src="client/node_modules/jquery/dist/jquery.js"></script>+ <script src="client/node_modules/jquery.ui.widget/jquery.ui.widget.js"></script>+ <script src="client/node_modules/blueimp-file-upload/js/jquery.fileupload.js"></script>- <script src="/app/node_modules/webtorrent/webtorrent.min.js"></script>+ <script src="client/node_modules/webtorrent/webtorrent.min.js"></script>- <script src="/app/node_modules/ng2-bootstrap/bundles/ng2-bootstrap.min.js"></script>+ <script src="client/node_modules/ng2-bootstrap/bundles/ng2-bootstrap.min.js"></script><!-- 2. Configure SystemJS -->- <script src="/app/systemjs.config.js"></script>+ <script src="client/systemjs.config.js"></script><script>- System.import('app').catch(function(err){ console.error(err); });+ System.import('client').catch(function(err){ console.error(err); });</script></head>diff --git a/client/angular/main.ts b/client/main.tssimilarity index 99%rename from client/angular/main.tsrename to client/main.tsindex e35f7dbdf2..5e2ea0de00 100644--- a/client/angular/main.ts+++ b/client/main.ts@@ -1,4 +1,5 @@import { bootstrap } from '@angular/platform-browser-dynamic';+import { AppComponent } from './app/app.component';bootstrap(AppComponent);diff --git a/client/stylesheets/application.scss b/client/stylesheets/application.scssindex b91698056e..98c1e37ad7 100644--- a/client/stylesheets/application.scss+++ b/client/stylesheets/application.scss@@ -1,4 +1,4 @@-$icon-font-path: "/app/node_modules/bootstrap-sass/assets/fonts/bootstrap/";+$icon-font-path: "/client/node_modules/bootstrap-sass/assets/fonts/bootstrap/";@import "bootstrap-variables";@import "_bootstrap";diff --git a/client/systemjs.config.js b/client/systemjs.config.jsindex 82ca5bb704..d04bc41077 100644--- a/client/systemjs.config.js+++ b/client/systemjs.config.js@@ -1,13 +1,12 @@;(function (global) {var map = {- 'app': 'app/angular',- 'angular-pipes': 'app/node_modules/angular-pipes',- 'ng2-bootstrap': 'app/node_modules/ng2-bootstrap',- 'angular-rxjs.bundle': 'app/bundles/angular-rxjs.bundle.js'+ 'angular-pipes': 'client/node_modules/angular-pipes',+ 'ng2-bootstrap': 'client/node_modules/ng2-bootstrap',+ 'angular-rxjs.bundle': 'client/bundles/angular-rxjs.bundle.js'}var packages = {- 'app': { main: 'main.js', defaultExtension: 'js' },+ 'client': { main: 'main.js', defaultExtension: 'js' },'ng2-bootstrap': { defaultExtension: 'js' },'rxjs': { defaultExtension: 'js' }}diff --git a/client/tsconfig.json b/client/tsconfig.jsonindex 8e786ca28c..d48bd39200 100644--- a/client/tsconfig.json+++ b/client/tsconfig.json@@ -20,26 +20,38 @@],"compileOnSave": false,"files": [- "angular/app/app.component.ts",- "angular/app/search.component.ts",- "angular/app/search.ts",- "angular/friends/services/friends.service.ts",- "angular/main.ts",- "angular/users/components/login/login.component.ts",- "angular/users/models/authStatus.ts",- "angular/users/models/token.ts",- "angular/users/models/user.ts",- "angular/users/services/auth.service.ts",- "angular/videos/components/add/videos-add.component.ts",- "angular/videos/components/list/sort.ts",- "angular/videos/components/list/video-miniature.component.ts",- "angular/videos/components/list/video-sort.component.ts",- "angular/videos/components/list/videos-list.component.ts",- "angular/videos/components/watch/videos-watch.component.ts",- "angular/videos/loader.component.ts",- "angular/videos/pagination.ts",- "angular/videos/video.ts",- "angular/videos/videos.service.ts",+ "app/app.component.ts",+ "app/friends/friend.service.ts",+ "app/friends/index.ts",+ "app/shared/index.ts",+ "app/shared/search-field.type.ts",+ "app/shared/search.component.ts",+ "app/shared/search.model.ts",+ "app/users/index.ts",+ "app/users/login/index.ts",+ "app/users/login/login.component.ts",+ "app/users/shared/auth-status.model.ts",+ "app/users/shared/auth.service.ts",+ "app/users/shared/index.ts",+ "app/users/shared/token.model.ts",+ "app/users/shared/user.model.ts",+ "app/videos/index.ts",+ "app/videos/shared/index.ts",+ "app/videos/shared/loader/index.ts",+ "app/videos/shared/loader/loader.component.ts",+ "app/videos/shared/pagination.model.ts",+ "app/videos/shared/sort-field.type.ts",+ "app/videos/shared/video.model.ts",+ "app/videos/shared/video.service.ts",+ "app/videos/video-add/index.ts",+ "app/videos/video-add/video-add.component.ts",+ "app/videos/video-list/index.ts",+ "app/videos/video-list/video-list.component.ts",+ "app/videos/video-list/video-miniature.component.ts",+ "app/videos/video-list/video-sort.component.ts",+ "app/videos/video-watch/index.ts",+ "app/videos/video-watch/video-watch.component.ts",+ "main.ts","typings/globals/es6-shim/index.d.ts","typings/globals/jasmine/index.d.ts","typings/globals/node/index.d.ts",diff --git a/scripts/build/client/sass.sh b/scripts/build/client/sass.shindex 0caa0df20a..d8dfedca36 100755--- a/scripts/build/client/sass.sh+++ b/scripts/build/client/sass.sh@@ -6,4 +6,4 @@ cd client || exit -1# Compile index and angular filesconcurrently \"node-sass --include-path node_modules/bootstrap-sass/assets/stylesheets/ stylesheets/application.scss stylesheets/index.css" \- "node-sass angular/ --output angular/"+ "node-sass app/ --output app/"diff --git a/scripts/clean/client/sass.sh b/scripts/clean/client/sass.shindex 82c079f286..04d239ffc6 100755--- a/scripts/clean/client/sass.sh+++ b/scripts/clean/client/sass.sh@@ -2,4 +2,4 @@cd client || exit -1rm -f stylesheets/index.css-find angular -regextype posix-egrep -regex ".*\.(css)$" -exec rm -f {} \;+find app -regextype posix-egrep -regex ".*\.(css)$" -exec rm -f {} \;diff --git a/scripts/clean/client/tsc.sh b/scripts/clean/client/tsc.shindex 3ea6e78d5b..b17888640b 100755--- a/scripts/clean/client/tsc.sh+++ b/scripts/clean/client/tsc.sh@@ -1,5 +1,6 @@#!/usr/bin/env shcd client || exit -1-find angular -regextype posix-egrep -regex ".*\.(js|map)$" -exec rm -f {} \;+find app -regextype posix-egrep -regex ".*\.(js|map)$" -exec rm -f {} \;rm -rf ./bundles+rm -f main.js main.js.mapdiff --git a/scripts/watch/client/livereload.sh b/scripts/watch/client/livereload.shindex a4acc439c9..5f095265ef 100755--- a/scripts/watch/client/livereload.sh+++ b/scripts/watch/client/livereload.sh@@ -1,3 +1,3 @@#!/usr/bin/env sh-livereload client/angular -e scss+livereload client/app -e scssdiff --git a/scripts/watch/client/sass.sh b/scripts/watch/client/sass.shindex 22c536e383..f7a8c8a2b9 100755--- a/scripts/watch/client/sass.sh+++ b/scripts/watch/client/sass.sh@@ -4,4 +4,4 @@ cd client || exit -1concurrently \"node-sass -w --include-path node_modules/bootstrap-sass/assets/stylesheets/ stylesheets/application.scss stylesheets/index.css" \- "node-sass -w angular/ --output angular/"+ "node-sass -w app/ --output app/"diff --git a/server.js b/server.jsindex 024ce10f86..02c0d53cd7 100644--- a/server.js+++ b/server.js@@ -64,9 +64,9 @@ const apiRoute = '/api/' + constants.API_VERSIONapp.use(apiRoute, routes.api)// Static files-app.use('/app', express.static(path.join(__dirname, '/client'), { maxAge: 0 }))+app.use('/client', express.static(path.join(__dirname, '/client'), { maxAge: 0 }))// 404 for static files not found-app.use('/app/*', function (req, res, next) {+app.use('/client/*', function (req, res, next) {res.sendStatus(404)})