]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Follow the angular styleguide for the directories structure
authorChocobozzz <florian.bigard@gmail.com>
Fri, 27 May 2016 14:23:10 +0000 (16:23 +0200)
committerChocobozzz <florian.bigard@gmail.com>
Fri, 27 May 2016 14:23:10 +0000 (16:23 +0200)
59 files changed:
client/.gitignore
client/app/app.component.html [moved from client/angular/app/app.component.html with 100% similarity]
client/app/app.component.scss [moved from client/angular/app/app.component.scss with 100% similarity]
client/app/app.component.ts [moved from client/angular/app/app.component.ts with 55% similarity]
client/app/friends/friend.service.ts [moved from client/angular/friends/services/friends.service.ts with 96% similarity]
client/app/friends/index.ts [new file with mode: 0644]
client/app/shared/index.ts [new file with mode: 0644]
client/app/shared/search-field.type.ts [moved from client/angular/app/search.ts with 50% similarity]
client/app/shared/search.component.html [moved from client/angular/app/search.component.html with 100% similarity]
client/app/shared/search.component.ts [moved from client/angular/app/search.component.ts with 85% similarity]
client/app/shared/search.model.ts [new file with mode: 0644]
client/app/users/index.ts [new file with mode: 0644]
client/app/users/login/index.ts [new file with mode: 0644]
client/app/users/login/login.component.html [moved from client/angular/users/components/login/login.component.html with 100% similarity]
client/app/users/login/login.component.scss [moved from client/angular/users/components/login/login.component.scss with 100% similarity]
client/app/users/login/login.component.ts [moved from client/angular/users/components/login/login.component.ts with 72% similarity]
client/app/users/shared/auth-status.model.ts [moved from client/angular/users/models/authStatus.ts with 100% similarity]
client/app/users/shared/auth.service.ts [moved from client/angular/users/services/auth.service.ts with 94% similarity]
client/app/users/shared/index.ts [new file with mode: 0644]
client/app/users/shared/token.model.ts [moved from client/angular/users/models/token.ts with 100% similarity]
client/app/users/shared/user.model.ts [moved from client/angular/users/models/user.ts with 90% similarity]
client/app/videos/index.ts [new file with mode: 0644]
client/app/videos/shared/index.ts [new file with mode: 0644]
client/app/videos/shared/loader/index.ts [new file with mode: 0644]
client/app/videos/shared/loader/loader.component.html [moved from client/angular/videos/loader.component.html with 100% similarity]
client/app/videos/shared/loader/loader.component.scss [moved from client/angular/videos/loader.component.scss with 100% similarity]
client/app/videos/shared/loader/loader.component.ts [moved from client/angular/videos/loader.component.ts with 51% similarity]
client/app/videos/shared/pagination.model.ts [moved from client/angular/videos/pagination.ts with 100% similarity]
client/app/videos/shared/sort-field.type.ts [moved from client/angular/videos/components/list/sort.ts with 100% similarity]
client/app/videos/shared/video.model.ts [moved from client/angular/videos/video.ts with 100% similarity]
client/app/videos/shared/video.service.ts [moved from client/angular/videos/videos.service.ts with 89% similarity]
client/app/videos/video-add/index.ts [new file with mode: 0644]
client/app/videos/video-add/video-add.component.html [moved from client/angular/videos/components/add/videos-add.component.html with 100% similarity]
client/app/videos/video-add/video-add.component.scss [moved from client/angular/videos/components/add/videos-add.component.scss with 100% similarity]
client/app/videos/video-add/video-add.component.ts [moved from client/angular/videos/components/add/videos-add.component.ts with 84% similarity]
client/app/videos/video-list/index.ts [new file with mode: 0644]
client/app/videos/video-list/video-list.component.html [moved from client/angular/videos/components/list/videos-list.component.html with 100% similarity]
client/app/videos/video-list/video-list.component.scss [moved from client/angular/videos/components/list/videos-list.component.scss with 100% similarity]
client/app/videos/video-list/video-list.component.ts [moved from client/angular/videos/components/list/videos-list.component.ts with 67% similarity]
client/app/videos/video-list/video-miniature.component.html [moved from client/angular/videos/components/list/video-miniature.component.html with 100% similarity]
client/app/videos/video-list/video-miniature.component.scss [moved from client/angular/videos/components/list/video-miniature.component.scss with 100% similarity]
client/app/videos/video-list/video-miniature.component.ts [moved from client/angular/videos/components/list/video-miniature.component.ts with 66% similarity]
client/app/videos/video-list/video-sort.component.html [moved from client/angular/videos/components/list/video-sort.component.html with 100% similarity]
client/app/videos/video-list/video-sort.component.ts [moved from client/angular/videos/components/list/video-sort.component.ts with 79% similarity]
client/app/videos/video-watch/index.ts [new file with mode: 0644]
client/app/videos/video-watch/video-watch.component.html [moved from client/angular/videos/components/watch/videos-watch.component.html with 100% similarity]
client/app/videos/video-watch/video-watch.component.scss [moved from client/angular/videos/components/watch/videos-watch.component.scss with 100% similarity]
client/app/videos/video-watch/video-watch.component.ts [moved from client/angular/videos/components/watch/videos-watch.component.ts with 74% similarity]
client/index.html
client/main.ts [moved from client/angular/main.ts with 99% similarity]
client/stylesheets/application.scss
client/systemjs.config.js
client/tsconfig.json
scripts/build/client/sass.sh
scripts/clean/client/sass.sh
scripts/clean/client/tsc.sh
scripts/watch/client/livereload.sh
scripts/watch/client/sass.sh
server.js

