diff --git a/config-serializer/config-items/KeyAction.ts b/config-serializer/config-items/KeyAction.ts index 35a49ada..99fb2e04 100644 --- a/config-serializer/config-items/KeyAction.ts +++ b/config-serializer/config-items/KeyAction.ts @@ -25,7 +25,7 @@ let keyActionType = { abstract class KeyAction extends Serializable { assertKeyActionType(jsObject: any) { let keyActionClassname = this.constructor.name; - let keyActionTypeString = keyActionType[keyActionClassname] + let keyActionTypeString = keyActionType[keyActionClassname]; if (jsObject.keyActionType !== keyActionTypeString) { throw `Invalid ${keyActionClassname}.keyActionType: ${jsObject.keyActionType}`; } diff --git a/package.json b/package.json index 02ca95b9..148ea295 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ }, "scripts": { "postinstall": "typings install", - "lint": "tslint **/*.ts", + "lint": "tslint 'src/**/*.ts' 'config-serializer/**/*.ts'", "typings": "typings", "webpack": "webpack", "webpack-dev-server": "webpack-dev-server" diff --git a/src/components/keyboard-button-group.component.ts b/src/components/keyboard-button-group.component.ts index d8c2f0c3..4032d61b 100644 --- a/src/components/keyboard-button-group.component.ts +++ b/src/components/keyboard-button-group.component.ts @@ -31,4 +31,4 @@ export class KeyboardButtonGroupComponent implements OnInit { ngOnInit() { } -} \ No newline at end of file +} diff --git a/src/components/keyboard-button.component.ts b/src/components/keyboard-button.component.ts index 65a2e9d1..6609fb4e 100644 --- a/src/components/keyboard-button.component.ts +++ b/src/components/keyboard-button.component.ts @@ -13,7 +13,7 @@ import { Component, OnInit, Input } from 'angular2/core'; :host { display: flex; } - `], + `] }) export class KeyboardButtonComponent implements OnInit { @Input() id: string; @@ -27,4 +27,4 @@ export class KeyboardButtonComponent implements OnInit { ngOnInit() { } -} \ No newline at end of file +} diff --git a/src/components/keyboard-button.model.ts b/src/components/keyboard-button.model.ts index d9c1e690..651e2108 100644 --- a/src/components/keyboard-button.model.ts +++ b/src/components/keyboard-button.model.ts @@ -7,4 +7,4 @@ export interface KeyboardButton { height: string; width: string; fill: string; -} \ No newline at end of file +} diff --git a/src/components/keyboard.component.ts b/src/components/keyboard.component.ts index 0b863760..89db4f21 100644 --- a/src/components/keyboard.component.ts +++ b/src/components/keyboard.component.ts @@ -7,7 +7,11 @@ import {Module, ModuleComponent} from './module'; selector: 'keyboard', template: ` - + + `, styles: [` @@ -31,8 +35,8 @@ export class KeyboardComponent implements OnInit { } private loadKeyboardModules(): void { - var svg: any = this.dps.getBaseLayer(); + let svg: any = this.dps.getBaseLayer(); this.modules = svg.g[0].g.map(obj => new Module(obj, svg.g[0].$.fill)); } -} \ No newline at end of file +} diff --git a/src/components/module.component.ts b/src/components/module.component.ts index 44fcbbbd..a70c7384 100644 --- a/src/components/module.component.ts +++ b/src/components/module.component.ts @@ -30,27 +30,25 @@ export class ModuleComponent implements OnInit { ngOnInit() { this.getButtonGroups().forEach(buttonGroup => { - this.dcl.loadIntoLocation(KeyboardButtonGroupComponent, this.elementRef, "row").then((bttnComponentRef: ComponentRef) => { - var group: KeyboardButtonGroupComponent = bttnComponentRef.instance; - group.keyboardButtons = buttonGroup; - // console.log(keyboardButtonComponent); - }); + this.dcl.loadIntoLocation(KeyboardButtonGroupComponent, this.elementRef, 'row') + .then((bttnComponentRef: ComponentRef) => { + let group: KeyboardButtonGroupComponent = bttnComponentRef.instance; + group.keyboardButtons = buttonGroup; + }); }); } - private getButtonGroups(): KeyboardButton[][] { - var buttonGroups: KeyboardButton[][] = []; - var buttonGroup: KeyboardButton[] = []; - this.keyboardButtons.forEach((keyboardButton, index) => { + let buttonGroups: KeyboardButton[][] = []; + let buttonGroup: KeyboardButton[] = []; + this.keyboardButtons.forEach(keyboardButton => { if (buttonGroup.length > 0 && buttonGroup[buttonGroup.length - 1].y !== keyboardButton.y) { buttonGroups.push(buttonGroup); buttonGroup = []; } buttonGroup.push(keyboardButton); }); - //console.log(buttonGroups, buttonGroup, this.keyboardButtons); return buttonGroups; } -} \ No newline at end of file +} diff --git a/src/components/module.model.ts b/src/components/module.model.ts index 161ad9a1..e7d52df0 100644 --- a/src/components/module.model.ts +++ b/src/components/module.model.ts @@ -5,8 +5,8 @@ export class Module { private keyboardButtons: KeyboardButton[]; constructor(obj: { rect: any[], path: any[] }, fill?: string) { - this.keyboardButtons = obj.rect.map(obj => obj.$); + this.keyboardButtons = obj.rect.map(rect => rect.$); this.keyboardButtons.forEach(keyboardButton => keyboardButton.fill = fill ? fill : 'black'); this.case = obj.path[0].$; } -} \ No newline at end of file +} diff --git a/src/components/module.ts b/src/components/module.ts index 54e5251d..141d0a3e 100644 --- a/src/components/module.ts +++ b/src/components/module.ts @@ -1,3 +1,3 @@ import {Module} from './module.model'; import {ModuleComponent} from './module.component'; -export {Module, ModuleComponent}; \ No newline at end of file +export {Module, ModuleComponent}; diff --git a/src/services/data-provider.service.ts b/src/services/data-provider.service.ts index bccc350c..604de161 100644 --- a/src/services/data-provider.service.ts +++ b/src/services/data-provider.service.ts @@ -5,9 +5,8 @@ export class DataProviderService { constructor() { } - getBaseLayer(): any { return require('xml!../../images/base-layer.svg').svg; } -} \ No newline at end of file +}