2017-01-18 17:51:06 -05:00
|
|
|
import { Component, EventEmitter, Output, Input } from "@angular/core";
|
|
|
|
import { BiblePassageResult } from "../../services/bible-service";
|
|
|
|
import { OpenData, CardItem } from "../../pages/search/search";
|
|
|
|
|
2016-12-01 10:39:04 -05:00
|
|
|
@Component({
|
|
|
|
selector: "passage",
|
|
|
|
templateUrl: "passage.html"
|
|
|
|
})
|
2017-01-18 17:51:06 -05:00
|
|
|
export class Passage
|
|
|
|
{
|
2016-12-01 10:39:04 -05:00
|
|
|
@Output()
|
2016-12-28 16:57:40 -05:00
|
|
|
onStrongsClicked = new EventEmitter<OpenData>();
|
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;
|
|
|
|
|
2017-01-18 17:51:06 -05:00
|
|
|
constructor()
|
|
|
|
{
|
2016-12-01 10:39:04 -05:00
|
|
|
}
|
|
|
|
|
2017-01-18 17:51:06 -05:00
|
|
|
close()
|
|
|
|
{
|
2016-12-01 15:21:07 -05:00
|
|
|
this.onClose.emit(this.cardItem);
|
2016-12-01 10:39:04 -05:00
|
|
|
}
|
2017-01-18 17:51:06 -05:00
|
|
|
openStrongs(strongs: string)
|
|
|
|
{
|
2016-12-28 16:57:40 -05:00
|
|
|
this.onStrongsClicked.emit({ card: this.cardItem, qry: this.dict + strongs });
|
2016-12-01 10:39:04 -05:00
|
|
|
}
|
2017-01-18 17:51:06 -05:00
|
|
|
openMenu(strongs: string)
|
|
|
|
{
|
2017-01-04 17:17:56 -05:00
|
|
|
}
|
2017-01-18 17:51:06 -05:00
|
|
|
isPunct(c: string)
|
|
|
|
{
|
2016-12-01 13:40:04 -05:00
|
|
|
return new RegExp('^[\.\,\;\:\?\!]$').test(c)
|
|
|
|
}
|
2016-12-01 10:39:04 -05:00
|
|
|
}
|