2016-12-01 10:39:04 -05:00
|
|
|
import { Component, EventEmitter, Output, Input} from "@angular/core";
|
|
|
|
@Component({
|
|
|
|
selector: "passage",
|
|
|
|
templateUrl: "passage.html"
|
|
|
|
})
|
|
|
|
export class Passage {
|
|
|
|
@Output()
|
2016-12-02 11:01:44 -05:00
|
|
|
onStrongsClicked = new EventEmitter<string>();
|
2016-12-01 10:39:04 -05:00
|
|
|
@Output()
|
2016-12-01 15:21:07 -05:00
|
|
|
onClose = new EventEmitter<CardItem>();
|
2016-12-01 10:39:04 -05:00
|
|
|
|
|
|
|
@Input()
|
|
|
|
item: BiblePassageResult;
|
|
|
|
|
|
|
|
@Input()
|
|
|
|
dict: string;
|
|
|
|
|
2016-12-01 15:21:07 -05:00
|
|
|
@Input()
|
|
|
|
cardItem: CardItem;
|
|
|
|
|
2016-12-01 10:39:04 -05:00
|
|
|
constructor() {
|
|
|
|
}
|
|
|
|
|
|
|
|
close() {
|
2016-12-01 15:21:07 -05:00
|
|
|
this.onClose.emit(this.cardItem);
|
2016-12-01 10:39:04 -05:00
|
|
|
}
|
|
|
|
openStrongs(strongs: string) {
|
2016-12-02 11:01:44 -05:00
|
|
|
this.onStrongsClicked.emit(this.dict+strongs);
|
2016-12-01 10:39:04 -05:00
|
|
|
}
|
2016-12-01 13:40:04 -05:00
|
|
|
|
|
|
|
isPunct(c: string) {
|
|
|
|
return new RegExp('^[\.\,\;\:\?\!]$').test(c)
|
|
|
|
}
|
2016-12-01 10:39:04 -05:00
|
|
|
}
|