mirror of
https://gitlab.com/walljm/dynamicbible.git
synced 2025-07-26 17:10:11 -04:00
42 lines
915 B
TypeScript
42 lines
915 B
TypeScript
import {EventEmitter, Component, Input, Output} from "@angular/core";
|
|
import { Reference } from '../../Reference.ts';
|
|
|
|
@Component({
|
|
selector: "words",
|
|
templateUrl: "words.html"
|
|
})
|
|
export class Words {
|
|
@Output()
|
|
onClose = new EventEmitter<CardItem>();
|
|
|
|
@Output()
|
|
onPassageClicked = new EventEmitter<OpenData>();
|
|
|
|
@Input()
|
|
item: WordLookupResult;
|
|
|
|
@Input()
|
|
cardItem: CardItem;
|
|
|
|
constructor() {
|
|
}
|
|
|
|
close() {
|
|
this.onClose.emit(this.cardItem);
|
|
}
|
|
|
|
getColumns()
|
|
{
|
|
return Array.from(Array(Math.ceil(this.item.refs.length / 4)).keys())
|
|
}
|
|
|
|
makePassage(p: string)
|
|
{
|
|
return Reference.bookName(parseInt(p.split(":")[0])) + ' ' + p.split(":")[1] + ":" + p.split(":")[2];
|
|
}
|
|
openPassage(p: string)
|
|
{
|
|
let ref = this.makePassage(p);
|
|
this.onPassageClicked.emit({ card: this.cardItem, qry: ref });
|
|
}
|
|
} |