index 0ab218d7183c25806f52edb6ee412e23ece66143..81e4a1cf7defb1b796eec84483f384f045254171 100644 (file)
@@ -1,6 +1,8 @@
 typings
 typings
-angular/**/*.js
-angular/**/*.map
-angular/**/*.css
+app/**/*.js
+app/**/*.map
+app/**/*.css
 stylesheets/index.css
 bundles
 stylesheets/index.css
 bundles
+main.js
+main.js.map
similarity index 55%
rename from client/angular/app/app.component.ts
rename to client/app/app.component.ts
index 722d0dca03172c1830cedf9d575c6775d79ca906..c94ff79a79cfef34b69f38ea41af9bddc9d344b4 100644 (file)
@@ -1,17 +1,20 @@
 import { Component } from '@angular/core';
 import { Component } from '@angular/core';
-import { RouteConfig, ROUTER_DIRECTIVES, ROUTER_PROVIDERS, Router } from '@angular/router-deprecated';
 import { HTTP_PROVIDERS } from '@angular/http';
 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([
   {
 
 @RouteConfig([
   {
@@ -22,35 +25,35 @@ import { Search } from './search';
   {
     path: '/videos/list',
     name: 'VideosList',
   {
     path: '/videos/list',
     name: 'VideosList',
-    component: VideosListComponent,
+    component: VideoListComponent,
     useAsDefault: true
   },
   {
     path: '/videos/watch/:id',
     name: 'VideosWatch',
     useAsDefault: true
   },
   {
     path: '/videos/watch/:id',
     name: 'VideosWatch',
-    component: VideosWatchComponent
+    component: VideoWatchComponent
   },
   {
     path: '/videos/add',
     name: 'VideosAdd',
   },
   {
     path: '/videos/add',
     name: 'VideosAdd',
-    component: VideosAddComponent
+    component: VideoAddComponent
   }
 ])
 
 @Component({
     selector: 'my-app',
   }
 ])
 
 @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 ],
     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;
 })
 
 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
 
               private _authService: AuthService,
               private _router: Router
 
@@ -83,7 +86,7 @@ export class AppComponent {
   }
 
   makeFriends() {
   }
 
   makeFriends() {
-    this._friendsService.makeFriends().subscribe(
+    this._friendService.makeFriends().subscribe(
       status => {
         if (status === 409) {
           alert('Already made friends!');
       status => {
         if (status === 409) {
           alert('Already made friends!');
@@ -96,7 +99,7 @@ export class AppComponent {
   }
 
   quitFriends() {
   }
 
   quitFriends() {
-    this._friendsService.quitFriends().subscribe(
+    this._friendService.quitFriends().subscribe(
       status => {
           alert('Quit friends!');
       },
       status => {
           alert('Quit friends!');
       },
similarity index 96%
rename from client/angular/friends/services/friends.service.ts
rename to client/app/friends/friend.service.ts
index cb34323e447eb6ae0074296cc11fab7f7b356c89..d143ec40d07b83282a9d0f8db0ea20dc8a4281fa 100644 (file)
@@ -3,7 +3,7 @@ import { Http, Response } from '@angular/http';
 import { Observable } from 'rxjs/Rx';
 
 @Injectable()
 import { Observable } from 'rxjs/Rx';
 
 @Injectable()
-export class FriendsService {
+export class FriendService {
   private _baseFriendsUrl = '/api/v1/pods/';
 
   constructor (private http: Http) {}
   private _baseFriendsUrl = '/api/v1/pods/';
 
   constructor (private http: Http) {}
diff --git a/client/app/friends/index.ts b/client/app/friends/index.ts
new file mode 100644 (file)
index 0000000..0adc256
--- /dev/null
@@ -0,0 +1 @@
+export * from './friend.service';
diff --git a/client/app/shared/index.ts b/client/app/shared/index.ts
new file mode 100644 (file)
index 0000000..a49a4f1
--- /dev/null
@@ -0,0 +1,3 @@
+export * from './search-field.type';
+export * from './search.component';
+export * from './search.model';
similarity index 50%
rename from client/angular/app/search.ts
rename to client/app/shared/search-field.type.ts
index c4e771b4770de544d987ac0dc53cfadfec097ab1..846236290cb4ce21f42d78f444e351ce94856488 100644 (file)
@@ -1,6 +1 @@
 export type SearchField = "name" | "author" | "podUrl" | "magnetUri";
 export type SearchField = "name" | "author" | "podUrl" | "magnetUri";
-
-export interface Search {
-  field: SearchField;
-  value: string;
-}
similarity index 85%
rename from client/angular/app/search.component.ts
rename to client/app/shared/search.component.ts
index e21b91fcef7ab5fdf3e3f2df121e9281b6068122..519810f9b9c107a70654bb64a705087746a54458 100644 (file)
@@ -2,11 +2,12 @@ import { Component, EventEmitter, Output } from '@angular/core';
 
 import { DROPDOWN_DIRECTIVES} from  'ng2-bootstrap/components/dropdown';
 
 
 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',
 
 @Component({
     selector: 'my-search',
-    templateUrl: 'app/angular/app/search.component.html',
+    templateUrl: 'client/app/shared/search.component.html',
     directives: [ DROPDOWN_DIRECTIVES ]
 })
 
     directives: [ DROPDOWN_DIRECTIVES ]
 })
 
diff --git a/client/app/shared/search.model.ts b/client/app/shared/search.model.ts
new file mode 100644 (file)
index 0000000..932a656
--- /dev/null
@@ -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.ts
new file mode 100644 (file)
index 0000000..4f08b8b
--- /dev/null
@@ -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.ts
new file mode 100644 (file)
index 0000000..69c1644
--- /dev/null
@@ -0,0 +1 @@
+export * from './login.component';
similarity index 72%
rename from client/angular/users/components/login/login.component.ts
rename to client/app/users/login/login.component.ts
index d339353ef654c9346e250fd7800a9fdbcc0457d1..33590ad4c570ab6ecdf6ae60c602ad99fc4d9ce1 100644 (file)
@@ -1,14 +1,12 @@
 import { Component } from '@angular/core';
 import { Router } from '@angular/router-deprecated';
 
 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',
 
 @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 {
 })
 
 export class UserLoginComponent {
similarity index 94%
rename from client/angular/users/services/auth.service.ts
rename to client/app/users/shared/auth.service.ts
index 099563d43bdb6273cd1391e77fef6f1ff21125bc..1cb042db57d9fa62ac27ffd78b57affaefd7751a 100644 (file)
@@ -1,9 +1,9 @@
 import { Injectable } from '@angular/core';
 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 { 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 {
 
 @Injectable()
 export class AuthService {
diff --git a/client/app/users/shared/index.ts b/client/app/users/shared/index.ts
new file mode 100644 (file)
index 0000000..c6816b3
--- /dev/null
@@ -0,0 +1,4 @@
+export * from './auth-status.model';
+export * from './auth.service';
+export * from './token.model';
+export * from './user.model';
similarity index 90%
rename from client/angular/users/models/user.ts
rename to client/app/users/shared/user.model.ts
index 3367e3bb52cd5fbeaae9898f21eefe8275571d69..73fd4ddc05fb515d7db53270b92e1da17e006a0c 100644 (file)
@@ -1,4 +1,4 @@
-import { Token } from './token';
+import { Token } from './token.model';
 
 export class User {
   username: string;
 
 export class User {
   username: string;
diff --git a/client/app/videos/index.ts b/client/app/videos/index.ts
new file mode 100644 (file)
index 0000000..1c80ac5
--- /dev/null
@@ -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.ts
new file mode 100644 (file)
index 0000000..c535c46
--- /dev/null
@@ -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.ts
new file mode 100644 (file)
index 0000000..ab22584
--- /dev/null
@@ -0,0 +1 @@
+export * from './loader.component';
similarity index 51%
rename from client/angular/videos/loader.component.ts
rename to client/app/videos/shared/loader/loader.component.ts
index 24329432e3454139ac18edc58c5a3a919f189f92..666d43bc347177b5eecf2744ea34260b0ae878a0 100644 (file)
@@ -2,8 +2,8 @@ import { Component, Input } from '@angular/core';
 
 @Component({
   selector: 'my-loader',
 
 @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 {
 })
 
 export class LoaderComponent {
similarity index 89%
rename from client/angular/videos/videos.service.ts
rename to client/app/videos/shared/video.service.ts
index d5438fd828db3b0dd1b7a20db8e74b1b4dfbad6a..78789c3cc95543f6e7405388d2b758948ac83613 100644 (file)
@@ -2,14 +2,14 @@ import { Injectable } from '@angular/core';
 import { Http, Response, URLSearchParams } from '@angular/http';
 import { Observable } from 'rxjs/Rx';
 
 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()
 
 @Injectable()
-export class VideosService {
+export class VideoService {
   private _baseVideoUrl = '/api/v1/videos/';
 
   constructor (private http: Http, private _authService: AuthService) {}
   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.ts
new file mode 100644 (file)
index 0000000..79488e8
--- /dev/null
@@ -0,0 +1 @@
+export * from './video-add.component';
similarity index 84%
rename from client/angular/videos/components/add/videos-add.component.ts
rename to client/app/videos/video-add/video-add.component.ts
index f1652be19cc492b1f084abc1cf8fd2f886881661..ca583a1036b332c5ed8ce7b73fdb6f175eaccbc3 100644 (file)
@@ -1,24 +1,23 @@
 import { Component, ElementRef, OnInit } from '@angular/core';
 import { Router } from '@angular/router-deprecated';
 
 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 { 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 systemjs
 declare var jQuery:any;
 
 @Component({
   selector: 'my-videos-add',
 
 // TODO: import it with systemjs
 declare 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 ]
 })
 
   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 };
   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.ts
new file mode 100644 (file)
index 0000000..1f6d6a4
--- /dev/null
@@ -0,0 +1,3 @@
+export * from './video-list.component';
+export * from './video-miniature.component';
+export * from './video-sort.component';
similarity index 67%
rename from client/angular/videos/components/list/videos-list.component.ts
rename to client/app/videos/video-list/video-list.component.ts
index 56230e331119d6948f04d0c78a4a6df72388de7b..a88fb379a4513ea79ad448e187e30f7fd2cedf97 100644 (file)
@@ -1,27 +1,28 @@
 import { Component, OnInit } from '@angular/core';
 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 { 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 { VideoMiniatureComponent } from './video-miniature.component';
-import { Search, SearchField } from '../../../app/search';
 import { VideoSortComponent } from './video-sort.component';
 import { VideoSortComponent } from './video-sort.component';
-import { SortField } from './sort';
-import { LoaderComponent } from '../../loader.component';
 
 @Component({
   selector: 'my-videos-list',
 
 @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 ]
 })
 
   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 = {
   user: User = null;
   videos: Video[] = [];
   pagination: Pagination = {
@@ -36,7 +37,7 @@ export class VideosListComponent implements OnInit {
 
   constructor(
     private _authService: AuthService,
 
   constructor(
     private _authService: AuthService,
-    private _videosService: VideosService,
+    private _videoService: VideoService,
     private _routeParams: RouteParams,
     private _router: Router
   ) {
     private _routeParams: RouteParams,
     private _router: Router
   ) {
@@ -63,9 +64,9 @@ export class VideosListComponent implements OnInit {
     let observable = null;
 
     if (this.search.value !== null) {
     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 {
     } else {
-      observable = this._videosService.getVideos(this.pagination, this.sort);
+      observable = this._videoService.getVideos(this.pagination, this.sort);
     }
 
     observable.subscribe(
     }
 
     observable.subscribe(
similarity index 66%
rename from client/angular/videos/components/list/video-miniature.component.ts
rename to client/app/videos/video-list/video-miniature.component.ts
index 383c2c609d79f11db8d19b4e5e4193d01d55aaa8..817636768cfb8ff2d4367a1bfc1af47d8d96ae89 100644 (file)
@@ -1,15 +1,14 @@
-import { Component, Input, Output, EventEmitter } from '@angular/core';
 import { DatePipe } from '@angular/common';
 import { DatePipe } from '@angular/common';
+import { Component, Input, Output, EventEmitter } from '@angular/core';
 import { ROUTER_DIRECTIVES } from '@angular/router-deprecated';
 
 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',
 
 @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 ]
 })
   directives: [ ROUTER_DIRECTIVES ],
   pipes: [ DatePipe ]
 })
@@ -22,7 +21,7 @@ export class VideoMiniatureComponent {
 
   hovering: boolean = false;
 
 
   hovering: boolean = false;
 
-  constructor(private _videosService: VideosService) {}
+  constructor(private _videoService: VideoService) {}
 
   onHover() {
     this.hovering = true;
 
   onHover() {
     this.hovering = true;
@@ -38,7 +37,7 @@ export class VideoMiniatureComponent {
 
   removeVideo(id: string) {
     if (confirm('Do you really want to remove this video?')) {
 
   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)
       );
         status => this.removed.emit(true),
         error => alert(error)
       );
similarity index 79%
rename from client/angular/videos/components/list/video-sort.component.ts
rename to client/app/videos/video-list/video-sort.component.ts
index 0373cea382659fc8e0839918c3b122e4683c12c2..d00d7ed4968250af33e16c5fee04a8480d4d1c2e 100644 (file)
@@ -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' ],
 
 @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 {
 })
 
 export class VideoSortComponent {
diff --git a/client/app/videos/video-watch/index.ts b/client/app/videos/video-watch/index.ts
new file mode 100644 (file)
index 0000000..2228b6e
--- /dev/null
@@ -0,0 +1 @@
+export * from './video-watch.component';
similarity index 74%
rename from client/angular/videos/components/watch/videos-watch.component.ts
rename to client/app/videos/video-watch/video-watch.component.ts
index e551e1f9a1fae1ab45b63478090571bc0e8a9731..891e6563f4f7c253a2df07a2b97c889726eec4be 100644 (file)
@@ -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 { BytesPipe } from 'angular-pipes/src/math/bytes.pipe';
 
-import { LoaderComponent } from '../../loader.component';
+import { LoaderComponent, Video, VideoService } from '../shared/index';
 
 // TODO import it with systemjs
 declare var WebTorrent: any;
 
 
 // TODO import it with systemjs
 declare var WebTorrent: any;
 
-import { Video } from '../../video';
-import { VideosService } from '../../videos.service';
-
 @Component({
   selector: 'my-video-watch',
 @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 ]
 })
 
   directives: [ LoaderComponent ],
   pipes: [ BytesPipe ]
 })
 
-export class VideosWatchComponent implements OnInit, CanDeactivate {
+export class VideoWatchComponent implements OnInit, CanDeactivate {
   video: Video;
   downloadSpeed: number;
   uploadSpeed: number;
   video: Video;
   downloadSpeed: number;
   uploadSpeed: number;
@@ -30,7 +27,7 @@ export class VideosWatchComponent implements OnInit, CanDeactivate {
   private client: any;
 
   constructor(
   private client: any;
 
   constructor(
-    private _videosService: VideosService,
+    private _videoService: VideoService,
     private _routeParams: RouteParams,
     private _elementRef: ElementRef
   ) {
     private _routeParams: RouteParams,
     private _elementRef: ElementRef
   ) {
@@ -40,7 +37,7 @@ export class VideosWatchComponent implements OnInit, CanDeactivate {
 
   ngOnInit() {
     let id = this._routeParams.get('id');
 
   ngOnInit() {
     let id = this._routeParams.get('id');
-    this._videosService.getVideo(id).subscribe(
+    this._videoService.getVideo(id).subscribe(
       video => this.loadVideo(video),
       error => alert(error)
     );
       video => this.loadVideo(video),
       error => alert(error)
     );
index db4b76613c5a0707b4f6ab5fb9dd44acbab7d000..bc750dde7a2a98769940608116f7d6ab8b65b3c7 100644 (file)
@@ -7,27 +7,27 @@
     <meta charset="UTF-8">
     <meta name="viewport" content="width=device-width, initial-scale=1">
 
     <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 -->
 
     <!-- 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 -->
 
     <!-- 2. Configure SystemJS -->
-    <script src="/app/systemjs.config.js"></script>
+    <script src="client/systemjs.config.js"></script>
     <script>
     <script>
-      System.import('app').catch(function(err){ console.error(err); });
+      System.import('client').catch(function(err){ console.error(err); });
     </script>
   </head>
 
     </script>
   </head>
 
similarity index 99%
rename from client/angular/main.ts
rename to client/main.ts
index e35f7dbdf219a418b0a34aa3122a2889342dc4f3..5e2ea0de007391fc0d2f112d3f32e870e2f572a3 100644 (file)
@@ -1,4 +1,5 @@
 import { bootstrap }    from '@angular/platform-browser-dynamic';
 import { bootstrap }    from '@angular/platform-browser-dynamic';
+
 import { AppComponent } from './app/app.component';
 
 bootstrap(AppComponent);
 import { AppComponent } from './app/app.component';
 
 bootstrap(AppComponent);
index b91698056e0100058680886f97af506b48d11fee..98c1e37ad746d5d080989631980dd467e95b2f0b 100644 (file)
@@ -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";
 
 @import "bootstrap-variables";
 @import "_bootstrap";
index 82ca5bb704f8cf6e6fbb22860f9de41c7e3d2cd3..d04bc4107711445288f001a3b3334c401f04abb0 100644 (file)
@@ -1,13 +1,12 @@
 ;(function (global) {
   var map = {
 ;(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 = {
   }
 
   var packages = {
-    'app': { main: 'main.js', defaultExtension: 'js' },
+    'client': { main: 'main.js', defaultExtension: 'js' },
     'ng2-bootstrap': { defaultExtension: 'js' },
     'rxjs': { defaultExtension: 'js' }
   }
     'ng2-bootstrap': { defaultExtension: 'js' },
     'rxjs': { defaultExtension: 'js' }
   }
index 8e786ca28cc7ffa671fe820493cbf905016bb80a..d48bd392009b206313a4e51e2cd6b41a422cd91d 100644 (file)
   ],
   "compileOnSave": false,
   "files": [
   ],
   "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",
     "typings/globals/es6-shim/index.d.ts",
     "typings/globals/jasmine/index.d.ts",
     "typings/globals/node/index.d.ts",
index 0caa0df20a227b65f391d9d4b9f4aa126fd433f0..d8dfedca362d7f2b9c774e7c993845fa200740bf 100755 (executable)
@@ -6,4 +6,4 @@ cd client || exit -1
 # Compile index and angular files
 concurrently \
   "node-sass --include-path node_modules/bootstrap-sass/assets/stylesheets/ stylesheets/application.scss stylesheets/index.css" \
 # Compile index and angular files
 concurrently \
   "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/"
index 82c079f28637fb0a75e385ef7267d96de278aff0..04d239ffc64392ea2c762d5ddd2b5e52b0b30d88 100755 (executable)
@@ -2,4 +2,4 @@
 
 cd client || exit -1
 rm -f stylesheets/index.css
 
 cd client || exit -1
 rm -f stylesheets/index.css
-find angular -regextype posix-egrep -regex ".*\.(css)$" -exec rm -f {} \;
+find app -regextype posix-egrep -regex ".*\.(css)$" -exec rm -f {} \;
index 3ea6e78d5b8cc5353094877d3de2b241ea6629b9..b17888640bb87ec3ff3619a74c77d67f4404cfa4 100755 (executable)
@@ -1,5 +1,6 @@
 #!/usr/bin/env sh
 
 cd client || exit -1
 #!/usr/bin/env sh
 
 cd 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 -rf ./bundles
+rm -f main.js main.js.map
index a4acc439c90da77806a0b3458d53525ea15ed671..5f095265ef954ee3156f4e4fc3a3d4e37305a842 100755 (executable)
@@ -1,3 +1,3 @@
 #!/usr/bin/env sh
 
 #!/usr/bin/env sh
 
-livereload client/angular -e scss 
+livereload client/app -e scss 
index 22c536e383f3ddba85057c00767ea6988d509d1c..f7a8c8a2b9820defb1bf4df7b85f3165995d081d 100755 (executable)
@@ -4,4 +4,4 @@ cd client || exit -1
 
 concurrently \
   "node-sass -w --include-path node_modules/bootstrap-sass/assets/stylesheets/ stylesheets/application.scss stylesheets/index.css" \
 
 concurrently \
   "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/"
index 024ce10f86c87246b97a9e5d875ce859a652d729..02c0d53cd7ef949fe0592aac77ce3bffbcc9c984 100644 (file)
--- a/server.js
+++ b/server.js
@@ -64,9 +64,9 @@ const apiRoute = '/api/' + constants.API_VERSION
 app.use(apiRoute, routes.api)
 
 // Static files
 app.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
 // 404 for static files not found
-app.use('/app/*', function (req, res, next) {
+app.use('/client/*', function (req, res, next) {
   res.sendStatus(404)
 })
 
   res.sendStatus(404)
 })