aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app')
-rw-r--r--client/src/app/+admin/follows/following-add/following-add.component.scss4
-rw-r--r--client/src/app/+admin/follows/shared/follow.service.ts13
-rw-r--r--client/src/app/+admin/index.ts1
-rw-r--r--client/src/app/+admin/jobs/job.routes.ts5
-rw-r--r--client/src/app/+admin/jobs/shared/job.service.ts4
-rw-r--r--client/src/app/+admin/users/shared/user.service.ts3
-rw-r--r--client/src/app/+admin/users/user-edit/user-edit.component.scss3
-rw-r--r--client/src/app/+admin/users/user-list/user-list.component.scss19
-rw-r--r--client/src/app/account/account-settings/account-change-password/account-change-password.component.scss3
-rw-r--r--client/src/app/account/account-settings/account-details/account-details.component.scss3
-rw-r--r--client/src/app/account/account-settings/account-settings.component.scss3
-rw-r--r--client/src/app/account/account-videos/account-videos.component.scss3
-rw-r--r--client/src/app/account/account.module.ts1
-rw-r--r--client/src/app/app-routing.module.ts2
-rw-r--r--client/src/app/app.component.scss3
-rw-r--r--client/src/app/app.module.ts84
-rw-r--r--client/src/app/app.resolver.ts20
-rw-r--r--client/src/app/app.service.ts48
-rw-r--r--client/src/app/core/auth/auth.service.ts10
-rw-r--r--client/src/app/core/core.module.ts1
-rw-r--r--client/src/app/core/server/server.service.ts6
-rw-r--r--client/src/app/environment.ts77
-rw-r--r--client/src/app/header/header.component.scss3
-rw-r--r--client/src/app/login/login.component.scss3
-rw-r--r--client/src/app/menu/menu.component.scss3
-rw-r--r--client/src/app/shared/account/account.model.ts3
-rw-r--r--client/src/app/shared/forms/form-validators/host.ts (renamed from client/src/app/shared/forms/form-validators/host.validator.ts)0
-rw-r--r--client/src/app/shared/forms/form-validators/index.ts2
-rw-r--r--client/src/app/shared/forms/form-validators/validator-message.ts5
-rw-r--r--client/src/app/shared/forms/form-validators/video.ts6
-rw-r--r--client/src/app/shared/misc/button.component.scss3
-rw-r--r--client/src/app/shared/users/user.service.ts8
-rw-r--r--client/src/app/shared/video-abuse/video-abuse.service.ts12
-rw-r--r--client/src/app/shared/video-blacklist/video-blacklist.service.ts13
-rw-r--r--client/src/app/shared/video/video-miniature.component.scss3
-rw-r--r--client/src/app/shared/video/video-thumbnail.component.scss3
-rw-r--r--client/src/app/shared/video/video.model.ts5
-rw-r--r--client/src/app/shared/video/video.service.ts6
-rw-r--r--client/src/app/signup/signup.component.scss3
-rw-r--r--client/src/app/videos/+video-edit/index.ts2
-rw-r--r--client/src/app/videos/+video-edit/shared/video-description.component.scss3
-rw-r--r--client/src/app/videos/+video-edit/shared/video-edit.component.scss3
-rw-r--r--client/src/app/videos/+video-edit/shared/video-edit.component.ts9
-rw-r--r--client/src/app/videos/+video-edit/video-add.component.scss3
-rw-r--r--client/src/app/videos/+video-edit/video-add.component.ts5
-rw-r--r--client/src/app/videos/+video-edit/video-update.component.ts6
-rw-r--r--client/src/app/videos/+video-watch/index.ts1
-rw-r--r--client/src/app/videos/+video-watch/video-download.component.scss3
-rw-r--r--client/src/app/videos/+video-watch/video-watch.component.scss3
-rw-r--r--client/src/app/videos/+video-watch/video-watch.component.ts4
-rw-r--r--client/src/app/videos/videos-routing.module.ts6
51 files changed, 132 insertions, 313 deletions
diff --git a/client/src/app/+admin/follows/following-add/following-add.component.scss b/client/src/app/+admin/follows/following-add/following-add.component.scss
index 2cb3efe28..7594b502c 100644
--- a/client/src/app/+admin/follows/following-add/following-add.component.scss
+++ b/client/src/app/+admin/follows/following-add/following-add.component.scss
@@ -1,3 +1,6 @@
1@import '_variables';
2@import '_mixins';
3
1textarea { 4textarea {
2 height: 250px; 5 height: 250px;
3} 6}
@@ -6,4 +9,3 @@ input[type=submit] {
6 @include peertube-button; 9 @include peertube-button;
7 @include orange-button; 10 @include orange-button;
8} 11}
9
diff --git a/client/src/app/+admin/follows/shared/follow.service.ts b/client/src/app/+admin/follows/shared/follow.service.ts
index 0bfbe8eb6..3a430ff64 100644
--- a/client/src/app/+admin/follows/shared/follow.service.ts
+++ b/client/src/app/+admin/follows/shared/follow.service.ts
@@ -1,17 +1,16 @@
1import { Injectable } from '@angular/core'
2import { HttpClient, HttpParams } from '@angular/common/http' 1import { HttpClient, HttpParams } from '@angular/common/http'
3import { Observable } from 'rxjs/Observable' 2import { Injectable } from '@angular/core'
3import { SortMeta } from 'primeng/primeng'
4import 'rxjs/add/operator/catch' 4import 'rxjs/add/operator/catch'
5import 'rxjs/add/operator/map' 5import 'rxjs/add/operator/map'
6 6import { Observable } from 'rxjs/Observable'
7import { SortMeta } from 'primeng/primeng'
8
9import { RestExtractor, RestPagination, RestService } from '../../../shared'
10import { AccountFollow, ResultList } from '../../../../../../shared' 7import { AccountFollow, ResultList } from '../../../../../../shared'
8import { environment } from '../../../../environments/environment'
9import { RestExtractor, RestPagination, RestService } from '../../../shared'
11 10
12@Injectable() 11@Injectable()
13export class FollowService { 12export class FollowService {
14 private static BASE_APPLICATION_URL = API_URL + '/api/v1/server' 13 private static BASE_APPLICATION_URL = environment.apiUrl + '/api/v1/server'
15 14
16 constructor ( 15 constructor (
17 private authHttp: HttpClient, 16 private authHttp: HttpClient,
diff --git a/client/src/app/+admin/index.ts b/client/src/app/+admin/index.ts
deleted file mode 100644
index b628a3662..000000000
--- a/client/src/app/+admin/index.ts
+++ /dev/null
@@ -1 +0,0 @@
1export * from './admin.module'
diff --git a/client/src/app/+admin/jobs/job.routes.ts b/client/src/app/+admin/jobs/job.routes.ts
index a7bf2b221..331dc2af2 100644
--- a/client/src/app/+admin/jobs/job.routes.ts
+++ b/client/src/app/+admin/jobs/job.routes.ts
@@ -1,9 +1,6 @@
1import { Routes } from '@angular/router' 1import { Routes } from '@angular/router'
2
3import { UserRightGuard } from '../../core'
4import { FollowingAddComponent } from './following-add'
5import { UserRight } from '../../../../../shared' 2import { UserRight } from '../../../../../shared'
6import { FollowingListComponent } from './following-list/following-list.component' 3import { UserRightGuard } from '../../core'
7import { JobsComponent } from './job.component' 4import { JobsComponent } from './job.component'
8import { JobsListComponent } from './jobs-list/jobs-list.component' 5import { JobsListComponent } from './jobs-list/jobs-list.component'
9 6
diff --git a/client/src/app/+admin/jobs/shared/job.service.ts b/client/src/app/+admin/jobs/shared/job.service.ts
index 0cfbdbbea..61ee16077 100644
--- a/client/src/app/+admin/jobs/shared/job.service.ts
+++ b/client/src/app/+admin/jobs/shared/job.service.ts
@@ -6,12 +6,12 @@ import 'rxjs/add/operator/map'
6import { Observable } from 'rxjs/Observable' 6import { Observable } from 'rxjs/Observable'
7import { ResultList } from '../../../../../../shared' 7import { ResultList } from '../../../../../../shared'
8import { Job } from '../../../../../../shared/models/job.model' 8import { Job } from '../../../../../../shared/models/job.model'
9 9import { environment } from '../../../../environments/environment'
10import { RestExtractor, RestPagination, RestService } from '../../../shared' 10import { RestExtractor, RestPagination, RestService } from '../../../shared'
11 11
12@Injectable() 12@Injectable()
13export class JobService { 13export class JobService {
14 private static BASE_JOB_URL = API_URL + '/api/v1/jobs' 14 private static BASE_JOB_URL = environment.apiUrl + '/api/v1/jobs'
15 15
16 constructor ( 16 constructor (
17 private authHttp: HttpClient, 17 private authHttp: HttpClient,
diff --git a/client/src/app/+admin/users/shared/user.service.ts b/client/src/app/+admin/users/shared/user.service.ts
index dc77cc1d8..6536546fb 100644
--- a/client/src/app/+admin/users/shared/user.service.ts
+++ b/client/src/app/+admin/users/shared/user.service.ts
@@ -6,11 +6,12 @@ import 'rxjs/add/operator/catch'
6import 'rxjs/add/operator/map' 6import 'rxjs/add/operator/map'
7import { Observable } from 'rxjs/Observable' 7import { Observable } from 'rxjs/Observable'
8import { ResultList, UserCreate, UserUpdate } from '../../../../../../shared' 8import { ResultList, UserCreate, UserUpdate } from '../../../../../../shared'
9import { environment } from '../../../../environments/environment'
9import { RestExtractor, RestPagination, RestService, User } from '../../../shared' 10import { RestExtractor, RestPagination, RestService, User } from '../../../shared'
10 11
11@Injectable() 12@Injectable()
12export class UserService { 13export class UserService {
13 private static BASE_USERS_URL = API_URL + '/api/v1/users/' 14 private static BASE_USERS_URL = environment.apiUrl + '/api/v1/users/'
14 private bytesPipe = new BytesPipe() 15 private bytesPipe = new BytesPipe()
15 16
16 constructor ( 17 constructor (
diff --git a/client/src/app/+admin/users/user-edit/user-edit.component.scss b/client/src/app/+admin/users/user-edit/user-edit.component.scss
index 68d270c19..1bb1c5f0f 100644
--- a/client/src/app/+admin/users/user-edit/user-edit.component.scss
+++ b/client/src/app/+admin/users/user-edit/user-edit.component.scss
@@ -1,3 +1,6 @@
1@import '_variables';
2@import '_mixins';
3
1.admin-sub-title { 4.admin-sub-title {
2 margin-bottom: 30px; 5 margin-bottom: 30px;
3} 6}
diff --git a/client/src/app/+admin/users/user-list/user-list.component.scss b/client/src/app/+admin/users/user-list/user-list.component.scss
index 8b22f67ff..72d31a0cc 100644
--- a/client/src/app/+admin/users/user-list/user-list.component.scss
+++ b/client/src/app/+admin/users/user-list/user-list.component.scss
@@ -1,11 +1,14 @@
1 .add-button { 1@import '_variables';
2 @include peertube-button-link; 2@import '_mixins';
3 @include orange-button;
4 3
5 .icon.icon-add { 4.add-button {
6 @include icon(22px); 5 @include peertube-button-link;
6 @include orange-button;
7 7
8 margin-right: 3px; 8 .icon.icon-add {
9 background-image: url('../../../../assets/images/admin/add.svg'); 9 @include icon(22px);
10 } 10
11 margin-right: 3px;
12 background-image: url('../../../../assets/images/admin/add.svg');
11 } 13 }
14}
diff --git a/client/src/app/account/account-settings/account-change-password/account-change-password.component.scss b/client/src/app/account/account-settings/account-change-password/account-change-password.component.scss
index 7a4fdb34d..f8279ffd3 100644
--- a/client/src/app/account/account-settings/account-change-password/account-change-password.component.scss
+++ b/client/src/app/account/account-settings/account-change-password/account-change-password.component.scss
@@ -1,3 +1,6 @@
1@import '_variables';
2@import '_mixins';
3
1input[type=password] { 4input[type=password] {
2 @include peertube-input-text(340px); 5 @include peertube-input-text(340px);
3 display: block; 6 display: block;
diff --git a/client/src/app/account/account-settings/account-details/account-details.component.scss b/client/src/app/account/account-settings/account-details/account-details.component.scss
index 5c369f968..1bdb19a38 100644
--- a/client/src/app/account/account-settings/account-details/account-details.component.scss
+++ b/client/src/app/account/account-settings/account-details/account-details.component.scss
@@ -1,3 +1,6 @@
1@import '_variables';
2@import '_mixins';
3
1label { 4label {
2 font-size: 15px; 5 font-size: 15px;
3 font-weight: $font-regular; 6 font-weight: $font-regular;
diff --git a/client/src/app/account/account-settings/account-settings.component.scss b/client/src/app/account/account-settings/account-settings.component.scss
index f514809b0..7f1ade377 100644
--- a/client/src/app/account/account-settings/account-settings.component.scss
+++ b/client/src/app/account/account-settings/account-settings.component.scss
@@ -1,3 +1,6 @@
1@import '_variables';
2@import '_mixins';
3
1.user { 4.user {
2 display: flex; 5 display: flex;
3 6
diff --git a/client/src/app/account/account-videos/account-videos.component.scss b/client/src/app/account/account-videos/account-videos.component.scss
index 5459014a6..28b298c3d 100644
--- a/client/src/app/account/account-videos/account-videos.component.scss
+++ b/client/src/app/account/account-videos/account-videos.component.scss
@@ -1,3 +1,6 @@
1@import '_variables';
2@import '_mixins';
3
1.action-selection-mode { 4.action-selection-mode {
2 width: 174px; 5 width: 174px;
3 display: flex; 6 display: flex;
diff --git a/client/src/app/account/account.module.ts b/client/src/app/account/account.module.ts
index 020199e23..2299c1919 100644
--- a/client/src/app/account/account.module.ts
+++ b/client/src/app/account/account.module.ts
@@ -5,7 +5,6 @@ import { AccountChangePasswordComponent } from './account-settings/account-chang
5import { AccountDetailsComponent } from './account-settings/account-details/account-details.component' 5import { AccountDetailsComponent } from './account-settings/account-details/account-details.component'
6import { AccountSettingsComponent } from './account-settings/account-settings.component' 6import { AccountSettingsComponent } from './account-settings/account-settings.component'
7import { AccountComponent } from './account.component' 7import { AccountComponent } from './account.component'
8import { AccountService } from './account.service'
9import { AccountVideosComponent } from './account-videos/account-videos.component' 8import { AccountVideosComponent } from './account-videos/account-videos.component'
10 9
11@NgModule({ 10@NgModule({
diff --git a/client/src/app/app-routing.module.ts b/client/src/app/app-routing.module.ts
index fe72c9181..f31b51e23 100644
--- a/client/src/app/app-routing.module.ts
+++ b/client/src/app/app-routing.module.ts
@@ -11,7 +11,7 @@ const routes: Routes = [
11 }, 11 },
12 { 12 {
13 path: 'admin', 13 path: 'admin',
14 loadChildren: './+admin#AdminModule' 14 loadChildren: './+admin/admin.module#AdminModule'
15 } 15 }
16] 16]
17 17
diff --git a/client/src/app/app.component.scss b/client/src/app/app.component.scss
index c0ec2025d..2aadb1c97 100644
--- a/client/src/app/app.component.scss
+++ b/client/src/app/app.component.scss
@@ -1,3 +1,6 @@
1@import '_variables';
2@import '_mixins';
3
1.main-row { 4.main-row {
2 min-height: calc(100vh - #{$header-height} - #{$footer-height} - #{$footer-margin}); 5 min-height: calc(100vh - #{$header-height} - #{$footer-height} - #{$footer-margin});
3} 6}
diff --git a/client/src/app/app.module.ts b/client/src/app/app.module.ts
index 1326e3411..e69edbc4b 100644
--- a/client/src/app/app.module.ts
+++ b/client/src/app/app.module.ts
@@ -1,18 +1,10 @@
1import { ApplicationRef, NgModule } from '@angular/core' 1import { NgModule } from '@angular/core'
2import { BrowserModule } from '@angular/platform-browser' 2import { BrowserModule } from '@angular/platform-browser'
3import {
4 removeNgStyles,
5 createNewHosts,
6 createInputTransfer
7} from '@angularclass/hmr'
8 3
9import { MetaModule, MetaLoader, MetaStaticLoader, PageTitlePositioning } from '@ngx-meta/core' 4import { MetaModule, MetaLoader, MetaStaticLoader, PageTitlePositioning } from '@ngx-meta/core'
10import 'bootstrap-loader'
11 5
12import { ENV_PROVIDERS } from './environment'
13import { AppRoutingModule } from './app-routing.module' 6import { AppRoutingModule } from './app-routing.module'
14import { AppComponent } from './app.component' 7import { AppComponent } from './app.component'
15import { AppState, InternalStateType } from './app.service'
16 8
17import { AccountModule } from './account' 9import { AccountModule } from './account'
18import { CoreModule } from './core' 10import { CoreModule } from './core'
@@ -35,17 +27,6 @@ export function metaFactory (): MetaLoader {
35 }) 27 })
36} 28}
37 29
38type StoreType = {
39 state: InternalStateType,
40 restoreInputValues: () => void,
41 disposeOldHosts: () => void
42}
43
44// Application wide providers
45const APP_PROVIDERS = [
46 AppState
47]
48
49@NgModule({ 30@NgModule({
50 bootstrap: [ AppComponent ], 31 bootstrap: [ AppComponent ],
51 declarations: [ 32 declarations: [
@@ -74,65 +55,6 @@ const APP_PROVIDERS = [
74 useFactory: (metaFactory) 55 useFactory: (metaFactory)
75 }) 56 })
76 ], 57 ],
77 providers: [ // expose our Services and Providers into Angular's dependency injection 58 providers: [ ]
78 ENV_PROVIDERS,
79 APP_PROVIDERS
80 ]
81}) 59})
82export class AppModule { 60export class AppModule {}
83 constructor (
84 public appRef: ApplicationRef,
85 public appState: AppState
86 ) {}
87
88 public hmrOnInit (store: StoreType) {
89 if (!store || !store.state) {
90 return
91 }
92 console.log('HMR store', JSON.stringify(store, null, 2))
93 /**
94 * Set state
95 */
96 this.appState._state = store.state
97 /**
98 * Set input values
99 */
100 if ('restoreInputValues' in store) {
101 let restoreInputValues = store.restoreInputValues
102 setTimeout(restoreInputValues)
103 }
104
105 this.appRef.tick()
106 delete store.state
107 delete store.restoreInputValues
108 }
109
110 public hmrOnDestroy (store: StoreType) {
111 const cmpLocation = this.appRef.components.map((cmp) => cmp.location.nativeElement)
112 /**
113 * Save state
114 */
115 const state = this.appState._state
116 store.state = state
117 /**
118 * Recreate root elements
119 */
120 store.disposeOldHosts = createNewHosts(cmpLocation)
121 /**
122 * Save input values
123 */
124 store.restoreInputValues = createInputTransfer()
125 /**
126 * Remove styles
127 */
128 removeNgStyles()
129 }
130
131 public hmrAfterDestroy (store: StoreType) {
132 /**
133 * Display new elements
134 */
135 store.disposeOldHosts()
136 delete store.disposeOldHosts
137 }
138}
diff --git a/client/src/app/app.resolver.ts b/client/src/app/app.resolver.ts
deleted file mode 100644
index bc054e90b..000000000
--- a/client/src/app/app.resolver.ts
+++ /dev/null
@@ -1,20 +0,0 @@
1/* tslint:disable */
2
3import { Resolve, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router'
4import { Injectable } from '@angular/core'
5import { Observable } from 'rxjs/Observable'
6import 'rxjs/add/observable/of'
7
8@Injectable()
9export class DataResolver implements Resolve<any> {
10 public resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {
11 return Observable.of({ res: 'I am data'})
12 }
13}
14
15/**
16 * An array of services to resolve routes with data.
17 */
18export const APP_RESOLVER_PROVIDERS = [
19 DataResolver
20]
diff --git a/client/src/app/app.service.ts b/client/src/app/app.service.ts
deleted file mode 100644
index abffc87f1..000000000
--- a/client/src/app/app.service.ts
+++ /dev/null
@@ -1,48 +0,0 @@
1/* tslint:disable */
2
3import { Injectable } from '@angular/core'
4
5export type InternalStateType = {
6 [key: string]: any
7}
8
9@Injectable()
10export class AppState {
11
12 public _state: InternalStateType = { }
13
14 /**
15 * Already return a clone of the current state.
16 */
17 public get state() {
18 return this._state = this._clone(this._state)
19 }
20 /**
21 * Never allow mutation
22 */
23 public set state(value) {
24 throw new Error('do not mutate the `.state` directly')
25 }
26
27 public get(prop?: any) {
28 /**
29 * Use our state getter for the clone.
30 */
31 const state = this.state
32 return state.hasOwnProperty(prop) ? state[prop] : state
33 }
34
35 public set(prop: string, value: any) {
36 /**
37 * Internally mutate our state.
38 */
39 return this._state[prop] = value
40 }
41
42 private _clone(object: InternalStateType) {
43 /**
44 * Simple object clone.
45 */
46 return JSON.parse(JSON.stringify( object ))
47 }
48}
diff --git a/client/src/app/core/auth/auth.service.ts b/client/src/app/core/auth/auth.service.ts
index e887dde1f..e2b8b6ba5 100644
--- a/client/src/app/core/auth/auth.service.ts
+++ b/client/src/app/core/auth/auth.service.ts
@@ -1,7 +1,6 @@
1import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http' 1import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http'
2import { Injectable } from '@angular/core' 2import { Injectable } from '@angular/core'
3import { Router } from '@angular/router' 3import { Router } from '@angular/router'
4
5import { NotificationsService } from 'angular2-notifications' 4import { NotificationsService } from 'angular2-notifications'
6import 'rxjs/add/observable/throw' 5import 'rxjs/add/observable/throw'
7import 'rxjs/add/operator/do' 6import 'rxjs/add/operator/do'
@@ -13,10 +12,9 @@ import { Subject } from 'rxjs/Subject'
13import { OAuthClientLocal, User as UserServerModel, UserRefreshToken, UserRole, VideoChannel } from '../../../../../shared' 12import { OAuthClientLocal, User as UserServerModel, UserRefreshToken, UserRole, VideoChannel } from '../../../../../shared'
14import { Account } from '../../../../../shared/models/accounts' 13import { Account } from '../../../../../shared/models/accounts'
15import { UserLogin } from '../../../../../shared/models/users/user-login.model' 14import { UserLogin } from '../../../../../shared/models/users/user-login.model'
16// Do not use the barrel (dependency loop) 15import { environment } from '../../../environments/environment'
17import { RestExtractor } from '../../shared/rest' 16import { RestExtractor } from '../../shared/rest'
18import { UserConstructorHash } from '../../shared/users/user.model' 17import { UserConstructorHash } from '../../shared/users/user.model'
19
20import { AuthStatus } from './auth-status.model' 18import { AuthStatus } from './auth-status.model'
21import { AuthUser } from './auth-user.model' 19import { AuthUser } from './auth-user.model'
22 20
@@ -43,9 +41,9 @@ interface UserLoginWithUserInformation extends UserLogin {
43 41
44@Injectable() 42@Injectable()
45export class AuthService { 43export class AuthService {
46 private static BASE_CLIENT_URL = API_URL + '/api/v1/oauth-clients/local' 44 private static BASE_CLIENT_URL = environment.apiUrl + '/api/v1/oauth-clients/local'
47 private static BASE_TOKEN_URL = API_URL + '/api/v1/users/token' 45 private static BASE_TOKEN_URL = environment.apiUrl + '/api/v1/users/token'
48 private static BASE_USER_INFORMATION_URL = API_URL + '/api/v1/users/me' 46 private static BASE_USER_INFORMATION_URL = environment.apiUrl + '/api/v1/users/me'
49 47
50 loginChangedSource: Observable<AuthStatus> 48 loginChangedSource: Observable<AuthStatus>
51 userInformationLoaded = new ReplaySubject<boolean>(1) 49 userInformationLoaded = new ReplaySubject<boolean>(1)
diff --git a/client/src/app/core/core.module.ts b/client/src/app/core/core.module.ts
index 75262e6cf..a58fe6ebe 100644
--- a/client/src/app/core/core.module.ts
+++ b/client/src/app/core/core.module.ts
@@ -11,7 +11,6 @@ import { AuthService } from './auth'
11import { LoginGuard, UserRightGuard } from './routing' 11import { LoginGuard, UserRightGuard } from './routing'
12import { ServerService } from './server' 12import { ServerService } from './server'
13import { ConfirmComponent, ConfirmService } from './confirm' 13import { ConfirmComponent, ConfirmService } from './confirm'
14import { MenuComponent, MenuAdminComponent } from './menu'
15import { throwIfAlreadyLoaded } from './module-import-guard' 14import { throwIfAlreadyLoaded } from './module-import-guard'
16 15
17@NgModule({ 16@NgModule({
diff --git a/client/src/app/core/server/server.service.ts b/client/src/app/core/server/server.service.ts
index 16e0595b6..a5be9e199 100644
--- a/client/src/app/core/server/server.service.ts
+++ b/client/src/app/core/server/server.service.ts
@@ -2,13 +2,13 @@ import { HttpClient } from '@angular/common/http'
2import { Injectable } from '@angular/core' 2import { Injectable } from '@angular/core'
3import 'rxjs/add/operator/do' 3import 'rxjs/add/operator/do'
4import { ReplaySubject } from 'rxjs/ReplaySubject' 4import { ReplaySubject } from 'rxjs/ReplaySubject'
5
6import { ServerConfig } from '../../../../../shared' 5import { ServerConfig } from '../../../../../shared'
6import { environment } from '../../../environments/environment'
7 7
8@Injectable() 8@Injectable()
9export class ServerService { 9export class ServerService {
10 private static BASE_CONFIG_URL = API_URL + '/api/v1/config/' 10 private static BASE_CONFIG_URL = environment.apiUrl + '/api/v1/config/'
11 private static BASE_VIDEO_URL = API_URL + '/api/v1/videos/' 11 private static BASE_VIDEO_URL = environment.apiUrl + '/api/v1/videos/'
12 12
13 videoPrivaciesLoaded = new ReplaySubject<boolean>(1) 13 videoPrivaciesLoaded = new ReplaySubject<boolean>(1)
14 videoCategoriesLoaded = new ReplaySubject<boolean>(1) 14 videoCategoriesLoaded = new ReplaySubject<boolean>(1)
diff --git a/client/src/app/environment.ts b/client/src/app/environment.ts
deleted file mode 100644
index dd327a62e..000000000
--- a/client/src/app/environment.ts
+++ /dev/null
@@ -1,77 +0,0 @@
1/* tslint:disable */
2
3/**
4 * Angular 2
5 */
6import {
7 enableDebugTools,
8 disableDebugTools
9} from '@angular/platform-browser';
10import {
11 ApplicationRef,
12 enableProdMode
13} from '@angular/core';
14/**
15 * Environment Providers
16 */
17let PROVIDERS: any[] = [
18 /**
19 * Common env directives
20 */
21];
22
23/**
24 * Angular debug tools in the dev console
25 * https://github.com/angular/angular/blob/86405345b781a9dc2438c0fbe3e9409245647019/TOOLS_JS.md
26 */
27let _decorateModuleRef = <T>(value: T): T => { return value; };
28
29if ('production' === ENV) {
30 enableProdMode();
31
32 /**
33 * Production
34 */
35 _decorateModuleRef = (modRef: any) => {
36 disableDebugTools();
37
38 return modRef;
39 };
40
41 PROVIDERS = [
42 ...PROVIDERS,
43 /**
44 * Custom providers in production.
45 */
46 ];
47
48} else {
49
50 _decorateModuleRef = (modRef: any) => {
51 const appRef = modRef.injector.get(ApplicationRef);
52 const cmpRef = appRef.components[0];
53
54 let _ng = (<any> window).ng;
55 enableDebugTools(cmpRef);
56 (<any> window).ng.probe = _ng.probe;
57 (<any> window).ng.coreTokens = _ng.coreTokens;
58 return modRef;
59 };
60
61 /**
62 * Development
63 */
64 PROVIDERS = [
65 ...PROVIDERS,
66 /**
67 * Custom providers in development.
68 */
69 ];
70
71}
72
73export const decorateModuleRef = _decorateModuleRef;
74
75export const ENV_PROVIDERS = [
76 ...PROVIDERS
77];
diff --git a/client/src/app/header/header.component.scss b/client/src/app/header/header.component.scss
index fba70dd2f..1b67042fc 100644
--- a/client/src/app/header/header.component.scss
+++ b/client/src/app/header/header.component.scss
@@ -1,3 +1,6 @@
1@import '_variables';
2@import '_mixins';
3
1#search-video { 4#search-video {
2 @include peertube-input-text($search-input-width); 5 @include peertube-input-text($search-input-width);
3 margin-right: 15px; 6 margin-right: 15px;
diff --git a/client/src/app/login/login.component.scss b/client/src/app/login/login.component.scss
index 3b4326de4..efec6b706 100644
--- a/client/src/app/login/login.component.scss
+++ b/client/src/app/login/login.component.scss
@@ -1,3 +1,6 @@
1@import '_variables';
2@import '_mixins';
3
1input:not([type=submit]) { 4input:not([type=submit]) {
2 @include peertube-input-text(340px); 5 @include peertube-input-text(340px);
3 display: block; 6 display: block;
diff --git a/client/src/app/menu/menu.component.scss b/client/src/app/menu/menu.component.scss
index 97ceadde3..8cb94b3dd 100644
--- a/client/src/app/menu/menu.component.scss
+++ b/client/src/app/menu/menu.component.scss
@@ -1,3 +1,6 @@
1@import '_variables';
2@import '_mixins';
3
1menu { 4menu {
2 background-color: $black-background; 5 background-color: $black-background;
3 margin: 0; 6 margin: 0;
diff --git a/client/src/app/shared/account/account.model.ts b/client/src/app/shared/account/account.model.ts
index 0b008188a..9d1fd3e1d 100644
--- a/client/src/app/shared/account/account.model.ts
+++ b/client/src/app/shared/account/account.model.ts
@@ -1,5 +1,6 @@
1import { Account as ServerAccount } from '../../../../../shared/models/accounts/account.model' 1import { Account as ServerAccount } from '../../../../../shared/models/accounts/account.model'
2import { Avatar } from '../../../../../shared/models/avatars/avatar.model' 2import { Avatar } from '../../../../../shared/models/avatars/avatar.model'
3import { environment } from '../../../environments/environment'
3 4
4export class Account implements ServerAccount { 5export class Account implements ServerAccount {
5 id: number 6 id: number
@@ -15,6 +16,6 @@ export class Account implements ServerAccount {
15 static GET_ACCOUNT_AVATAR_PATH (account: Account) { 16 static GET_ACCOUNT_AVATAR_PATH (account: Account) {
16 if (account && account.avatar) return account.avatar.path 17 if (account && account.avatar) return account.avatar.path
17 18
18 return API_URL + '/client/assets/images/default-avatar.png' 19 return environment.apiUrl + '/client/assets/images/default-avatar.png'
19 } 20 }
20} 21}
diff --git a/client/src/app/shared/forms/form-validators/host.validator.ts b/client/src/app/shared/forms/form-validators/host.ts
index c18a35f9b..c18a35f9b 100644
--- a/client/src/app/shared/forms/form-validators/host.validator.ts
+++ b/client/src/app/shared/forms/form-validators/host.ts
diff --git a/client/src/app/shared/forms/form-validators/index.ts b/client/src/app/shared/forms/form-validators/index.ts
index efe77d4ae..09ae86f8a 100644
--- a/client/src/app/shared/forms/form-validators/index.ts
+++ b/client/src/app/shared/forms/form-validators/index.ts
@@ -1,4 +1,4 @@
1export * from './host.validator' 1export * from './host'
2export * from './user' 2export * from './user'
3export * from './video-abuse' 3export * from './video-abuse'
4export * from './video' 4export * from './video'
diff --git a/client/src/app/shared/forms/form-validators/validator-message.ts b/client/src/app/shared/forms/form-validators/validator-message.ts
new file mode 100644
index 000000000..5ce45833b
--- /dev/null
+++ b/client/src/app/shared/forms/form-validators/validator-message.ts
@@ -0,0 +1,5 @@
1export type ValidatorMessage = {
2 [ id: string ]: {
3 [ error: string ]: string
4 }
5}
diff --git a/client/src/app/shared/forms/form-validators/video.ts b/client/src/app/shared/forms/form-validators/video.ts
index 45da7df4a..500b5bc5f 100644
--- a/client/src/app/shared/forms/form-validators/video.ts
+++ b/client/src/app/shared/forms/form-validators/video.ts
@@ -1,11 +1,5 @@
1import { Validators } from '@angular/forms' 1import { Validators } from '@angular/forms'
2 2
3export type ValidatorMessage = {
4 [ id: string ]: {
5 [ error: string ]: string
6 }
7}
8
9export const VIDEO_NAME = { 3export const VIDEO_NAME = {
10 VALIDATORS: [ Validators.required, Validators.minLength(3), Validators.maxLength(120) ], 4 VALIDATORS: [ Validators.required, Validators.minLength(3), Validators.maxLength(120) ],
11 MESSAGES: { 5 MESSAGES: {
diff --git a/client/src/app/shared/misc/button.component.scss b/client/src/app/shared/misc/button.component.scss
index 5fcae4f10..c380c7ae1 100644
--- a/client/src/app/shared/misc/button.component.scss
+++ b/client/src/app/shared/misc/button.component.scss
@@ -1,3 +1,6 @@
1@import '_variables';
2@import '_mixins';
3
1.action-button { 4.action-button {
2 @include peertube-button-link; 5 @include peertube-button-link;
3 6
diff --git a/client/src/app/shared/users/user.service.ts b/client/src/app/shared/users/user.service.ts
index 6d1017fc9..d97edbcbe 100644
--- a/client/src/app/shared/users/user.service.ts
+++ b/client/src/app/shared/users/user.service.ts
@@ -1,14 +1,14 @@
1import { Injectable } from '@angular/core'
2import { HttpClient } from '@angular/common/http' 1import { HttpClient } from '@angular/common/http'
2import { Injectable } from '@angular/core'
3import 'rxjs/add/operator/catch' 3import 'rxjs/add/operator/catch'
4import 'rxjs/add/operator/map' 4import 'rxjs/add/operator/map'
5
6import { RestExtractor } from '../rest'
7import { UserCreate, UserUpdateMe } from '../../../../../shared' 5import { UserCreate, UserUpdateMe } from '../../../../../shared'
6import { environment } from '../../../environments/environment'
7import { RestExtractor } from '../rest'
8 8
9@Injectable() 9@Injectable()
10export class UserService { 10export class UserService {
11 static BASE_USERS_URL = API_URL + '/api/v1/users/' 11 static BASE_USERS_URL = environment.apiUrl + '/api/v1/users/'
12 12
13 constructor ( 13 constructor (
14 private authHttp: HttpClient, 14 private authHttp: HttpClient,
diff --git a/client/src/app/shared/video-abuse/video-abuse.service.ts b/client/src/app/shared/video-abuse/video-abuse.service.ts
index 8d979de31..96a1f1fd2 100644
--- a/client/src/app/shared/video-abuse/video-abuse.service.ts
+++ b/client/src/app/shared/video-abuse/video-abuse.service.ts
@@ -1,19 +1,17 @@
1import { Injectable } from '@angular/core'
2import { HttpClient, HttpParams } from '@angular/common/http' 1import { HttpClient, HttpParams } from '@angular/common/http'
2import { Injectable } from '@angular/core'
3import { SortMeta } from 'primeng/components/common/sortmeta'
3import 'rxjs/add/operator/catch' 4import 'rxjs/add/operator/catch'
4import 'rxjs/add/operator/map' 5import 'rxjs/add/operator/map'
5import { Observable } from 'rxjs/Observable' 6import { Observable } from 'rxjs/Observable'
6 7import { ResultList, VideoAbuse } from '../../../../../shared'
7import { SortMeta } from 'primeng/components/common/sortmeta'
8
9import { AuthService } from '../core'
10import { RestExtractor, RestPagination, RestService } from '../rest' 8import { RestExtractor, RestPagination, RestService } from '../rest'
11import { Utils } from '../utils' 9import { Utils } from '../utils'
12import { ResultList, VideoAbuse } from '../../../../../shared' 10import { environment } from '../../../environments/environment'
13 11
14@Injectable() 12@Injectable()
15export class VideoAbuseService { 13export class VideoAbuseService {
16 private static BASE_VIDEO_ABUSE_URL = API_URL + '/api/v1/videos/' 14 private static BASE_VIDEO_ABUSE_URL = environment.apiUrl + '/api/v1/videos/'
17 15
18 constructor ( 16 constructor (
19 private authHttp: HttpClient, 17 private authHttp: HttpClient,
diff --git a/client/src/app/shared/video-blacklist/video-blacklist.service.ts b/client/src/app/shared/video-blacklist/video-blacklist.service.ts
index 17373d52e..1231690aa 100644
--- a/client/src/app/shared/video-blacklist/video-blacklist.service.ts
+++ b/client/src/app/shared/video-blacklist/video-blacklist.service.ts
@@ -1,18 +1,17 @@
1import { Injectable } from '@angular/core'
2import { HttpClient, HttpParams } from '@angular/common/http' 1import { HttpClient, HttpParams } from '@angular/common/http'
3import { Observable } from 'rxjs/Observable' 2import { Injectable } from '@angular/core'
3import { SortMeta } from 'primeng/components/common/sortmeta'
4import 'rxjs/add/operator/catch' 4import 'rxjs/add/operator/catch'
5import 'rxjs/add/operator/map' 5import 'rxjs/add/operator/map'
6 6import { Observable } from 'rxjs/Observable'
7import { SortMeta } from 'primeng/components/common/sortmeta' 7import { BlacklistedVideo, ResultList } from '../../../../../shared'
8 8import { environment } from '../../../environments/environment'
9import { RestExtractor, RestPagination, RestService } from '../rest' 9import { RestExtractor, RestPagination, RestService } from '../rest'
10import { Utils } from '../utils' 10import { Utils } from '../utils'
11import { BlacklistedVideo, ResultList } from '../../../../../shared'
12 11
13@Injectable() 12@Injectable()
14export class VideoBlacklistService { 13export class VideoBlacklistService {
15 private static BASE_VIDEOS_URL = API_URL + '/api/v1/videos/' 14 private static BASE_VIDEOS_URL = environment.apiUrl + '/api/v1/videos/'
16 15
17 constructor ( 16 constructor (
18 private authHttp: HttpClient, 17 private authHttp: HttpClient,
diff --git a/client/src/app/shared/video/video-miniature.component.scss b/client/src/app/shared/video/video-miniature.component.scss
index 37e84897b..49ba1e51c 100644
--- a/client/src/app/shared/video/video-miniature.component.scss
+++ b/client/src/app/shared/video/video-miniature.component.scss
@@ -1,3 +1,6 @@
1@import '_variables';
2@import '_mixins';
3
1.video-miniature { 4.video-miniature {
2 display: inline-block; 5 display: inline-block;
3 padding-right: 15px; 6 padding-right: 15px;
diff --git a/client/src/app/shared/video/video-thumbnail.component.scss b/client/src/app/shared/video/video-thumbnail.component.scss
index ab4f9bcb1..0fc2df220 100644
--- a/client/src/app/shared/video/video-thumbnail.component.scss
+++ b/client/src/app/shared/video/video-thumbnail.component.scss
@@ -1,3 +1,6 @@
1@import '_variables';
2@import '_mixins';
3
1.video-thumbnail { 4.video-thumbnail {
2 display: inline-block; 5 display: inline-block;
3 position: relative; 6 position: relative;
diff --git a/client/src/app/shared/video/video.model.ts b/client/src/app/shared/video/video.model.ts
index d86ef8f92..32c33829d 100644
--- a/client/src/app/shared/video/video.model.ts
+++ b/client/src/app/shared/video/video.model.ts
@@ -1,6 +1,7 @@
1import { Video as VideoServerModel } from '../../../../../shared'
2import { User } from '../' 1import { User } from '../'
2import { Video as VideoServerModel } from '../../../../../shared'
3import { Account } from '../../../../../shared/models/accounts' 3import { Account } from '../../../../../shared/models/accounts'
4import { environment } from '../../../environments/environment'
4 5
5export class Video implements VideoServerModel { 6export class Video implements VideoServerModel {
6 accountName: string 7 accountName: string
@@ -48,7 +49,7 @@ export class Video implements VideoServerModel {
48 } 49 }
49 50
50 constructor (hash: VideoServerModel) { 51 constructor (hash: VideoServerModel) {
51 let absoluteAPIUrl = API_URL 52 let absoluteAPIUrl = environment.apiUrl
52 if (!absoluteAPIUrl) { 53 if (!absoluteAPIUrl) {
53 // The API is on the same domain 54 // The API is on the same domain
54 absoluteAPIUrl = window.location.origin 55 absoluteAPIUrl = window.location.origin
diff --git a/client/src/app/shared/video/video.service.ts b/client/src/app/shared/video/video.service.ts
index 1a0644c3d..91dd3977a 100644
--- a/client/src/app/shared/video/video.service.ts
+++ b/client/src/app/shared/video/video.service.ts
@@ -9,9 +9,9 @@ import { UserVideoRateUpdate } from '../../../../../shared/models/videos/user-vi
9import { UserVideoRate } from '../../../../../shared/models/videos/user-video-rate.model' 9import { UserVideoRate } from '../../../../../shared/models/videos/user-video-rate.model'
10import { VideoRateType } from '../../../../../shared/models/videos/video-rate.type' 10import { VideoRateType } from '../../../../../shared/models/videos/video-rate.type'
11import { VideoUpdate } from '../../../../../shared/models/videos/video-update.model' 11import { VideoUpdate } from '../../../../../shared/models/videos/video-update.model'
12import { environment } from '../../../environments/environment'
12import { RestExtractor } from '../rest/rest-extractor.service' 13import { RestExtractor } from '../rest/rest-extractor.service'
13import { RestService } from '../rest/rest.service' 14import { RestService } from '../rest/rest.service'
14import { Search } from '../header/search.model'
15import { UserService } from '../users/user.service' 15import { UserService } from '../users/user.service'
16import { SortField } from './sort-field.type' 16import { SortField } from './sort-field.type'
17import { VideoDetails } from './video-details.model' 17import { VideoDetails } from './video-details.model'
@@ -21,7 +21,7 @@ import { Video } from './video.model'
21 21
22@Injectable() 22@Injectable()
23export class VideoService { 23export class VideoService {
24 private static BASE_VIDEO_URL = API_URL + '/api/v1/videos/' 24 private static BASE_VIDEO_URL = environment.apiUrl + '/api/v1/videos/'
25 25
26 constructor ( 26 constructor (
27 private authHttp: HttpClient, 27 private authHttp: HttpClient,
@@ -118,7 +118,7 @@ export class VideoService {
118 118
119 loadCompleteDescription (descriptionPath: string) { 119 loadCompleteDescription (descriptionPath: string) {
120 return this.authHttp 120 return this.authHttp
121 .get(API_URL + descriptionPath) 121 .get(environment.apiUrl + descriptionPath)
122 .map(res => res['description']) 122 .map(res => res['description'])
123 .catch((res) => this.restExtractor.handleError(res)) 123 .catch((res) => this.restExtractor.handleError(res))
124 } 124 }
diff --git a/client/src/app/signup/signup.component.scss b/client/src/app/signup/signup.component.scss
index 3b4326de4..efec6b706 100644
--- a/client/src/app/signup/signup.component.scss
+++ b/client/src/app/signup/signup.component.scss
@@ -1,3 +1,6 @@
1@import '_variables';
2@import '_mixins';
3
1input:not([type=submit]) { 4input:not([type=submit]) {
2 @include peertube-input-text(340px); 5 @include peertube-input-text(340px);
3 display: block; 6 display: block;
diff --git a/client/src/app/videos/+video-edit/index.ts b/client/src/app/videos/+video-edit/index.ts
deleted file mode 100644
index 63e0414dd..000000000
--- a/client/src/app/videos/+video-edit/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
1export * from './video-add.module'
2export * from './video-update.module'
diff --git a/client/src/app/videos/+video-edit/shared/video-description.component.scss b/client/src/app/videos/+video-edit/shared/video-description.component.scss
index 2a4c8d189..d6a5190c5 100644
--- a/client/src/app/videos/+video-edit/shared/video-description.component.scss
+++ b/client/src/app/videos/+video-edit/shared/video-description.component.scss
@@ -1,3 +1,6 @@
1@import '_variables';
2@import '_mixins';
3
1textarea { 4textarea {
2 @include peertube-input-text(100%); 5 @include peertube-input-text(100%);
3 6
diff --git a/client/src/app/videos/+video-edit/shared/video-edit.component.scss b/client/src/app/videos/+video-edit/shared/video-edit.component.scss
index d363499ce..f4466bdde 100644
--- a/client/src/app/videos/+video-edit/shared/video-edit.component.scss
+++ b/client/src/app/videos/+video-edit/shared/video-edit.component.scss
@@ -1,3 +1,6 @@
1@import '_variables';
2@import '_mixins';
3
1.video-edit { 4.video-edit {
2 height: 100%; 5 height: 100%;
3 6
diff --git a/client/src/app/videos/+video-edit/shared/video-edit.component.ts b/client/src/app/videos/+video-edit/shared/video-edit.component.ts
index 5b1cc3f9c..28c9134a7 100644
--- a/client/src/app/videos/+video-edit/shared/video-edit.component.ts
+++ b/client/src/app/videos/+video-edit/shared/video-edit.component.ts
@@ -2,12 +2,10 @@ import { Component, Input, OnInit } from '@angular/core'
2import { FormBuilder, FormControl, FormGroup } from '@angular/forms' 2import { FormBuilder, FormControl, FormGroup } from '@angular/forms'
3import { ActivatedRoute, Router } from '@angular/router' 3import { ActivatedRoute, Router } from '@angular/router'
4import { NotificationsService } from 'angular2-notifications' 4import { NotificationsService } from 'angular2-notifications'
5import { ServerService } from 'app/core'
6import { VideoEdit } from 'app/shared/video/video-edit.model'
7import 'rxjs/add/observable/forkJoin' 5import 'rxjs/add/observable/forkJoin'
8import { VideoPrivacy } from '../../../../../shared/models/videos/video-privacy.enum' 6import { ServerService } from '../../../core/server'
7import { ValidatorMessage } from '../../../shared/forms/form-validators/validator-message'
9import { 8import {
10 ValidatorMessage,
11 VIDEO_CATEGORY, 9 VIDEO_CATEGORY,
12 VIDEO_DESCRIPTION, 10 VIDEO_DESCRIPTION,
13 VIDEO_LANGUAGE, 11 VIDEO_LANGUAGE,
@@ -15,7 +13,8 @@ import {
15 VIDEO_NAME, 13 VIDEO_NAME,
16 VIDEO_PRIVACY, 14 VIDEO_PRIVACY,
17 VIDEO_TAGS 15 VIDEO_TAGS
18} from '../../../shared/forms/form-validators' 16} from '../../../shared/forms/form-validators/video'
17import { VideoEdit } from '../../../shared/video/video-edit.model'
19 18
20@Component({ 19@Component({
21 selector: 'my-video-edit', 20 selector: 'my-video-edit',
diff --git a/client/src/app/videos/+video-edit/video-add.component.scss b/client/src/app/videos/+video-edit/video-add.component.scss
index 39673b4b7..78140e0e9 100644
--- a/client/src/app/videos/+video-edit/video-add.component.scss
+++ b/client/src/app/videos/+video-edit/video-add.component.scss
@@ -1,3 +1,6 @@
1@import '_variables';
2@import '_mixins';
3
1.upload-video-container { 4.upload-video-container {
2 border-radius: 3px; 5 border-radius: 3px;
3 background-color: #F7F7F7; 6 background-color: #F7F7F7;
diff --git a/client/src/app/videos/+video-edit/video-add.component.ts b/client/src/app/videos/+video-edit/video-add.component.ts
index 2bbc3de17..503f705db 100644
--- a/client/src/app/videos/+video-edit/video-add.component.ts
+++ b/client/src/app/videos/+video-edit/video-add.component.ts
@@ -3,13 +3,12 @@ import { Component, OnInit, ViewChild } from '@angular/core'
3import { FormBuilder, FormGroup } from '@angular/forms' 3import { FormBuilder, FormGroup } from '@angular/forms'
4import { Router } from '@angular/router' 4import { Router } from '@angular/router'
5import { NotificationsService } from 'angular2-notifications' 5import { NotificationsService } from 'angular2-notifications'
6import { VideoService } from 'app/shared/video/video.service'
7import { VideoCreate } from '../../../../../shared'
8import { VideoPrivacy } from '../../../../../shared/models/videos' 6import { VideoPrivacy } from '../../../../../shared/models/videos'
9import { AuthService, ServerService } from '../../core' 7import { AuthService, ServerService } from '../../core'
10import { FormReactive } from '../../shared' 8import { FormReactive } from '../../shared'
11import { ValidatorMessage } from '../../shared/forms/form-validators' 9import { ValidatorMessage } from '../../shared/forms/form-validators/validator-message'
12import { VideoEdit } from '../../shared/video/video-edit.model' 10import { VideoEdit } from '../../shared/video/video-edit.model'
11import { VideoService } from '../../shared/video/video.service'
13 12
14@Component({ 13@Component({
15 selector: 'my-videos-add', 14 selector: 'my-videos-add',
diff --git a/client/src/app/videos/+video-edit/video-update.component.ts b/client/src/app/videos/+video-edit/video-update.component.ts
index d1da8b6d8..08b74f4c3 100644
--- a/client/src/app/videos/+video-edit/video-update.component.ts
+++ b/client/src/app/videos/+video-edit/video-update.component.ts
@@ -3,10 +3,10 @@ import { FormBuilder, FormGroup } from '@angular/forms'
3import { ActivatedRoute, Router } from '@angular/router' 3import { ActivatedRoute, Router } from '@angular/router'
4import { NotificationsService } from 'angular2-notifications' 4import { NotificationsService } from 'angular2-notifications'
5import 'rxjs/add/observable/forkJoin' 5import 'rxjs/add/observable/forkJoin'
6import { VideoPrivacy } from '../../../../../shared/models/videos/video-privacy.enum' 6import { VideoPrivacy } from '../../../../../shared/models/videos'
7import { ServerService } from '../../core' 7import { ServerService } from '../../core'
8import { FormReactive } from '../../shared' 8import { FormReactive } from '../../shared'
9import { ValidatorMessage } from '../../shared/forms/form-validators' 9import { ValidatorMessage } from '../../shared/forms/form-validators/validator-message'
10import { VideoEdit } from '../../shared/video/video-edit.model' 10import { VideoEdit } from '../../shared/video/video-edit.model'
11import { VideoService } from '../../shared/video/video.service' 11import { VideoService } from '../../shared/video/video.service'
12 12
@@ -25,8 +25,6 @@ export class VideoUpdateComponent extends FormReactive implements OnInit {
25 validationMessages: ValidatorMessage = {} 25 validationMessages: ValidatorMessage = {}
26 videoPrivacies = [] 26 videoPrivacies = []
27 27
28 fileError = ''
29
30 constructor ( 28 constructor (
31 private formBuilder: FormBuilder, 29 private formBuilder: FormBuilder,
32 private route: ActivatedRoute, 30 private route: ActivatedRoute,
diff --git a/client/src/app/videos/+video-watch/index.ts b/client/src/app/videos/+video-watch/index.ts
deleted file mode 100644
index b19bfdb1e..000000000
--- a/client/src/app/videos/+video-watch/index.ts
+++ /dev/null
@@ -1 +0,0 @@
1export * from './video-watch.module'
diff --git a/client/src/app/videos/+video-watch/video-download.component.scss b/client/src/app/videos/+video-watch/video-download.component.scss
index c9d5af9c1..7eac3d1c9 100644
--- a/client/src/app/videos/+video-watch/video-download.component.scss
+++ b/client/src/app/videos/+video-watch/video-download.component.scss
@@ -1,3 +1,6 @@
1@import '_variables';
2@import '_mixins';
3
1.resolution-block:not(:first-child) { 4.resolution-block:not(:first-child) {
2 margin-top: 30px; 5 margin-top: 30px;
3} 6}
diff --git a/client/src/app/videos/+video-watch/video-watch.component.scss b/client/src/app/videos/+video-watch/video-watch.component.scss
index 9daa757b4..52082944a 100644
--- a/client/src/app/videos/+video-watch/video-watch.component.scss
+++ b/client/src/app/videos/+video-watch/video-watch.component.scss
@@ -1,3 +1,6 @@
1@import '_variables';
2@import '_mixins';
3
1#video-container { 4#video-container {
2 background-color: #000; 5 background-color: #000;
3 display: flex; 6 display: flex;
diff --git a/client/src/app/videos/+video-watch/video-watch.component.ts b/client/src/app/videos/+video-watch/video-watch.component.ts
index bec6932ae..3825e8449 100644
--- a/client/src/app/videos/+video-watch/video-watch.component.ts
+++ b/client/src/app/videos/+video-watch/video-watch.component.ts
@@ -2,10 +2,9 @@ import { Component, ElementRef, OnDestroy, OnInit, ViewChild } from '@angular/co
2import { ActivatedRoute, Router } from '@angular/router' 2import { ActivatedRoute, Router } from '@angular/router'
3import { MetaService } from '@ngx-meta/core' 3import { MetaService } from '@ngx-meta/core'
4import { NotificationsService } from 'angular2-notifications' 4import { NotificationsService } from 'angular2-notifications'
5import { VideoService } from 'app/shared/video/video.service'
6import { Observable } from 'rxjs/Observable' 5import { Observable } from 'rxjs/Observable'
7import { Subscription } from 'rxjs/Subscription' 6import { Subscription } from 'rxjs/Subscription'
8import videojs from 'video.js' 7import * as videojs from 'video.js'
9import { UserVideoRateType, VideoRateType } from '../../../../../shared' 8import { UserVideoRateType, VideoRateType } from '../../../../../shared'
10import '../../../assets/player/peertube-videojs-plugin' 9import '../../../assets/player/peertube-videojs-plugin'
11import { AuthService, ConfirmService } from '../../core' 10import { AuthService, ConfirmService } from '../../core'
@@ -13,6 +12,7 @@ import { VideoBlacklistService } from '../../shared'
13import { Account } from '../../shared/account/account.model' 12import { Account } from '../../shared/account/account.model'
14import { VideoDetails } from '../../shared/video/video-details.model' 13import { VideoDetails } from '../../shared/video/video-details.model'
15import { Video } from '../../shared/video/video.model' 14import { Video } from '../../shared/video/video.model'
15import { VideoService } from '../../shared/video/video.service'
16import { MarkdownService } from '../shared' 16import { MarkdownService } from '../shared'
17import { VideoDownloadComponent } from './video-download.component' 17import { VideoDownloadComponent } from './video-download.component'
18import { VideoReportComponent } from './video-report.component' 18import { VideoReportComponent } from './video-report.component'
diff --git a/client/src/app/videos/videos-routing.module.ts b/client/src/app/videos/videos-routing.module.ts
index 6910421b7..29ec5fd4f 100644
--- a/client/src/app/videos/videos-routing.module.ts
+++ b/client/src/app/videos/videos-routing.module.ts
@@ -46,7 +46,7 @@ const videosRoutes: Routes = [
46 }, 46 },
47 { 47 {
48 path: 'upload', 48 path: 'upload',
49 loadChildren: 'app/videos/+video-edit#VideoAddModule', 49 loadChildren: 'app/videos/+video-edit/video-add.module#VideoAddModule',
50 data: { 50 data: {
51 meta: { 51 meta: {
52 title: 'Upload a video' 52 title: 'Upload a video'
@@ -55,7 +55,7 @@ const videosRoutes: Routes = [
55 }, 55 },
56 { 56 {
57 path: 'edit/:uuid', 57 path: 'edit/:uuid',
58 loadChildren: 'app/videos/+video-edit#VideoUpdateModule', 58 loadChildren: 'app/videos/+video-edit/video-update.module#VideoUpdateModule',
59 data: { 59 data: {
60 meta: { 60 meta: {
61 title: 'Edit a video' 61 title: 'Edit a video'
@@ -69,7 +69,7 @@ const videosRoutes: Routes = [
69 }, 69 },
70 { 70 {
71 path: 'watch/:uuid', 71 path: 'watch/:uuid',
72 loadChildren: 'app/videos/+video-watch#VideoWatchModule', 72 loadChildren: 'app/videos/+video-watch/video-watch.module#VideoWatchModule',
73 data: { 73 data: {
74 preload: 3000 74 preload: 3000
75 } 75 }