mirror of
https://gitlab.com/walljm/dynamicbible.git
synced 2025-07-27 09:29:59 -04:00
42 lines
883 B
TypeScript
42 lines
883 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<string>();
|
||
|
|
||
|
@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(ref);
|
||
|
}
|
||
|
}
|