Client: little refractoring
authorChocobozzz <florian.bigard@gmail.com>
Fri, 5 May 2017 14:08:43 +0000 (16:08 +0200)
committerChocobozzz <florian.bigard@gmail.com>
Fri, 5 May 2017 14:08:43 +0000 (16:08 +0200)
26 files changed:
client/src/app/+admin/friends/friends.component.ts
client/src/app/+admin/users/shared/user.service.ts
client/src/app/+admin/users/user-list/user-list.component.scss
client/src/app/+admin/users/users.component.ts
client/src/app/+admin/users/users.routes.ts
client/src/app/+admin/video-abuses/video-abuse-list/video-abuse-list.component.scss [deleted file]
client/src/app/+admin/video-abuses/video-abuse-list/video-abuse-list.component.ts
client/src/app/+admin/video-abuses/video-abuses.routes.ts
client/src/app/core/menu/menu-admin.component.html
client/src/app/videos/shared/index.ts
client/src/app/videos/shared/loader/index.ts [deleted file]
client/src/app/videos/shared/loader/loader.component.html [deleted file]
client/src/app/videos/shared/loader/loader.component.scss [deleted file]
client/src/app/videos/shared/loader/loader.component.ts [deleted file]
client/src/app/videos/video-list/index.ts
client/src/app/videos/video-list/loader.component.html [new file with mode: 0644]
client/src/app/videos/video-list/loader.component.scss [new file with mode: 0644]
client/src/app/videos/video-list/loader.component.ts [new file with mode: 0644]
client/src/app/videos/video-list/video-list.component.scss
client/src/app/videos/video-list/video-list.component.ts
client/src/app/videos/video-list/video-miniature.component.html
client/src/app/videos/video-list/video-miniature.component.scss
client/src/app/videos/video-list/video-miniature.component.ts
client/src/app/videos/video-watch/video-watch.component.html
client/src/app/videos/video-watch/video-watch.component.scss
client/src/app/videos/videos.module.ts

index bc3f54158fef093f4c7d04f14f5f96c78f8b6549..5ca29111cbc1a36a316f3c201da59175bed85117 100644 (file)
@@ -1,7 +1,7 @@
 import { Component } from '@angular/core';
 
 @Component({
-    template: '<router-outlet></router-outlet>'
+   template: '<router-outlet></router-outlet>'
 })
 
 export class FriendsComponent {
index a92f9c23170e058f09e1e45951e980be6eca2b2a..da540bf9ff45cec94aa1acb03d10a9b1b7fe281a 100644 (file)
@@ -6,7 +6,6 @@ import { AuthHttp, RestExtractor, RestDataSource, User } from '../../../shared';
 
 @Injectable()
 export class UserService {
-  // TODO: merge this constant with account
   private static BASE_USERS_URL = '/api/v1/users/';
 
   constructor(
index e9f61e900ad00c798d10ae1feefca0be89251302..71adef65355a15fc3e92b0a949dbcbbdf8a9e8b9 100644 (file)
@@ -1,7 +1,3 @@
-.glyphicon-remove {
-  cursor: pointer;
-}
-
 .add-user {
   margin-top: 10px;
 }
index 37e3b158d1c0757447b2107843ac9316fca68829..91af6c320754f33ae583e0275d5f6e75c665c440 100644 (file)
@@ -1,7 +1,7 @@
 import { Component } from '@angular/core';
 
 @Component({
-    template: '<router-outlet></router-outlet>'
+   template: '<router-outlet></router-outlet>'
 })
 
 export class UsersComponent {
index ac64c891fd8e9526bec495007dbe8b0351d3b1a9..21fb192e00ff829ddc14d1d703773ad13ddce9c0 100644 (file)
@@ -6,32 +6,32 @@ import { UserListComponent } from './user-list';
 
 export const UsersRoutes: Routes = [
   {
-      path: 'users',
-      component: UsersComponent,
-      children: [
-        {
-          path: '',
-          redirectTo: 'list',
-          pathMatch: 'full'
-        },
-        {
-          path: 'list',
-          component: UserListComponent,
-          data: {
-            meta: {
-              title: 'Users list'
-            }
+    path: 'users',
+    component: UsersComponent,
+    children: [
+      {
+        path: '',
+        redirectTo: 'list',
+        pathMatch: 'full'
+      },
+      {
+        path: 'list',
+        component: UserListComponent,
+        data: {
+          meta: {
+            title: 'Users list'
           }
-        },
-        {
-          path: 'add',
-          component: UserAddComponent,
-          data: {
-            meta: {
-              title: 'Add a user'
-            }
+        }
+      },
+      {
+        path: 'add',
+        component: UserAddComponent,
+        data: {
+          meta: {
+            title: 'Add a user'
           }
         }
-      ]
-    }
+      }
+    ]
+  }
 ];
diff --git a/client/src/app/+admin/video-abuses/video-abuse-list/video-abuse-list.component.scss b/client/src/app/+admin/video-abuses/video-abuse-list/video-abuse-list.component.scss
deleted file mode 100644 (file)
index a094f74..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-.cell-id {
-  width: 40px;
-}
-
-.cell-reason {
-  width: 200px;
-}
index f59c4fffb4ac1a01f2808dbe4ee5800d76c56a47..55d82f79046efc32dd0770b8f27bbe4fe5b0f905 100644 (file)
@@ -6,8 +6,7 @@ import { Utils, VideoAbuseService, VideoAbuse } from '../../../shared';
 
 @Component({
        selector: 'my-video-abuse-list',
-       templateUrl: './video-abuse-list.component.html',
-  styleUrls: [ './video-abuse-list.component.scss' ]
+       templateUrl: './video-abuse-list.component.html'
 })
 export class VideoAbuseListComponent {
   videoAbusesSource = null;
index c99e162be42313cf7939ad544b456a69b4fa31a5..1f19d7885001d0f6c7fd901a02265153c678a05d 100644 (file)
@@ -5,24 +5,24 @@ import { VideoAbuseListComponent } from './video-abuse-list';
 
 export const VideoAbusesRoutes: Routes = [
   {
-      path: 'video-abuses',
-      component: VideoAbusesComponent
-      ,
-      children: [
-        {
-          path: '',
-          redirectTo: 'list',
-          pathMatch: 'full'
-        },
-        {
-          path: 'list',
-          component: VideoAbuseListComponent,
-          data: {
-            meta: {
-              title: 'Video abuses list'
-            }
+    path: 'video-abuses',
+    component: VideoAbusesComponent
+    ,
+    children: [
+      {
+        path: '',
+        redirectTo: 'list',
+        pathMatch: 'full'
+      },
+      {
+        path: 'list',
+        component: VideoAbuseListComponent,
+        data: {
+          meta: {
+            title: 'Video abuses list'
           }
         }
-      ]
-    }
+      }
+    ]
+  }
 ];
index 027799ee104eeba10d2ec1b71eb2cd936581e13a..0dfe22d84ce5e735863411f29f018541782eb092 100644 (file)
@@ -1,5 +1,4 @@
 <menu>
-
   <div class="panel-block">
     <a routerLink="/admin/users/list" routerLinkActive="active">
       <span class="hidden-xs glyphicon glyphicon-user"></span>
index beaa528c01c9e851fe58127933ca12561a13716d..a68491022545e1a286a5c1161d71a70de9f196cc 100644 (file)
@@ -1,4 +1,3 @@
-export * from './loader';
 export * from './sort-field.type';
 export * from './rate-type.type';
 export * from './video.model';
diff --git a/client/src/app/videos/shared/loader/index.ts b/client/src/app/videos/shared/loader/index.ts
deleted file mode 100644 (file)
index ab22584..0000000
+++ /dev/null
@@ -1 +0,0 @@
-export * from './loader.component';
diff --git a/client/src/app/videos/shared/loader/loader.component.html b/client/src/app/videos/shared/loader/loader.component.html
deleted file mode 100644 (file)
index 38d0695..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-<div id="video-loading" *ngIf="loading">
-  <div class="glyphicon glyphicon-refresh glyphicon-refresh-animate"></div>
-</div>
diff --git a/client/src/app/videos/shared/loader/loader.component.scss b/client/src/app/videos/shared/loader/loader.component.scss
deleted file mode 100644 (file)
index 44cf1f9..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-// Thanks https://gist.github.com/alexandrevicenzi/680147013e902a4eaa5d
-.glyphicon-refresh-animate {
-    -animation: spin .7s infinite linear;
-    -ms-animation: spin .7s infinite linear;
-    -webkit-animation: spinw .7s infinite linear;
-    -moz-animation: spinm .7s infinite linear;
-}
-
-@keyframes spin {
-    from { transform: scale(1) rotate(0deg);}
-    to { transform: scale(1) rotate(360deg);}
-}
-
-@-webkit-keyframes spinw {
-    from { -webkit-transform: rotate(0deg);}
-    to { -webkit-transform: rotate(360deg);}
-}
-
-@-moz-keyframes spinm {
-    from { -moz-transform: rotate(0deg);}
-    to { -moz-transform: rotate(360deg);}
-}
diff --git a/client/src/app/videos/shared/loader/loader.component.ts b/client/src/app/videos/shared/loader/loader.component.ts
deleted file mode 100644 (file)
index e72d2f3..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-import { Component, Input } from '@angular/core';
-
-@Component({
-  selector: 'my-loader',
-  styleUrls: [ './loader.component.scss' ],
-  templateUrl: './loader.component.html'
-})
-
-export class LoaderComponent {
-  @Input() loading: boolean;
-}
index 1f6d6a4e71c06c56556820a418576c44b68f2cce..71d3b78e6cc6c25a01680e0b3e1f67756bd722c0 100644 (file)
@@ -1,3 +1,4 @@
+export * from './loader.component';
 export * from './video-list.component';
 export * from './video-miniature.component';
 export * from './video-sort.component';
diff --git a/client/src/app/videos/video-list/loader.component.html b/client/src/app/videos/video-list/loader.component.html
new file mode 100644 (file)
index 0000000..38d0695
--- /dev/null
@@ -0,0 +1,3 @@
+<div id="video-loading" *ngIf="loading">
+  <div class="glyphicon glyphicon-refresh glyphicon-refresh-animate"></div>
+</div>
diff --git a/client/src/app/videos/video-list/loader.component.scss b/client/src/app/videos/video-list/loader.component.scss
new file mode 100644 (file)
index 0000000..44cf1f9
--- /dev/null
@@ -0,0 +1,22 @@
+// Thanks https://gist.github.com/alexandrevicenzi/680147013e902a4eaa5d
+.glyphicon-refresh-animate {
+    -animation: spin .7s infinite linear;
+    -ms-animation: spin .7s infinite linear;
+    -webkit-animation: spinw .7s infinite linear;
+    -moz-animation: spinm .7s infinite linear;
+}
+
+@keyframes spin {
+    from { transform: scale(1) rotate(0deg);}
+    to { transform: scale(1) rotate(360deg);}
+}
+
+@-webkit-keyframes spinw {
+    from { -webkit-transform: rotate(0deg);}
+    to { -webkit-transform: rotate(360deg);}
+}
+
+@-moz-keyframes spinm {
+    from { -moz-transform: rotate(0deg);}
+    to { -moz-transform: rotate(360deg);}
+}
diff --git a/client/src/app/videos/video-list/loader.component.ts b/client/src/app/videos/video-list/loader.component.ts
new file mode 100644 (file)
index 0000000..e72d2f3
--- /dev/null
@@ -0,0 +1,11 @@
+import { Component, Input } from '@angular/core';
+
+@Component({
+  selector: 'my-loader',
+  styleUrls: [ './loader.component.scss' ],
+  templateUrl: './loader.component.html'
+})
+
+export class LoaderComponent {
+  @Input() loading: boolean;
+}
index b48a4f125f3caeff32000015c686916a62b5d1e7..4b44096023f097ea7ee3852862fa26a3e2560ae0 100644 (file)
 
   my-video-miniature {
     text-align: left;
-    transition: all 0.5s ease;
-
-    &.ng-enter {
-      opacity: 0;
-    }
-
-    &.ng-enter-active {
-      opacity: 1;
-    }
-
-    &.ng-leave {
-      opacity: 0;
-    }
   }
 
   .no-video {
index 16e1b5bcc75c5af891e8a25fcf156d832114d0b9..16a40bdc4fa9812de7ab22ea2b723e6399ebad1e 100644 (file)
@@ -76,10 +76,7 @@ export class VideoListComponent implements OnInit, OnDestroy {
     this.loading.next(true);
     this.videos = [];
 
-    this.changeDetector.detectChanges();
-
     let observable = null;
-
     if (this.search.value) {
       observable = this.videoService.searchVideos(this.search, this.pagination, this.sort);
     } else {
@@ -150,8 +147,6 @@ export class VideoListComponent implements OnInit, OnDestroy {
     } else {
       this.pagination.currentPage = 1;
     }
-
-    this.changeDetector.detectChanges();
   }
 
   private navigateToNewParams() {
index 1d3451c2b44518fe3d1786b7e9b7c6af644400e3..648ef61b1adc0df09991d3d521a8db65d8f49770 100644 (file)
@@ -1,4 +1,4 @@
-<div class="video-miniature" (mouseenter)="onHover()" (mouseleave)="onBlur()">
+<div class="video-miniature">
   <a
     [routerLink]="['/videos/watch', video.id]" [attr.title]="video.description"
     class="video-miniature-thumbnail"
index f7fecdc3593d871bc5b07d55a50af14e66fd4c61..c2743c3beb0c123df1578277e7de8787e233f600 100644 (file)
@@ -1,5 +1,3 @@
-@import "../../../sass/pre-customizations.scss";
-
 .video-miniature {
   margin-top: 30px;
   display: inline-block;
@@ -71,7 +69,7 @@
       }
 
       .video-miniature-tags {
-        // Fix for chrome when tags a long
+        // Fix for chrome when tags are long
         width: 201px;
 
         .video-miniature-tag {
@@ -81,7 +79,6 @@
           top: -2px;
 
           .label {
-            line-height: $line-height-base;
             transition: background-color 0.2s;
           }
         }
index 13deec381f9198d08c4344e4e347d39a470badc2..28601ca7f06b10baa9ba96bea1b70cbdb9b74815 100644 (file)
@@ -17,8 +17,6 @@ export class VideoMiniatureComponent {
   @Input() user: User;
   @Input() video: Video;
 
-  hovering = false;
-
   constructor(
     private notificationsService: NotificationsService,
     private confirmService: ConfirmService,
@@ -33,14 +31,6 @@ export class VideoMiniatureComponent {
     return this.video.name;
   }
 
-  onBlur() {
-    this.hovering = false;
-  }
-
-  onHover() {
-    this.hovering = true;
-  }
-
   isVideoNSFWForThisUser() {
     return this.video.isVideoNSFWForUser(this.user);
   }
index 13f6719bb30c06eb1f70e4b5a21cf5652e4dc9ee..62f27ba48dd17652ec9d0066e7eee4a58aebf328 100644 (file)
   <div *ngIf="videoNotFound" id="video-not-found">Video not found :'(</div>
 </div>
 
+<!-- P2P informations -->
 <div id="torrent-info" class="row">
   <div id="torrent-info-download" class="col-md-4 col-sm-4 col-xs-4">Download: {{ downloadSpeed | bytes }}/s</div>
   <div id="torrent-info-upload" class="col-md-4 col-sm-4 col-xs-4">Upload: {{ uploadSpeed | bytes }}/s</div>
   <div id="torrent-info-peers" class="col-md-4 col-sm-4 col-xs-4">Number of peers: {{ numPeers }}</div>
 </div>
 
+<!-- Video informations -->
 <div *ngIf="video !== null" id="video-info">
   <div class="row video-name-views">
     <div class="col-xs-8 col-md-8 video-name">
index 767a3ed4ebcf196c445844ec227f514daf83cefb..789260a91875e347f67f57fd17935a4598de0a9b 100644 (file)
 
 .embed-responsive {
   height: 500px;
+
+  @media screen and (max-width: 600px) {
+    height: 300px;
+  }
 }
 
 #torrent-info {
   }
 }
 
-.embed-responsive {
-  @media screen and (max-width: 600px) {
-    height: 300px;
-  }
-}
-
 #video-info {
   .video-name-views {
     font-weight: bold;
index 04a06e0a367bd980a94f539caf7ec18e6b749775..adfbe703104404275527a0dbdc900c2b47f08dfe 100644 (file)
@@ -5,7 +5,7 @@ import { TagInputModule } from 'ng2-tag-input';
 import { VideosRoutingModule } from './videos-routing.module';
 import { VideosComponent } from './videos.component';
 import { VideoAddComponent, VideoUpdateComponent } from './video-edit';
-import { VideoListComponent, VideoMiniatureComponent, VideoSortComponent } from './video-list';
+import { LoaderComponent, VideoListComponent, VideoMiniatureComponent, VideoSortComponent } from './video-list';
 import {
   VideoWatchComponent,
   VideoMagnetComponent,
@@ -13,7 +13,7 @@ import {
   VideoShareComponent,
   WebTorrentService
 } from './video-watch';
-import { LoaderComponent, VideoService } from './shared';
+import { VideoService } from './shared';
 import { SharedModule } from '../shared';
 
 @NgModule({