From 4a6995be18b15de1834a39c8921a0e4109671bb6 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 3 Jun 2016 22:08:03 +0200 Subject: First draft to use webpack instead of systemjs --- client/app/videos/shared/index.ts | 5 -- client/app/videos/shared/loader/index.ts | 1 - .../app/videos/shared/loader/loader.component.html | 3 - .../app/videos/shared/loader/loader.component.scss | 26 ------- .../app/videos/shared/loader/loader.component.ts | 11 --- client/app/videos/shared/pagination.model.ts | 5 -- client/app/videos/shared/sort-field.type.ts | 3 - client/app/videos/shared/video.model.ts | 64 ----------------- client/app/videos/shared/video.service.ts | 82 ---------------------- 9 files changed, 200 deletions(-) delete mode 100644 client/app/videos/shared/index.ts delete mode 100644 client/app/videos/shared/loader/index.ts delete mode 100644 client/app/videos/shared/loader/loader.component.html delete mode 100644 client/app/videos/shared/loader/loader.component.scss delete mode 100644 client/app/videos/shared/loader/loader.component.ts delete mode 100644 client/app/videos/shared/pagination.model.ts delete mode 100644 client/app/videos/shared/sort-field.type.ts delete mode 100644 client/app/videos/shared/video.model.ts delete mode 100644 client/app/videos/shared/video.service.ts (limited to 'client/app/videos/shared') diff --git a/client/app/videos/shared/index.ts b/client/app/videos/shared/index.ts deleted file mode 100644 index c535c46fc..000000000 --- a/client/app/videos/shared/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from './loader/index'; -export * from './pagination.model'; -export * from './sort-field.type'; -export * from './video.model'; -export * from './video.service'; diff --git a/client/app/videos/shared/loader/index.ts b/client/app/videos/shared/loader/index.ts deleted file mode 100644 index ab22584e4..000000000 --- a/client/app/videos/shared/loader/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './loader.component'; diff --git a/client/app/videos/shared/loader/loader.component.html b/client/app/videos/shared/loader/loader.component.html deleted file mode 100644 index d02296a2d..000000000 --- a/client/app/videos/shared/loader/loader.component.html +++ /dev/null @@ -1,3 +0,0 @@ -
-
-
diff --git a/client/app/videos/shared/loader/loader.component.scss b/client/app/videos/shared/loader/loader.component.scss deleted file mode 100644 index 454195811..000000000 --- a/client/app/videos/shared/loader/loader.component.scss +++ /dev/null @@ -1,26 +0,0 @@ -div { - margin-top: 150px; -} - -// 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/app/videos/shared/loader/loader.component.ts b/client/app/videos/shared/loader/loader.component.ts deleted file mode 100644 index 666d43bc3..000000000 --- a/client/app/videos/shared/loader/loader.component.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Component, Input } from '@angular/core'; - -@Component({ - selector: 'my-loader', - styleUrls: [ 'client/app/videos/shared/loader/loader.component.css' ], - templateUrl: 'client/app/videos/shared/loader/loader.component.html' -}) - -export class LoaderComponent { - @Input() loading: boolean; -} diff --git a/client/app/videos/shared/pagination.model.ts b/client/app/videos/shared/pagination.model.ts deleted file mode 100644 index 06f7a7875..000000000 --- a/client/app/videos/shared/pagination.model.ts +++ /dev/null @@ -1,5 +0,0 @@ -export interface Pagination { - currentPage: number; - itemsPerPage: number; - total: number; -} diff --git a/client/app/videos/shared/sort-field.type.ts b/client/app/videos/shared/sort-field.type.ts deleted file mode 100644 index 6e8cc7936..000000000 --- a/client/app/videos/shared/sort-field.type.ts +++ /dev/null @@ -1,3 +0,0 @@ -export type SortField = "name" | "-name" - | "duration" | "-duration" - | "createdDate" | "-createdDate"; diff --git a/client/app/videos/shared/video.model.ts b/client/app/videos/shared/video.model.ts deleted file mode 100644 index 614403d79..000000000 --- a/client/app/videos/shared/video.model.ts +++ /dev/null @@ -1,64 +0,0 @@ -export class Video { - author: string; - by: string; - createdDate: Date; - description: string; - duration: string; - id: string; - isLocal: boolean; - magnetUri: string; - name: string; - podUrl: string; - thumbnailPath: string; - - private static createByString(author: string, podUrl: string) { - let [ host, port ] = podUrl.replace(/^https?:\/\//, '').split(':'); - - if (port === '80' || port === '443') { - port = ''; - } else { - port = ':' + port; - } - - return author + '@' + host + port; - } - - private static createDurationString(duration: number) { - 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(); - } - - constructor(hash: { - author: string, - createdDate: string, - description: string, - duration: number; - id: string, - isLocal: boolean, - magnetUri: string, - name: string, - podUrl: string, - thumbnailPath: string - }) { - this.author = hash.author; - this.createdDate = new Date(hash.createdDate); - this.description = hash.description; - this.duration = Video.createDurationString(hash.duration); - this.id = hash.id; - this.isLocal = hash.isLocal; - this.magnetUri = hash.magnetUri; - this.name = hash.name; - this.podUrl = hash.podUrl; - this.thumbnailPath = hash.thumbnailPath; - - this.by = Video.createByString(hash.author, hash.podUrl); - } - - isRemovableBy(user) { - return this.isLocal === true && user && this.author === user.username; - } -} diff --git a/client/app/videos/shared/video.service.ts b/client/app/videos/shared/video.service.ts deleted file mode 100644 index a786b2ab2..000000000 --- a/client/app/videos/shared/video.service.ts +++ /dev/null @@ -1,82 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Http, Response, URLSearchParams } from '@angular/http'; -import { Observable } from 'rxjs/Rx'; - -import { Pagination } from './pagination.model'; -import { Search } from '../../shared/index'; -import { SortField } from './sort-field.type'; -import { AuthService } from '../../shared/index'; -import { Video } from './video.model'; - -@Injectable() -export class VideoService { - private static BASE_VIDEO_URL = '/api/v1/videos/'; - - constructor( - private authService: AuthService, - private http: Http - ) {} - - getVideo(id: string) { - return this.http.get(VideoService.BASE_VIDEO_URL + id) - .map(res =>