Merge branch 'style-cleanup' into cleanup

* Apply tslint suggestions
* Remove unused assets
This commit is contained in:
Liam Westby 2018-04-17 21:15:44 -05:00
commit e7219627e4
11 changed files with 19 additions and 19 deletions

View File

@ -92,14 +92,14 @@ export class ControlsComponent implements OnInit, OnDestroy {
evt.preventDefault();
});
this.canvas.addEventListener('touchmove', (evt:TouchEvent) => {
this.canvas.addEventListener('touchmove', (evt: TouchEvent) => {
this.touchMoved(evt);
// Prevent touch events and mouse events from doubling up.
evt.preventDefault();
});
this.canvas.addEventListener('touchend', (evt:TouchEvent) => {
this.canvas.addEventListener('touchend', (evt: TouchEvent) => {
this.touchEnded(evt);
// Prevent touch events and mouse events from doubling up.
@ -145,7 +145,7 @@ export class ControlsComponent implements OnInit, OnDestroy {
}
draw() {
if (window.scrollY != 0) {
if (window.scrollY !== 0) {
window.scrollTo(0, 0);
}
const ctx = this.context;

View File

@ -15,7 +15,7 @@
</div>
</div>
<div id="players">
<player-list></player-list>
<app-player-list></app-player-list>
</div>
<div id="leaderboard">

View File

@ -2,7 +2,7 @@ import { Component, OnInit, Input } from '@angular/core';
import { Player } from './player';
@Component({
selector: 'player',
selector: 'app-player',
templateUrl: './player.component.html',
styleUrls: ['./player.component.scss']
})

View File

@ -1,2 +1,2 @@
<div id="title"><h2>Players</h2></div>
<div class="player-container" *ngFor="let player of players"><player [ngStyle]="player.style" [player]="player"></player></div>
<div class="player-container" *ngFor="let player of players"><app-player [ngStyle]="player.style" [player]="player"></app-player></div>

View File

@ -3,7 +3,7 @@ import { Player } from '../player/player';
import { PlayersService } from './players.service';
@Component({
selector: 'player-list',
selector: 'app-player-list',
templateUrl: './playerlist.component.html',
styleUrls: ['./playerlist.component.scss']
})

View File

@ -1,4 +1,4 @@
import { Point } from "./point";
import { Point } from './point';
export class Triangle {
point1: Point;
@ -18,7 +18,7 @@ export class Triangle {
const b2 = this.sign(other, this.point2, this.point3) < 0.0;
const b3 = this.sign(other, this.point3, this.point1) < 0.0;
return (b1 == b2) && (b2 == b3);
return (b1 === b2) && (b2 === b3);
}
sign(p1: Point, p2: Point, p3: Point): number {

View File

@ -42,7 +42,7 @@
<div class="form-group">
<div class="form-item" id="player-card">
<label>Player</label>
<player [ngStyle]="player.style" [player]="player"></player>
<app-player [ngStyle]="player.style" [player]="player"></app-player>
</div>
</div>
<div class="form-group">

View File

@ -40,10 +40,10 @@ export class LoginComponent implements OnInit {
async quickJoin() {
// First get an unstarted round ID
let roundID = await this.http.get(`${environment.API_URL_GAME_ROUND}/available`, { responseType: 'text' }).toPromise();
let roundID = await this.http.get(`${environment.API_URL_GAME_ROUND}/available`, { responseType: 'text' }).toPromise();
// Then join the round
this.joinRoundById(roundID);
// Then join the round
this.joinRoundById(roundID);
}
async joinRound() {
@ -57,7 +57,7 @@ export class LoginComponent implements OnInit {
let router = this.router;
roundID = roundID.toUpperCase().replace(/[^A-Z]/g, '');
let gameBoard = true;
if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
// give a controller-only view on mobile devices
gameBoard = false;
}
@ -89,8 +89,8 @@ export class LoginComponent implements OnInit {
return;
}
let response: any = await this.http.post(`${environment.API_URL_PLAYERS}/create?name=${this.username}`, "", {
responseType: 'text'
let response: any = await this.http.post(`${environment.API_URL_PLAYERS}/create?name=${this.username}`, '', {
responseType: 'text'
}).toPromise();
console.log(JSON.stringify(response));
console.log(`Created a new player with ID=${response}`);
@ -123,7 +123,7 @@ export class LoginComponent implements OnInit {
let router = this.router;
try {
let party: any = await this.http.post(`${environment.API_URL_PARTY}/create`, "", { responseType: 'json' }).toPromise();
let party: any = await this.http.post(`${environment.API_URL_PARTY}/create`, '', { responseType: 'json' }).toPromise();
sessionStorage.setItem('isSpectator', 'true');
sessionStorage.setItem('partyId', party.id);
sessionStorage.setItem('roundId', party.currentRound.id);

View File

@ -45,7 +45,7 @@ export class SocketService {
get socket(): Subject<MessageEvent> {
console.log(`retrieving socket: ${this.subject}`);
if (!this.initialized) {
console.warn("Socket not initialized yet");
console.warn('Socket not initialized yet');
}
return this.subject;
}
@ -55,7 +55,7 @@ export class SocketService {
const ws = new WebSocket(url);
ws.onopen = () => {
console.log('Socket open, sending buffered messages')
console.log('Socket open, sending buffered messages');
this.open = true;
while (this.messageBuffer.length > 0) {
this.subject.next(this.messageBuffer.shift() as any);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB