From 41a2aee38cf812510010da09de9bae53590ec119 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 27 May 2016 16:23:10 +0200 Subject: Follow the angular styleguide for the directories structure --- client/angular/app/app.component.html | 60 ----------------- client/angular/app/app.component.scss | 32 ---------- client/angular/app/app.component.ts | 106 ------------------------------- client/angular/app/search.component.html | 17 ----- client/angular/app/search.component.ts | 46 -------------- client/angular/app/search.ts | 6 -- 6 files changed, 267 deletions(-) delete mode 100644 client/angular/app/app.component.html delete mode 100644 client/angular/app/app.component.scss delete mode 100644 client/angular/app/app.component.ts delete mode 100644 client/angular/app/search.component.html delete mode 100644 client/angular/app/search.component.ts delete mode 100644 client/angular/app/search.ts (limited to 'client/angular/app') diff --git a/client/angular/app/app.component.html b/client/angular/app/app.component.html deleted file mode 100644 index 48e97d523..000000000 --- a/client/angular/app/app.component.html +++ /dev/null @@ -1,60 +0,0 @@ -
- -
-
-

PeerTube

-
- -
- -
-
- - -
- - -
-
- - Login - Logout -
-
- -
-
- - Get videos -
- - -
- -
-
- - Make friends -
- -
- - Quit friends -
-
-
- -
- -
- -
- - -
- PeerTube, CopyLeft 2015-2016 -
-
diff --git a/client/angular/app/app.component.scss b/client/angular/app/app.component.scss deleted file mode 100644 index e02c2d5b0..000000000 --- a/client/angular/app/app.component.scss +++ /dev/null @@ -1,32 +0,0 @@ -header div { - line-height: 25px; - margin-bottom: 30px; -} - -menu { - min-height: 600px; - margin-right: 20px; - border-right: 1px solid rgba(0, 0, 0, 0.2); - - .panel_button { - margin: 8px; - cursor: pointer; - transition: margin 0.2s; - - &:hover { - margin-left: 15px; - } - - a { - color: #333333; - } - } - - .glyphicon { - margin: 5px; - } -} - -.panel_block:not(:last-child) { - border-bottom: 1px solid rgba(0, 0, 0, 0.1); -} diff --git a/client/angular/app/app.component.ts b/client/angular/app/app.component.ts deleted file mode 100644 index 722d0dca0..000000000 --- a/client/angular/app/app.component.ts +++ /dev/null @@ -1,106 +0,0 @@ -import { Component } from '@angular/core'; -import { RouteConfig, ROUTER_DIRECTIVES, ROUTER_PROVIDERS, Router } from '@angular/router-deprecated'; -import { HTTP_PROVIDERS } from '@angular/http'; - -import { VideosAddComponent } from '../videos/components/add/videos-add.component'; -import { VideosListComponent } from '../videos/components/list/videos-list.component'; -import { VideosWatchComponent } from '../videos/components/watch/videos-watch.component'; -import { VideosService } from '../videos/videos.service'; -import { FriendsService } from '../friends/services/friends.service'; -import { UserLoginComponent } from '../users/components/login/login.component'; -import { AuthService } from '../users/services/auth.service'; -import { AuthStatus } from '../users/models/authStatus'; -import { SearchComponent } from './search.component'; -import { Search } from './search'; - -@RouteConfig([ - { - path: '/users/login', - name: 'UserLogin', - component: UserLoginComponent - }, - { - path: '/videos/list', - name: 'VideosList', - component: VideosListComponent, - useAsDefault: true - }, - { - path: '/videos/watch/:id', - name: 'VideosWatch', - component: VideosWatchComponent - }, - { - path: '/videos/add', - name: 'VideosAdd', - component: VideosAddComponent - } -]) - -@Component({ - selector: 'my-app', - templateUrl: 'app/angular/app/app.component.html', - styleUrls: [ 'app/angular/app/app.component.css' ], - directives: [ ROUTER_DIRECTIVES, SearchComponent ], - providers: [ ROUTER_PROVIDERS, HTTP_PROVIDERS, VideosService, FriendsService, AuthService ] -}) - -export class AppComponent { - isLoggedIn: boolean; - search_field: string = name; - choices = [ ]; - - constructor(private _friendsService: FriendsService, - private _authService: AuthService, - private _router: Router - - ) { - this.isLoggedIn = this._authService.isLoggedIn(); - - this._authService.loginChanged$.subscribe( - status => { - if (status === AuthStatus.LoggedIn) { - this.isLoggedIn = true; - } - } - ); - } - - onSearch(search: Search) { - if (search.value !== '') { - const params = { - search: search.value, - field: search.field - }; - this._router.navigate(['VideosList', params]); - } else { - this._router.navigate(['VideosList']); - } - } - - logout() { - // this._authService.logout(); - } - - makeFriends() { - this._friendsService.makeFriends().subscribe( - status => { - if (status === 409) { - alert('Already made friends!'); - } else { - alert('Made friends!'); - } - }, - error => alert(error) - ); - } - - quitFriends() { - this._friendsService.quitFriends().subscribe( - status => { - alert('Quit friends!'); - }, - error => alert(error) - ); - } -} diff --git a/client/angular/app/search.component.html b/client/angular/app/search.component.html deleted file mode 100644 index fb13ac72e..000000000 --- a/client/angular/app/search.component.html +++ /dev/null @@ -1,17 +0,0 @@ -
-
- - -
- - -
diff --git a/client/angular/app/search.component.ts b/client/angular/app/search.component.ts deleted file mode 100644 index e21b91fce..000000000 --- a/client/angular/app/search.component.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { Component, EventEmitter, Output } from '@angular/core'; - -import { DROPDOWN_DIRECTIVES} from 'ng2-bootstrap/components/dropdown'; - -import { Search, SearchField } from './search'; - -@Component({ - selector: 'my-search', - templateUrl: 'app/angular/app/search.component.html', - directives: [ DROPDOWN_DIRECTIVES ] -}) - -export class SearchComponent { - @Output() search: EventEmitter = new EventEmitter(); - - searchCriterias: Search = { - field: 'name', - value: '' - }; - fieldChoices = { - name: 'Name', - author: 'Author', - podUrl: 'Pod Url', - magnetUri: 'Magnet Uri' - }; - - get choiceKeys() { - return Object.keys(this.fieldChoices); - } - - getStringChoice(choiceKey: SearchField): string { - return this.fieldChoices[choiceKey]; - } - - choose($event:MouseEvent, choice: SearchField) { - $event.preventDefault(); - $event.stopPropagation(); - - this.searchCriterias.field = choice; - } - - doSearch(): void { - this.search.emit(this.searchCriterias); - } - -} diff --git a/client/angular/app/search.ts b/client/angular/app/search.ts deleted file mode 100644 index c4e771b47..000000000 --- a/client/angular/app/search.ts +++ /dev/null @@ -1,6 +0,0 @@ -export type SearchField = "name" | "author" | "podUrl" | "magnetUri"; - -export interface Search { - field: SearchField; - value: string; -} -- cgit v1.2.3