FEATURE: Started working on a verse picker

This commit is contained in:
jason.wall 2017-08-21 17:21:21 -04:00
parent 271f759743
commit 13470939aa
3 changed files with 109 additions and 0 deletions

View File

@ -0,0 +1,43 @@
<ion-header>
<ion-toolbar>
<ion-title>
<ion-icon name="paper" item-left></ion-icon> <span *ngIf="item !== undefined"><span *ngIf="item.status === -1">Error:</span>Strongs: {{item.prefix}}{{item.sn}}</span>
</ion-title>
<ion-buttons start>
<button ion-button (click)="dismiss()" large>
<ion-icon name="md-close"></ion-icon>
</button>
</ion-buttons>
</ion-toolbar>
</ion-header>
<ion-content padding *ngIf="item !== undefined && item.status === 0">
<br>
<h2>Strong's Definitition</h2>
<p>
<b>{{item.def.tr}} <template [ngIf]="item.def.sn != null">({{item.def.sn}})</template></b>
- {{item.def.p}} - {{item.def.lemma}} -
<span *ngFor="let part of item.def.de"><template [ngIf]="part.sn != null"><a (click)="openItem(part.sn)">{{part.sn}}</a></template><template [ngIf]="part.w != null"><span [innerHTML]="part.w"></span></template></span><br>
</p>
<template [ngIf]="item.rmac !== null">
<h2>RMAC</h2>
<b>{{item.rmac.id}}</b>
<br>
<ul>
<li *ngFor="let c of item.rmac.d">
{{c}}
</li>
</ul>
</template>
<div class="strongs-cross" *ngIf="item.crossrefs != null && item.crossrefs.ss != null">
<h2>Cross References</h2>
&nbsp;&nbsp;&nbsp;Translated as {{item.crossrefs.ss.length}} words
<dl>
<dd *ngFor="let wrd of item.crossrefs.ss">
<strong>{{wrd.w}}:</strong> <span *ngFor="let p of wrd.rs"><a (click)="openPassage(p.r)">{{makePassage(p.r)}}</a>, </span>
</dd>
</dl>
</div>
</ion-content>
<ion-content *ngIf="item !== undefined && item.status === -1">
<error-message [msg]="item.msg"></error-message>
</ion-content>

View File

@ -0,0 +1,25 @@
strongs-modal {
a {
cursor: pointer !important;
color: black;
border-bottom: 1px dotted #b3bfd0;
}
.bar-button-ios {
padding-right: 25px;
padding-left: 9px;
}
.bar-button-md, .bar-button-wp {
padding-left: 25px;
padding-right: 9px;
}
.scroll-content {
line-height: 1.5em;
}
dd {
line-height: 1.7em;
}
}

View File

@ -0,0 +1,41 @@
import { EventEmitter, Component, Output, OnInit } from "@angular/core";
import { Platform, NavParams, ViewController } from 'ionic-angular';
@Component({
selector: "verse-picker",
templateUrl: "verse-picker.html"
})
export class VersePickerModal implements OnInit
{
@Output()
onItemClicked = new EventEmitter<string>();
constructor(
public platform: Platform,
public params: NavParams,
public viewCtrl: ViewController
)
{
this.onItemClicked.subscribe(item =>
{
let pg = this.params.get('onItemClicked');
pg.updateUIwithItems(item, false);
});
}
ngOnInit(): void
{
}
dismiss()
{
this.viewCtrl.dismiss();
}
openItem(p: string)
{
this.onItemClicked.emit(p);
this.dismiss();
}
}