diff --git a/DynamicBibleIonic/src/app/app.module.ts b/DynamicBibleIonic/src/app/app.module.ts index 696d6aed..5e1ff267 100644 --- a/DynamicBibleIonic/src/app/app.module.ts +++ b/DynamicBibleIonic/src/app/app.module.ts @@ -7,6 +7,7 @@ import {SearchPage} from "../pages/search/search"; import {ComponentLoader} from "../components/component-loader/component-loader.ts"; import {Passage} from "../components/passage/passage.ts"; import {Strongs} from "../components/strongs/strongs.ts"; +import {StrongsModal} from "../components/strongs-modal/strongs-modal.ts"; @NgModule({ declarations: [ @@ -15,6 +16,7 @@ import {Strongs} from "../components/strongs/strongs.ts"; ComponentLoader, Passage, Strongs, + StrongsModal, ], imports: [ IonicModule.forRoot(MyApp), @@ -26,6 +28,7 @@ import {Strongs} from "../components/strongs/strongs.ts"; SearchPage, Passage, Strongs, + StrongsModal, ], providers: [{ provide: ErrorHandler, useClass: IonicErrorHandler }] }) diff --git a/DynamicBibleIonic/src/components/passage/passage.html b/DynamicBibleIonic/src/components/passage/passage.html index 5dac8e52..f5394c94 100644 --- a/DynamicBibleIonic/src/components/passage/passage.html +++ b/DynamicBibleIonic/src/components/passage/passage.html @@ -8,6 +8,7 @@

Chapter {{ch.ch}}

- {{vs.v}}. {{w.t}}
+ {{vs.v}}. {{w.t}}
diff --git a/DynamicBibleIonic/src/components/passage/passage.ts b/DynamicBibleIonic/src/components/passage/passage.ts index 0f3cb88c..4adf79b4 100644 --- a/DynamicBibleIonic/src/components/passage/passage.ts +++ b/DynamicBibleIonic/src/components/passage/passage.ts @@ -24,4 +24,8 @@ export class Passage { openStrongs(strongs: string) { this.onStrongs.emit(this.dict+strongs); } + + isPunct(c: string) { + return new RegExp('^[\.\,\;\:\?\!]$').test(c) + } } \ No newline at end of file diff --git a/DynamicBibleIonic/src/components/strongs-modal/strongs-modal.html b/DynamicBibleIonic/src/components/strongs-modal/strongs-modal.html new file mode 100644 index 00000000..d3de8160 --- /dev/null +++ b/DynamicBibleIonic/src/components/strongs-modal/strongs-modal.html @@ -0,0 +1,18 @@ + + + + Strongs: {{item.prefix}}{{item.sn}} + + + + + + + +

+ {{item.def.tr}} ({{item.def.sn}}) - {{item.def.p}} - {{item.def.lemma}} -
+

