From aff038cd784ab09a9f62b2e81816110e100ba7b8 Mon Sep 17 00:00:00 2001
From: Chocobozzz <florian.bigard@gmail.com>
Date: Mon, 23 May 2016 12:15:03 +0200
Subject: Lint the client

---
 .../videos/components/list/video-sort.component.ts | 12 +++----
 .../components/list/videos-list.component.ts       |  4 +--
 client/angular/videos/video.ts                     | 39 ++++++++++++----------
 client/angular/videos/videos.service.ts            |  6 ++--
 4 files changed, 32 insertions(+), 29 deletions(-)

(limited to 'client/angular/videos')

diff --git a/client/angular/videos/components/list/video-sort.component.ts b/client/angular/videos/components/list/video-sort.component.ts
index e63a70e9e..0373cea38 100644
--- a/client/angular/videos/components/list/video-sort.component.ts
+++ b/client/angular/videos/components/list/video-sort.component.ts
@@ -15,12 +15,12 @@ export class VideoSortComponent {
 
   sortChoices = {
     'name': 'Name - Asc',
-    '-name': "Name - Desc",
-    'duration': "Duration - Asc",
-    '-duration': "Duration - Desc",
-    'createdDate': "Created Date - Asc",
-    '-createdDate': "Created Date - Desc"
-  }
+    '-name': 'Name - Desc',
+    'duration': 'Duration - Asc',
+    '-duration': 'Duration - Desc',
+    'createdDate': 'Created Date - Asc',
+    '-createdDate': 'Created Date - Desc'
+  };
 
   get choiceKeys() {
     return Object.keys(this.sortChoices);
diff --git a/client/angular/videos/components/list/videos-list.component.ts b/client/angular/videos/components/list/videos-list.component.ts
index 98fe7b153..db64a856e 100644
--- a/client/angular/videos/components/list/videos-list.component.ts
+++ b/client/angular/videos/components/list/videos-list.component.ts
@@ -27,7 +27,7 @@ export class VideosListComponent implements OnInit {
     currentPage: 1,
     itemsPerPage: 9,
     total: 0
-  }
+  };
   sort: SortField;
 
   private search: Search;
@@ -41,7 +41,7 @@ export class VideosListComponent implements OnInit {
     this.search = {
       value: this._routeParams.get('search'),
       field: <SearchField>this._routeParams.get('field')
-    }
+    };
 
     this.sort = <SortField>this._routeParams.get('sort') || '-createdDate';
   }
diff --git a/client/angular/videos/video.ts b/client/angular/videos/video.ts
index 32ff64eb3..eec537c9e 100644
--- a/client/angular/videos/video.ts
+++ b/client/angular/videos/video.ts
@@ -11,6 +11,27 @@ export class Video {
   by: string;
   duration: string;
 
+  private static createDurationString(duration: number): string {
+    const minutes = Math.floor(duration / 60);
+    const seconds = duration % 60;
+    const minutes_padding = minutes >= 10 ? '' : '0';
+    const seconds_padding = seconds >= 10 ? '' : '0';
+
+    return minutes_padding + minutes.toString() + ':' + seconds_padding + seconds.toString();
+  }
+
+  private static createByString(author: string, podUrl: string): string {
+    let [ host, port ] = podUrl.replace(/^https?:\/\//, '').split(':');
+
+    if (port === '80' || port === '443') {
+      port = '';
+    } else {
+      port = ':' + port;
+    }
+
+    return author + '@' + host + port;
+  }
+
   constructor(hash: {
     id: string,
     name: string,
@@ -39,22 +60,4 @@ export class Video {
   isRemovableBy(user): boolean {
     return this.isLocal === true && user && this.author === user.username;
   }
-
-  private static createDurationString(duration: number): string {
-    const minutes = Math.floor(duration / 60);
-    const seconds = duration % 60;
-    const minutes_padding = minutes >= 10 ? '' : '0';
-    const seconds_padding = seconds >= 10 ? '' : '0'
-
-    return minutes_padding + minutes.toString() + ':' + seconds_padding + seconds.toString();
-  }
-
-  private static createByString(author: string, podUrl: string): string {
-    let [ host, port ] = podUrl.replace(/^https?:\/\//, '').split(':');
-
-    if (port === '80' || port === '443') port = '';
-    else port = ':' + port;
-
-    return author + '@' + host + port;
-  }
 }
diff --git a/client/angular/videos/videos.service.ts b/client/angular/videos/videos.service.ts
index 43e3346aa..d5438fd82 100644
--- a/client/angular/videos/videos.service.ts
+++ b/client/angular/videos/videos.service.ts
@@ -1,5 +1,5 @@
 import { Injectable } from '@angular/core';
-import { Http, Response, RequestOptions, URLSearchParams } from '@angular/http';
+import { Http, Response, URLSearchParams } from '@angular/http';
 import { Observable } from 'rxjs/Rx';
 
 import { Pagination } from './pagination';
@@ -17,7 +17,7 @@ export class VideosService {
   getVideos(pagination: Pagination, sort: SortField) {
     const params = this.createPaginationParams(pagination);
 
-    if (sort) params.set('sort', sort)
+    if (sort) params.set('sort', sort);
 
     return this.http.get(this._baseVideoUrl, { search: params })
                     .map(res => res.json())
@@ -42,7 +42,7 @@ export class VideosService {
     const params = this.createPaginationParams(pagination);
 
     if (search.field) params.set('field', search.field);
-    if (sort) params.set('sort', sort)
+    if (sort) params.set('sort', sort);
 
     return this.http.get(this._baseVideoUrl + 'search/' + encodeURIComponent(search.value), { search: params })
                     .map(res => res.json())
-- 
cgit v1.2.3