aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/videos
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-05-05 16:08:43 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-05-05 16:08:43 +0200
commit1f0215a908c3b447cef03c10d4b089c0788922bd (patch)
tree2968e02707debeb91dfad0c5234da90d1e59ec38 /client/src/app/videos
parentc24ac1c18e26b6a24a4d294744908fb0c53ddf3c (diff)
downloadPeerTube-1f0215a908c3b447cef03c10d4b089c0788922bd.tar.gz
PeerTube-1f0215a908c3b447cef03c10d4b089c0788922bd.tar.zst
PeerTube-1f0215a908c3b447cef03c10d4b089c0788922bd.zip
Client: little refractoring
Diffstat (limited to 'client/src/app/videos')
-rw-r--r--client/src/app/videos/shared/index.ts1
-rw-r--r--client/src/app/videos/shared/loader/index.ts1
-rw-r--r--client/src/app/videos/video-list/index.ts1
-rw-r--r--client/src/app/videos/video-list/loader.component.html (renamed from client/src/app/videos/shared/loader/loader.component.html)0
-rw-r--r--client/src/app/videos/video-list/loader.component.scss (renamed from client/src/app/videos/shared/loader/loader.component.scss)0
-rw-r--r--client/src/app/videos/video-list/loader.component.ts (renamed from client/src/app/videos/shared/loader/loader.component.ts)0
-rw-r--r--client/src/app/videos/video-list/video-list.component.scss13
-rw-r--r--client/src/app/videos/video-list/video-list.component.ts5
-rw-r--r--client/src/app/videos/video-list/video-miniature.component.html2
-rw-r--r--client/src/app/videos/video-list/video-miniature.component.scss5
-rw-r--r--client/src/app/videos/video-list/video-miniature.component.ts10
-rw-r--r--client/src/app/videos/video-watch/video-watch.component.html2
-rw-r--r--client/src/app/videos/video-watch/video-watch.component.scss10
-rw-r--r--client/src/app/videos/videos.module.ts4
14 files changed, 11 insertions, 43 deletions
diff --git a/client/src/app/videos/shared/index.ts b/client/src/app/videos/shared/index.ts
index beaa528c0..a68491022 100644
--- a/client/src/app/videos/shared/index.ts
+++ b/client/src/app/videos/shared/index.ts
@@ -1,4 +1,3 @@
1export * from './loader';
2export * from './sort-field.type'; 1export * from './sort-field.type';
3export * from './rate-type.type'; 2export * from './rate-type.type';
4export * from './video.model'; 3export * 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
index ab22584e4..000000000
--- a/client/src/app/videos/shared/loader/index.ts
+++ /dev/null
@@ -1 +0,0 @@
1export * from './loader.component';
diff --git a/client/src/app/videos/video-list/index.ts b/client/src/app/videos/video-list/index.ts
index 1f6d6a4e7..71d3b78e6 100644
--- a/client/src/app/videos/video-list/index.ts
+++ b/client/src/app/videos/video-list/index.ts
@@ -1,3 +1,4 @@
1export * from './loader.component';
1export * from './video-list.component'; 2export * from './video-list.component';
2export * from './video-miniature.component'; 3export * from './video-miniature.component';
3export * from './video-sort.component'; 4export * from './video-sort.component';
diff --git a/client/src/app/videos/shared/loader/loader.component.html b/client/src/app/videos/video-list/loader.component.html
index 38d06950e..38d06950e 100644
--- a/client/src/app/videos/shared/loader/loader.component.html
+++ b/client/src/app/videos/video-list/loader.component.html
diff --git a/client/src/app/videos/shared/loader/loader.component.scss b/client/src/app/videos/video-list/loader.component.scss
index 44cf1f9da..44cf1f9da 100644
--- a/client/src/app/videos/shared/loader/loader.component.scss
+++ b/client/src/app/videos/video-list/loader.component.scss
diff --git a/client/src/app/videos/shared/loader/loader.component.ts b/client/src/app/videos/video-list/loader.component.ts
index e72d2f3f3..e72d2f3f3 100644
--- a/client/src/app/videos/shared/loader/loader.component.ts
+++ b/client/src/app/videos/video-list/loader.component.ts
diff --git a/client/src/app/videos/video-list/video-list.component.scss b/client/src/app/videos/video-list/video-list.component.scss
index b48a4f125..4b4409602 100644
--- a/client/src/app/videos/video-list/video-list.component.scss
+++ b/client/src/app/videos/video-list/video-list.component.scss
@@ -23,19 +23,6 @@
23 23
24 my-video-miniature { 24 my-video-miniature {
25 text-align: left; 25 text-align: left;
26 transition: all 0.5s ease;
27
28 &.ng-enter {
29 opacity: 0;
30 }
31
32 &.ng-enter-active {
33 opacity: 1;
34 }
35
36 &.ng-leave {
37 opacity: 0;
38 }
39 } 26 }
40 27
41 .no-video { 28 .no-video {
diff --git a/client/src/app/videos/video-list/video-list.component.ts b/client/src/app/videos/video-list/video-list.component.ts
index 16e1b5bcc..16a40bdc4 100644
--- a/client/src/app/videos/video-list/video-list.component.ts
+++ b/client/src/app/videos/video-list/video-list.component.ts
@@ -76,10 +76,7 @@ export class VideoListComponent implements OnInit, OnDestroy {
76 this.loading.next(true); 76 this.loading.next(true);
77 this.videos = []; 77 this.videos = [];
78 78
79 this.changeDetector.detectChanges();
80
81 let observable = null; 79 let observable = null;
82
83 if (this.search.value) { 80 if (this.search.value) {
84 observable = this.videoService.searchVideos(this.search, this.pagination, this.sort); 81 observable = this.videoService.searchVideos(this.search, this.pagination, this.sort);
85 } else { 82 } else {
@@ -150,8 +147,6 @@ export class VideoListComponent implements OnInit, OnDestroy {
150 } else { 147 } else {
151 this.pagination.currentPage = 1; 148 this.pagination.currentPage = 1;
152 } 149 }
153
154 this.changeDetector.detectChanges();
155 } 150 }
156 151
157 private navigateToNewParams() { 152 private navigateToNewParams() {
diff --git a/client/src/app/videos/video-list/video-miniature.component.html b/client/src/app/videos/video-list/video-miniature.component.html
index 1d3451c2b..648ef61b1 100644
--- a/client/src/app/videos/video-list/video-miniature.component.html
+++ b/client/src/app/videos/video-list/video-miniature.component.html
@@ -1,4 +1,4 @@
1<div class="video-miniature" (mouseenter)="onHover()" (mouseleave)="onBlur()"> 1<div class="video-miniature">
2 <a 2 <a
3 [routerLink]="['/videos/watch', video.id]" [attr.title]="video.description" 3 [routerLink]="['/videos/watch', video.id]" [attr.title]="video.description"
4 class="video-miniature-thumbnail" 4 class="video-miniature-thumbnail"
diff --git a/client/src/app/videos/video-list/video-miniature.component.scss b/client/src/app/videos/video-list/video-miniature.component.scss
index f7fecdc35..c2743c3be 100644
--- a/client/src/app/videos/video-list/video-miniature.component.scss
+++ b/client/src/app/videos/video-list/video-miniature.component.scss
@@ -1,5 +1,3 @@
1@import "../../../sass/pre-customizations.scss";
2
3.video-miniature { 1.video-miniature {
4 margin-top: 30px; 2 margin-top: 30px;
5 display: inline-block; 3 display: inline-block;
@@ -71,7 +69,7 @@
71 } 69 }
72 70
73 .video-miniature-tags { 71 .video-miniature-tags {
74 // Fix for chrome when tags a long 72 // Fix for chrome when tags are long
75 width: 201px; 73 width: 201px;
76 74
77 .video-miniature-tag { 75 .video-miniature-tag {
@@ -81,7 +79,6 @@
81 top: -2px; 79 top: -2px;
82 80
83 .label { 81 .label {
84 line-height: $line-height-base;
85 transition: background-color 0.2s; 82 transition: background-color 0.2s;
86 } 83 }
87 } 84 }
diff --git a/client/src/app/videos/video-list/video-miniature.component.ts b/client/src/app/videos/video-list/video-miniature.component.ts
index 13deec381..28601ca7f 100644
--- a/client/src/app/videos/video-list/video-miniature.component.ts
+++ b/client/src/app/videos/video-list/video-miniature.component.ts
@@ -17,8 +17,6 @@ export class VideoMiniatureComponent {
17 @Input() user: User; 17 @Input() user: User;
18 @Input() video: Video; 18 @Input() video: Video;
19 19
20 hovering = false;
21
22 constructor( 20 constructor(
23 private notificationsService: NotificationsService, 21 private notificationsService: NotificationsService,
24 private confirmService: ConfirmService, 22 private confirmService: ConfirmService,
@@ -33,14 +31,6 @@ export class VideoMiniatureComponent {
33 return this.video.name; 31 return this.video.name;
34 } 32 }
35 33
36 onBlur() {
37 this.hovering = false;
38 }
39
40 onHover() {
41 this.hovering = true;
42 }
43
44 isVideoNSFWForThisUser() { 34 isVideoNSFWForThisUser() {
45 return this.video.isVideoNSFWForUser(this.user); 35 return this.video.isVideoNSFWForUser(this.user);
46 } 36 }
diff --git a/client/src/app/videos/video-watch/video-watch.component.html b/client/src/app/videos/video-watch/video-watch.component.html
index 13f6719bb..62f27ba48 100644
--- a/client/src/app/videos/video-watch/video-watch.component.html
+++ b/client/src/app/videos/video-watch/video-watch.component.html
@@ -22,12 +22,14 @@
22 <div *ngIf="videoNotFound" id="video-not-found">Video not found :'(</div> 22 <div *ngIf="videoNotFound" id="video-not-found">Video not found :'(</div>
23</div> 23</div>
24 24
25<!-- P2P informations -->
25<div id="torrent-info" class="row"> 26<div id="torrent-info" class="row">
26 <div id="torrent-info-download" class="col-md-4 col-sm-4 col-xs-4">Download: {{ downloadSpeed | bytes }}/s</div> 27 <div id="torrent-info-download" class="col-md-4 col-sm-4 col-xs-4">Download: {{ downloadSpeed | bytes }}/s</div>
27 <div id="torrent-info-upload" class="col-md-4 col-sm-4 col-xs-4">Upload: {{ uploadSpeed | bytes }}/s</div> 28 <div id="torrent-info-upload" class="col-md-4 col-sm-4 col-xs-4">Upload: {{ uploadSpeed | bytes }}/s</div>
28 <div id="torrent-info-peers" class="col-md-4 col-sm-4 col-xs-4">Number of peers: {{ numPeers }}</div> 29 <div id="torrent-info-peers" class="col-md-4 col-sm-4 col-xs-4">Number of peers: {{ numPeers }}</div>
29</div> 30</div>
30 31
32<!-- Video informations -->
31<div *ngIf="video !== null" id="video-info"> 33<div *ngIf="video !== null" id="video-info">
32 <div class="row video-name-views"> 34 <div class="row video-name-views">
33 <div class="col-xs-8 col-md-8 video-name"> 35 <div class="col-xs-8 col-md-8 video-name">
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 767a3ed4e..789260a91 100644
--- a/client/src/app/videos/video-watch/video-watch.component.scss
+++ b/client/src/app/videos/video-watch/video-watch.component.scss
@@ -13,6 +13,10 @@
13 13
14.embed-responsive { 14.embed-responsive {
15 height: 500px; 15 height: 500px;
16
17 @media screen and (max-width: 600px) {
18 height: 300px;
19 }
16} 20}
17 21
18#torrent-info { 22#torrent-info {
@@ -25,12 +29,6 @@
25 } 29 }
26} 30}
27 31
28.embed-responsive {
29 @media screen and (max-width: 600px) {
30 height: 300px;
31 }
32}
33
34#video-info { 32#video-info {
35 .video-name-views { 33 .video-name-views {
36 font-weight: bold; 34 font-weight: bold;
diff --git a/client/src/app/videos/videos.module.ts b/client/src/app/videos/videos.module.ts
index 04a06e0a3..adfbe7031 100644
--- a/client/src/app/videos/videos.module.ts
+++ b/client/src/app/videos/videos.module.ts
@@ -5,7 +5,7 @@ import { TagInputModule } from 'ng2-tag-input';
5import { VideosRoutingModule } from './videos-routing.module'; 5import { VideosRoutingModule } from './videos-routing.module';
6import { VideosComponent } from './videos.component'; 6import { VideosComponent } from './videos.component';
7import { VideoAddComponent, VideoUpdateComponent } from './video-edit'; 7import { VideoAddComponent, VideoUpdateComponent } from './video-edit';
8import { VideoListComponent, VideoMiniatureComponent, VideoSortComponent } from './video-list'; 8import { LoaderComponent, VideoListComponent, VideoMiniatureComponent, VideoSortComponent } from './video-list';
9import { 9import {
10 VideoWatchComponent, 10 VideoWatchComponent,
11 VideoMagnetComponent, 11 VideoMagnetComponent,
@@ -13,7 +13,7 @@ import {
13 VideoShareComponent, 13 VideoShareComponent,
14 WebTorrentService 14 WebTorrentService
15} from './video-watch'; 15} from './video-watch';
16import { LoaderComponent, VideoService } from './shared'; 16import { VideoService } from './shared';
17import { SharedModule } from '../shared'; 17import { SharedModule } from '../shared';
18 18
19@NgModule({ 19@NgModule({