+
\ No newline at end of file diff --git a/DynamicBibleIonic/src/components/strongs-modal/strongs-modal.ts b/DynamicBibleIonic/src/components/strongs-modal/strongs-modal.ts new file mode 100644 index 00000000..2928fde3 --- /dev/null +++ b/DynamicBibleIonic/src/components/strongs-modal/strongs-modal.ts @@ -0,0 +1,22 @@ +import {Component} from "@angular/core"; +import { ModalController, Platform, NavParams, ViewController } from 'ionic-angular'; + +@Component({ + selector: "strongs-modal", + templateUrl: "strongs-modal.html" +}) +export class StrongsModal { + item: StrongsResult; + + constructor( + public platform: Platform, + public params: NavParams, + public viewCtrl: ViewController + ) { + this.item = this.params.get('strongsid') as StrongsResult; + } + + dismiss() { + this.viewCtrl.dismiss(); + } +} \ No newline at end of file diff --git a/DynamicBibleIonic/src/pages/search/search.html b/DynamicBibleIonic/src/pages/search/search.html index 8ab562ba..43b02ca3 100644 --- a/DynamicBibleIonic/src/pages/search/search.html +++ b/DynamicBibleIonic/src/pages/search/search.html @@ -1,6 +1,6 @@ - diff --git a/DynamicBibleIonic/src/pages/search/search.scss b/DynamicBibleIonic/src/pages/search/search.scss index 9770c996..483c3871 100644 --- a/DynamicBibleIonic/src/pages/search/search.scss +++ b/DynamicBibleIonic/src/pages/search/search.scss @@ -1,14 +1,19 @@ +.search-card .content { + p { + margin: 20px 0; + line-height: 22px; + font-size: 16px; + } +} + .search-card { + .title { + background-color: gainsboro; + font-size: 2em; + } - p { - margin: 20px 0; - line-height: 22px; - font-size: 16px; - } - -} - -.title{ - background-color:gainsboro; - font-size: 2em; -} + a { + color: black; + border-bottom: 1px dotted gainsboro; + } +} \ No newline at end of file diff --git a/DynamicBibleIonic/src/pages/search/search.ts b/DynamicBibleIonic/src/pages/search/search.ts index 73e2d021..a745db84 100644 --- a/DynamicBibleIonic/src/pages/search/search.ts +++ b/DynamicBibleIonic/src/pages/search/search.ts @@ -2,12 +2,12 @@ import {Type, Component} from "@angular/core"; import {Reference} from "../../Reference"; import {BibleService} from "../../bible-service"; -import {LoadingController} from "ionic-angular"; +import {LoadingController, ModalController } from "ionic-angular"; import {StrongsService} from "../../strongs-service"; import {Strongs} from "../../components/strongs/strongs"; import {Passage} from "../../components/passage/passage.ts"; import {ComponentLoader} from "../../components/component-loader/component-loader.ts"; - +import {StrongsModal} from "../../components/strongs-modal/strongs-modal.ts"; class Item { id: number; @@ -25,7 +25,11 @@ export class SearchPage { items: any[]; last: number; - constructor(private strongsService: StrongsService, private bibleService: BibleService, public loadingCtrl: LoadingController) { + constructor( + private strongsService: StrongsService + , private bibleService: BibleService + , public loadingCtrl: LoadingController + , public modalCtrl: ModalController) { this.initializeItems(); } @@ -33,6 +37,12 @@ export class SearchPage { this.items = []; this.last = 0; } + + presentStrongsModal(strongs: StrongsResult) { + let modal = this.modalCtrl.create(StrongsModal, { strongsid: strongs}); + modal.present(); + } + setQuery(searchbar) { this.searchQuery = searchbar.target.value; } @@ -81,7 +91,8 @@ export class SearchPage { } q = q.substring(1, q.length); let result = this.strongsService.getStrongs(parseInt(q), dict); - this.items.unshift({ id: this.last++, data: result, type: Strongs }); + this.presentStrongsModal(result); + //this.items.unshift({ id: this.last++, data: result, type: Strongs }); } else { // its a verse reference. if (q.trim() !== "") { diff --git a/DynamicBibleUtility/DynamicBibleUtility/frmMain.cs b/DynamicBibleUtility/DynamicBibleUtility/frmMain.cs index 7df00bc6..531db2e4 100644 --- a/DynamicBibleUtility/DynamicBibleUtility/frmMain.cs +++ b/DynamicBibleUtility/DynamicBibleUtility/frmMain.cs @@ -253,7 +253,7 @@ namespace DynamicBibleUtility { // iterate through text, output json format. OpenFileDialog ofd = new OpenFileDialog(); - List bbl = new System.Collections.Generic.List(); + List bbl = new List(); if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK) { @@ -303,7 +303,7 @@ namespace DynamicBibleUtility { if (((XElement)o).Name == "gr") { - Ts.Add(new Text(((XElement)o).Value, ((XElement)o).FirstAttribute.Value)); + Ts.Add(new Text(((XElement)o).Value.Trim(), ((XElement)o).FirstAttribute.Value)); } else if ((((XElement)o).Name.ToString().ToLower() == "style")) { @@ -319,7 +319,7 @@ namespace DynamicBibleUtility } else if (o.GetType() == typeof(XText)) { - Ts.Add(new Text(((XText)o).Value)); + Ts.Add(new Text(((XText)o).Value.Trim())); } else { @@ -342,7 +342,7 @@ namespace DynamicBibleUtility { // iterate through text, output json format. OpenFileDialog ofd = new OpenFileDialog(); - List bbl = new System.Collections.Generic.List(); + List bbl = new List(); if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK) {