correction pages: register, myProfil-user, search, myPlaylists
This commit is contained in:
parent
91171a3765
commit
a8cbd4efb7
27 changed files with 278 additions and 352 deletions
|
|
@ -1,6 +1,8 @@
|
|||
import {Component, Input, OnChanges} from '@angular/core';
|
||||
import {Component, Input, OnChanges } from '@angular/core';
|
||||
import {Video} from "../../../utils/interfaces/video";
|
||||
import {UserHistoryService} from "../../../utils/services/userHistory/userHistory.service";
|
||||
import {AddVideoToPlaylistsService} from "../../../utils/services/addVideoToPlaylists/add-video-to-playlists.service";
|
||||
import {VideoUrlService} from "../../../utils/services/videoUrl/video-url.service";
|
||||
|
||||
|
||||
@Component({
|
||||
|
|
@ -11,31 +13,33 @@ import {UserHistoryService} from "../../../utils/services/userHistory/userHistor
|
|||
export class VideoGridComponent implements OnChanges
|
||||
{
|
||||
@Input() tabVideo: Video[] = [];
|
||||
tabTriplet = [];
|
||||
indexPage: number = 0;
|
||||
|
||||
|
||||
constructor(private historiqueService: UserHistoryService) {}
|
||||
constructor( private historiqueService: UserHistoryService,
|
||||
private addVideoToPlaylistsService: AddVideoToPlaylistsService,
|
||||
private videoUrlService: VideoUrlService ) {}
|
||||
|
||||
|
||||
ngOnChanges(): void
|
||||
{
|
||||
this.historiqueService.clearTabVideoUrlClicked();
|
||||
//this.historiqueService.clearTabVideoUrlClicked();
|
||||
}
|
||||
|
||||
this.tabTriplet = [];
|
||||
let n = this.tabVideo.length;
|
||||
let i = 0;
|
||||
while(i < n)
|
||||
{
|
||||
let triplet = []
|
||||
let compteur = 0;
|
||||
while((compteur < 3) && (i < n))
|
||||
{
|
||||
triplet.push(this.tabVideo[i]);
|
||||
i++ ;
|
||||
compteur++ ;
|
||||
}
|
||||
this.tabTriplet.push(triplet)
|
||||
}
|
||||
onAdd(video: Video): void
|
||||
{
|
||||
this.addVideoToPlaylistsService.run(video);
|
||||
}
|
||||
|
||||
onIframeClick(video: Video)
|
||||
{
|
||||
console.log("onIframeClick: " + video.title);
|
||||
this.historiqueService.addVideoToHistoque(video);
|
||||
}
|
||||
|
||||
tronquage(str: string)
|
||||
{
|
||||
if(str.length < 30) return str;
|
||||
else return str.substring(0, 30) + "..." ;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue