added TSLint for TypeScript code style checking, fixed associated errors

This commit is contained in:
alecmerdler 2017-06-19 23:17:42 -07:00
parent 6a7722cadb
commit 41e7e559a6
43 changed files with 253 additions and 730 deletions

View file

@ -16,8 +16,10 @@ export class MarkdownEditorComponent {
@Input('<') public content: string;
@Output() public save: EventEmitter<{editedContent: string}> = new EventEmitter();
@Output() public discard: EventEmitter<any> = new EventEmitter();
// Textarea is public for testability, should not be directly accessed
@ViewChild('#markdown-textarea') public textarea: ng.IAugmentedJQuery;
private editMode: EditMode = "write";
constructor(@Inject('$document') private $document: ng.IDocumentService,
@ -115,9 +117,9 @@ export class MarkdownEditorComponent {
private insertText(text: string, startPos: number, endPos: number): void {
if (this.browserPlatform === 'firefox') {
// FIXME: Ctrl-Z highlights previous text
this.textarea.val(this.textarea.val().substr(0, startPos) +
this.textarea.val(<string>this.textarea.val().substr(0, startPos) +
text +
this.textarea.val().substr(endPos, this.textarea.val().length));
<string>this.textarea.val().substr(endPos, this.textarea.val().length));
}
else {
// TODO: Test other platforms (IE...)