FIX: fixed splash/icon, fixed scroll performance issue, added loading modal
@ -1,58 +1,72 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
<widget id="com.ionicframework.db572483" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
|
<widget id="com.walljm.dynamicbible" version="3.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
|
||||||
<name>Dynamic Bible</name>
|
<name>Dynamic Bible</name>
|
||||||
<description>A bible app designed for bible study</description>
|
<description>A bible app designed for bible study</description>
|
||||||
<author email="jason@walljm.com" href="http://dynamicbible.com/">Dynamic Bible</author>
|
<author email="jason@walljm.com" href="http://dynamicbible.com/">Jason Wall</author>
|
||||||
<content src="index.html"/>
|
<content src="index.html" />
|
||||||
<access origin="*"/>
|
<access origin="*" />
|
||||||
<allow-intent href="http://*/*"/>
|
<allow-intent href="http://*/*" />
|
||||||
<allow-intent href="https://*/*"/>
|
<allow-intent href="https://*/*" />
|
||||||
<allow-intent href="tel:*"/>
|
<allow-intent href="tel:*" />
|
||||||
<allow-intent href="sms:*"/>
|
<allow-intent href="sms:*" />
|
||||||
<allow-intent href="mailto:*"/>
|
<allow-intent href="mailto:*" />
|
||||||
<allow-intent href="geo:*"/>
|
<allow-intent href="geo:*" />
|
||||||
<platform name="android">
|
<platform name="android">
|
||||||
<allow-intent href="market:*"/>
|
<allow-intent href="market:*" />
|
||||||
<splash src="resources\android\splash\drawable-land-ldpi-screen.png" density="land-ldpi"/>
|
<splash density="land-ldpi" src="resources\android\splash\drawable-land-ldpi-screen.png" />
|
||||||
<splash src="resources\android\splash\drawable-land-mdpi-screen.png" density="land-mdpi"/>
|
<splash density="land-mdpi" src="resources\android\splash\drawable-land-mdpi-screen.png" />
|
||||||
<splash src="resources\android\splash\drawable-land-hdpi-screen.png" density="land-hdpi"/>
|
<splash density="land-hdpi" src="resources\android\splash\drawable-land-hdpi-screen.png" />
|
||||||
<splash src="resources\android\splash\drawable-land-xhdpi-screen.png" density="land-xhdpi"/>
|
<splash density="land-xhdpi" src="resources\android\splash\drawable-land-xhdpi-screen.png" />
|
||||||
<splash src="resources\android\splash\drawable-land-xxhdpi-screen.png" density="land-xxhdpi"/>
|
<splash density="land-xxhdpi" src="resources\android\splash\drawable-land-xxhdpi-screen.png" />
|
||||||
<splash src="resources\android\splash\drawable-land-xxxhdpi-screen.png" density="land-xxxhdpi"/>
|
<splash density="land-xxxhdpi" src="resources\android\splash\drawable-land-xxxhdpi-screen.png" />
|
||||||
<splash src="resources\android\splash\drawable-port-ldpi-screen.png" density="port-ldpi"/>
|
<splash density="port-ldpi" src="resources\android\splash\drawable-port-ldpi-screen.png" />
|
||||||
<splash src="resources\android\splash\drawable-port-mdpi-screen.png" density="port-mdpi"/>
|
<splash density="port-mdpi" src="resources\android\splash\drawable-port-mdpi-screen.png" />
|
||||||
<splash src="resources\android\splash\drawable-port-hdpi-screen.png" density="port-hdpi"/>
|
<splash density="port-hdpi" src="resources\android\splash\drawable-port-hdpi-screen.png" />
|
||||||
<splash src="resources\android\splash\drawable-port-xhdpi-screen.png" density="port-xhdpi"/>
|
<splash density="port-xhdpi" src="resources\android\splash\drawable-port-xhdpi-screen.png" />
|
||||||
<splash src="resources\android\splash\drawable-port-xxhdpi-screen.png" density="port-xxhdpi"/>
|
<splash density="port-xxhdpi" src="resources\android\splash\drawable-port-xxhdpi-screen.png" />
|
||||||
<splash src="resources\android\splash\drawable-port-xxxhdpi-screen.png" density="port-xxxhdpi"/>
|
<splash density="port-xxxhdpi" src="resources\android\splash\drawable-port-xxxhdpi-screen.png" />
|
||||||
<icon src="resources\android\icon\drawable-ldpi-icon.png" density="ldpi"/>
|
<icon density="ldpi" src="resources\android\icon\drawable-ldpi-icon.png" />
|
||||||
<icon src="resources\android\icon\drawable-mdpi-icon.png" density="mdpi"/>
|
<icon density="mdpi" src="resources\android\icon\drawable-mdpi-icon.png" />
|
||||||
<icon src="resources\android\icon\drawable-hdpi-icon.png" density="hdpi"/>
|
<icon density="hdpi" src="resources\android\icon\drawable-hdpi-icon.png" />
|
||||||
<icon src="resources\android\icon\drawable-xhdpi-icon.png" density="xhdpi"/>
|
<icon density="xhdpi" src="resources\android\icon\drawable-xhdpi-icon.png" />
|
||||||
<icon src="resources\android\icon\drawable-xxhdpi-icon.png" density="xxhdpi"/>
|
<icon density="xxhdpi" src="resources\android\icon\drawable-xxhdpi-icon.png" />
|
||||||
<icon src="resources\android\icon\drawable-xxxhdpi-icon.png" density="xxxhdpi"/>
|
<icon density="xxxhdpi" src="resources\android\icon\drawable-xxxhdpi-icon.png" />
|
||||||
</platform>
|
</platform>
|
||||||
<platform name="ios">
|
<platform name="ios">
|
||||||
<allow-intent href="itms:*"/>
|
<allow-intent href="itms:*" />
|
||||||
<allow-intent href="itms-apps:*"/>
|
<allow-intent href="itms-apps:*" />
|
||||||
</platform>
|
</platform>
|
||||||
<preference name="webviewbounce" value="false"/>
|
<preference name="webviewbounce" value="false" />
|
||||||
<preference name="UIWebViewBounce" value="false"/>
|
<preference name="UIWebViewBounce" value="false" />
|
||||||
<preference name="DisallowOverscroll" value="true"/>
|
<preference name="DisallowOverscroll" value="true" />
|
||||||
<preference name="android-minSdkVersion" value="16"/>
|
<preference name="android-minSdkVersion" value="16" />
|
||||||
<preference name="BackupWebStorage" value="none"/>
|
<preference name="BackupWebStorage" value="none" />
|
||||||
<preference name="SplashMaintainAspectRatio" value="true"/>
|
<preference name="SplashMaintainAspectRatio" value="true" />
|
||||||
<preference name="FadeSplashScreenDuration" value="300"/>
|
<preference name="FadeSplashScreenDuration" value="300" />
|
||||||
<preference name="SplashScreen" value="screen"/>
|
<preference name="SplashScreen" value="screen" />
|
||||||
<preference name="SplashScreenDelay" value="3000"/>
|
<preference name="SplashScreenDelay" value="3000" />
|
||||||
<feature name="StatusBar">
|
<preference name="ShowSplashScreen" value="true" />
|
||||||
<param name="ios-package" onload="true" value="CDVStatusBar"/>
|
<preference name="AutoHideSplashScreen" value="true" />
|
||||||
</feature>
|
<preference name="SplashShowOnlyFirstTime" value="false" />
|
||||||
<plugin name="ionic-plugin-keyboard" spec="~2.2.1"/>
|
<preference name="FadeSplashScreen" value="false" />
|
||||||
<plugin name="cordova-plugin-whitelist" spec="1.3.1"/>
|
<feature name="SplashScreen">
|
||||||
<plugin name="cordova-plugin-console" spec="1.0.5"/>
|
<param name="android-package" value="org.apache.cordova.splashscreen.SplashScreen" />
|
||||||
<plugin name="cordova-plugin-statusbar" spec="2.2.1"/>
|
</feature>
|
||||||
<plugin name="cordova-plugin-device" spec="1.1.4"/>
|
<feature name="StatusBar">
|
||||||
<plugin name="cordova-plugin-splashscreen" spec="~4.0.1"/>
|
<param name="ios-package" onload="true" value="CDVStatusBar" />
|
||||||
<icon src="resources\android\icon\drawable-xhdpi-icon.png"/>
|
</feature>
|
||||||
</widget>
|
<plugin name="ionic-plugin-keyboard" spec="~2.2.1" />
|
||||||
|
<plugin name="cordova-plugin-whitelist" spec="1.3.1" />
|
||||||
|
<plugin name="cordova-plugin-console" spec="1.0.5" />
|
||||||
|
<plugin name="cordova-plugin-statusbar" spec="2.2.1" />
|
||||||
|
<plugin name="cordova-plugin-device" spec="1.1.4" />
|
||||||
|
<plugin name="cordova-plugin-splashscreen" spec="~4.0.1" />
|
||||||
|
<icon src="resources\android\icon\drawable-xhdpi-icon.png" />
|
||||||
|
<plugin name="cordova-plugin-crosswalk-webview" spec="~2.2.0">
|
||||||
|
<variable name="XWALK_VERSION" value="22+" />
|
||||||
|
<variable name="XWALK_LITEVERSION" value="xwalk_core_library_canary:17+" />
|
||||||
|
<variable name="XWALK_COMMANDLINE" value="--disable-pull-to-refresh-effect" />
|
||||||
|
<variable name="XWALK_MODE" value="embedded" />
|
||||||
|
<variable name="XWALK_MULTIPLEAPK" value="true" />
|
||||||
|
</plugin>
|
||||||
|
</widget>
|
||||||
|
BIN
DynamicBibleIonic/res/drawable-land-hdpi/screen.png
Normal file
After Width: | Height: | Size: 48 KiB |
BIN
DynamicBibleIonic/res/drawable-land-ldpi/screen.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
DynamicBibleIonic/res/drawable-land-mdpi/screen.png
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
DynamicBibleIonic/res/drawable-land-xhdpi/screen.png
Normal file
After Width: | Height: | Size: 78 KiB |
BIN
DynamicBibleIonic/res/drawable-land-xxhdpi/screen.png
Normal file
After Width: | Height: | Size: 106 KiB |
BIN
DynamicBibleIonic/res/drawable-land-xxxhdpi/screen.png
Normal file
After Width: | Height: | Size: 132 KiB |
BIN
DynamicBibleIonic/res/drawable-port-hdpi/screen.png
Normal file
After Width: | Height: | Size: 48 KiB |
BIN
DynamicBibleIonic/res/drawable-port-ldpi/screen.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
DynamicBibleIonic/res/drawable-port-mdpi/screen.png
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
DynamicBibleIonic/res/drawable-port-xhdpi/screen.png
Normal file
After Width: | Height: | Size: 81 KiB |
BIN
DynamicBibleIonic/res/drawable-port-xxhdpi/screen.png
Normal file
After Width: | Height: | Size: 105 KiB |
BIN
DynamicBibleIonic/res/drawable-port-xxxhdpi/screen.png
Normal file
After Width: | Height: | Size: 131 KiB |
BIN
DynamicBibleIonic/res/mipmap-hdpi/icon.png
Normal file
After Width: | Height: | Size: 5.0 KiB |
BIN
DynamicBibleIonic/res/mipmap-ldpi/icon.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
DynamicBibleIonic/res/mipmap-mdpi/icon.png
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
DynamicBibleIonic/res/mipmap-xhdpi/icon.png
Normal file
After Width: | Height: | Size: 6.7 KiB |
BIN
DynamicBibleIonic/res/mipmap-xxhdpi/icon.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
DynamicBibleIonic/res/mipmap-xxxhdpi/icon.png
Normal file
After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 5.0 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 6.7 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 48 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 78 KiB |
Before Width: | Height: | Size: 106 KiB After Width: | Height: | Size: 106 KiB |
Before Width: | Height: | Size: 132 KiB After Width: | Height: | Size: 132 KiB |
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 48 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 81 KiB After Width: | Height: | Size: 81 KiB |
Before Width: | Height: | Size: 105 KiB After Width: | Height: | Size: 105 KiB |
Before Width: | Height: | Size: 131 KiB After Width: | Height: | Size: 131 KiB |
@ -13,6 +13,7 @@ import {ComponentLoader} from "../components/component-loader/component-loader.t
|
|||||||
import {Passage} from "../components/passage/passage.ts";
|
import {Passage} from "../components/passage/passage.ts";
|
||||||
import {Strongs} from "../components/strongs/strongs.ts";
|
import {Strongs} from "../components/strongs/strongs.ts";
|
||||||
import {Words} from "../components/words/words.ts";
|
import {Words} from "../components/words/words.ts";
|
||||||
|
import {Error} from "../components/error/error.ts";
|
||||||
import {StrongsModal} from "../components/strongs-modal/strongs-modal.ts";
|
import {StrongsModal} from "../components/strongs-modal/strongs-modal.ts";
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
@ -24,7 +25,8 @@ import {StrongsModal} from "../components/strongs-modal/strongs-modal.ts";
|
|||||||
Passage,
|
Passage,
|
||||||
Strongs,
|
Strongs,
|
||||||
StrongsModal,
|
StrongsModal,
|
||||||
Words
|
Words,
|
||||||
|
Error
|
||||||
],
|
],
|
||||||
imports: [
|
imports: [
|
||||||
IonicModule.forRoot(MyApp),
|
IonicModule.forRoot(MyApp),
|
||||||
@ -38,7 +40,8 @@ import {StrongsModal} from "../components/strongs-modal/strongs-modal.ts";
|
|||||||
Passage,
|
Passage,
|
||||||
Strongs,
|
Strongs,
|
||||||
StrongsModal,
|
StrongsModal,
|
||||||
Words
|
Words,
|
||||||
|
Error
|
||||||
],
|
],
|
||||||
providers: [{ provide: ErrorHandler, useClass: IonicErrorHandler }, Storage]
|
providers: [{ provide: ErrorHandler, useClass: IonicErrorHandler }, Storage]
|
||||||
})
|
})
|
||||||
|
@ -23,7 +23,9 @@ export class BibleService
|
|||||||
this.result = {
|
this.result = {
|
||||||
cs: [],
|
cs: [],
|
||||||
testament: "",
|
testament: "",
|
||||||
ref: ""
|
ref: "",
|
||||||
|
status: 0,
|
||||||
|
msg: ":)"
|
||||||
};
|
};
|
||||||
this.count = Number(section.end.chapter) - Number(section.start.chapter) + 1;
|
this.count = Number(section.end.chapter) - Number(section.start.chapter) + 1;
|
||||||
|
|
||||||
@ -41,11 +43,15 @@ export class BibleService
|
|||||||
},
|
},
|
||||||
error: function (request, status, error)
|
error: function (request, status, error)
|
||||||
{
|
{
|
||||||
console.log(error);
|
self.result.status = -1;
|
||||||
|
self.result.msg = "Unable to retrieve bible passage " + self.result.ref + ".";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (self.result.status == -1)
|
||||||
|
return self.result;
|
||||||
|
|
||||||
for (let j = 0; j < this.chapters.length; j++)
|
for (let j = 0; j < this.chapters.length; j++)
|
||||||
{
|
{
|
||||||
const vss: BibleVerse[] = [];
|
const vss: BibleVerse[] = [];
|
||||||
|
10
DynamicBibleIonic/src/components/error/error.html
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<ion-item class="title error-title" padding>
|
||||||
|
Error
|
||||||
|
<button ion-button icon-only item-right large clear (click)="close()">
|
||||||
|
<ion-icon name="close-circle"></ion-icon>
|
||||||
|
</button>
|
||||||
|
</ion-item>
|
||||||
|
<ion-card-content>
|
||||||
|
<br>
|
||||||
|
<p>{{item}}</p>
|
||||||
|
</ion-card-content>
|
3
DynamicBibleIonic/src/components/error/error.scss
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
.error-title {
|
||||||
|
background-color:#fad0b2;
|
||||||
|
}
|
26
DynamicBibleIonic/src/components/error/error.ts
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
import { EventEmitter, Component, Input, Output } from "@angular/core";
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: "error",
|
||||||
|
templateUrl: "error.html"
|
||||||
|
})
|
||||||
|
export class Error
|
||||||
|
{
|
||||||
|
@Output()
|
||||||
|
onClose = new EventEmitter<CardItem>();
|
||||||
|
|
||||||
|
@Input()
|
||||||
|
item: string;
|
||||||
|
|
||||||
|
@Input()
|
||||||
|
cardItem: CardItem;
|
||||||
|
|
||||||
|
constructor()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
close()
|
||||||
|
{
|
||||||
|
this.onClose.emit(this.cardItem);
|
||||||
|
}
|
||||||
|
}
|
@ -5,11 +5,7 @@
|
|||||||
</button>
|
</button>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
<ion-card-content>
|
<ion-card-content>
|
||||||
<ion-scroll scrollY="true">
|
<ion-scroll scrollY="true" overflow-scroll="true">
|
||||||
<ion-grid>
|
<a class="passage-button" *ngFor="let ref of item.refs" (click)="openPassage(ref)">{{makePassage(ref)}}</a>
|
||||||
<ion-row responsive-sm responsive-md wrap *ngFor="let i of getColumns()">
|
|
||||||
<ion-col width-25 *ngFor="let ref of item.refs | slice:(i*4):(i+1)*4" (click)="openPassage(ref)"><span class="button">{{makePassage(ref)}}</span></ion-col>
|
|
||||||
</ion-row>
|
|
||||||
</ion-grid>
|
|
||||||
</ion-scroll>
|
</ion-scroll>
|
||||||
</ion-card-content>
|
</ion-card-content>
|
@ -1,5 +1,5 @@
|
|||||||
.words-title {
|
.words-title {
|
||||||
background-color:#ffe0e0;
|
background-color:#f5b9f3;
|
||||||
}
|
}
|
||||||
|
|
||||||
words ion-scroll {
|
words ion-scroll {
|
||||||
@ -17,4 +17,55 @@ ion-col .button{
|
|||||||
|
|
||||||
ion-col {
|
ion-col {
|
||||||
margin-bottom: 0px !important;
|
margin-bottom: 0px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (max-width: 499px) {
|
||||||
|
words .passage-button
|
||||||
|
{
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (max-width: 699px) and (min-width: 500px) {
|
||||||
|
words .passage-button
|
||||||
|
{
|
||||||
|
width: 46%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (max-width: 799px) and (min-width: 700px) {
|
||||||
|
words .passage-button
|
||||||
|
{
|
||||||
|
width: 31%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (max-width: 899px) and (min-width: 800px) {
|
||||||
|
words .passage-button
|
||||||
|
{
|
||||||
|
width: 23%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (max-width: 1199px) and (min-width: 900px) {
|
||||||
|
words .passage-button
|
||||||
|
{
|
||||||
|
width: 18%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@media screen and (min-width: 1200px) {
|
||||||
|
words .passage-button
|
||||||
|
{
|
||||||
|
width: 13.5%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
words .passage-button
|
||||||
|
{
|
||||||
|
font-size: 1em;
|
||||||
|
float: left;
|
||||||
|
padding: .5em;
|
||||||
|
background-color: #fceeee;
|
||||||
|
margin: .3em;
|
||||||
|
text-align: center;
|
||||||
}
|
}
|
@ -25,11 +25,6 @@ export class Words {
|
|||||||
this.onClose.emit(this.cardItem);
|
this.onClose.emit(this.cardItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
getColumns()
|
|
||||||
{
|
|
||||||
return Array.from(Array(Math.ceil(this.item.refs.length / 4)).keys())
|
|
||||||
}
|
|
||||||
|
|
||||||
makePassage(p: string)
|
makePassage(p: string)
|
||||||
{
|
{
|
||||||
return Reference.bookName(parseInt(p.split(":")[0])) + ' ' + p.split(":")[1] + ":" + p.split(":")[2];
|
return Reference.bookName(parseInt(p.split(":")[0])) + ' ' + p.split(":")[1] + ":" + p.split(":")[2];
|
||||||
|
@ -1,82 +0,0 @@
|
|||||||
export class ConfigMock
|
|
||||||
{
|
|
||||||
|
|
||||||
public get(): any
|
|
||||||
{
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
public getBoolean(): boolean
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public getNumber(): number
|
|
||||||
{
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export class FormMock
|
|
||||||
{
|
|
||||||
public register(): any
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export class NavMock
|
|
||||||
{
|
|
||||||
|
|
||||||
public pop(): any
|
|
||||||
{
|
|
||||||
return new Promise(function (resolve: Function): void
|
|
||||||
{
|
|
||||||
resolve();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public push(): any
|
|
||||||
{
|
|
||||||
return new Promise(function (resolve: Function): void
|
|
||||||
{
|
|
||||||
resolve();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public getActive(): any
|
|
||||||
{
|
|
||||||
return {
|
|
||||||
'instance': {
|
|
||||||
'model': 'something',
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
public setRoot(): any
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export class PlatformMock
|
|
||||||
{
|
|
||||||
public ready(): any
|
|
||||||
{
|
|
||||||
return new Promise((resolve: Function) =>
|
|
||||||
{
|
|
||||||
resolve();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export class MenuMock
|
|
||||||
{
|
|
||||||
public close(): any
|
|
||||||
{
|
|
||||||
return new Promise((resolve: Function) =>
|
|
||||||
{
|
|
||||||
resolve();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
@ -23,9 +23,10 @@
|
|||||||
</ion-list>-->
|
</ion-list>-->
|
||||||
|
|
||||||
<ion-card *ngFor="let item of userProfile.user.items">
|
<ion-card *ngFor="let item of userProfile.user.items">
|
||||||
|
<error *ngIf="isError(item.type)" [cardItem]="item" [item]="item.data" (onClose)="removeItem($event)"></error>
|
||||||
<passage *ngIf="isPassage(item.type)" [cardItem]="item" [item]="item.data" (onClose)="removeItem($event)" [dict]="item.dict" (onStrongsClicked)="getItemsNextToCard($event)"></passage>
|
<passage *ngIf="isPassage(item.type)" [cardItem]="item" [item]="item.data" (onClose)="removeItem($event)" [dict]="item.dict" (onStrongsClicked)="getItemsNextToCard($event)"></passage>
|
||||||
<strongs *ngIf="isStrongs(item.type)" [cardItem]="item" [item]="item.data" (onClose)="removeItem($event)" (onPassageClicked)="getItemsNextToCard($event)"></strongs>
|
<strongs *ngIf="isStrongs(item.type)" [cardItem]="item" [item]="item.data" (onClose)="removeItem($event)" (onPassageClicked)="getItemsNextToCard($event)"></strongs>
|
||||||
<words *ngIf="isWords(item.type)" [cardItem]="item" [item]="item.data" (onClose)="removeItem($event)" (onPassageClicked)="getItemsNextToCard($event)"></words>
|
<words *ngIf="isWords(item.type)" [cardItem]="item" [item]="item.data" (onClose)="removeItem($event)" (onPassageClicked)="getItemsNextToCard($event)"></words>
|
||||||
<button ion-button icon-left clear small (click)="removeItem(item)">
|
<button ion-button icon-left clear small (click)="removeItem(item)">
|
||||||
<ion-icon name="close-circle"></ion-icon>
|
<ion-icon name="close-circle"></ion-icon>
|
||||||
<div>Close</div>
|
<div>Close</div>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
import {Type, Component} from "@angular/core";
|
import {Type, Component} from "@angular/core";
|
||||||
import {Reference} from "../../Reference";
|
import {Reference} from "../../Reference";
|
||||||
import {BibleService} from "../../bible-service";
|
import {BibleService} from "../../bible-service";
|
||||||
import {LoadingController, ModalController } from "ionic-angular";
|
import {Loading, LoadingController, ModalController } from "ionic-angular";
|
||||||
import {StrongsService} from "../../strongs-service";
|
import {StrongsService} from "../../strongs-service";
|
||||||
import {WordService} from "../../word-service";
|
import {WordService} from "../../word-service";
|
||||||
import {StrongsModal} from "../../components/strongs-modal/strongs-modal.ts";
|
import {StrongsModal} from "../../components/strongs-modal/strongs-modal.ts";
|
||||||
@ -26,6 +26,7 @@ export class SearchPage
|
|||||||
searchQuery: string = "";
|
searchQuery: string = "";
|
||||||
userProfile: UserProfile;
|
userProfile: UserProfile;
|
||||||
last: CardItem;
|
last: CardItem;
|
||||||
|
loader: Loading;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private strongsService: StrongsService
|
private strongsService: StrongsService
|
||||||
@ -52,6 +53,7 @@ export class SearchPage
|
|||||||
{
|
{
|
||||||
console.log(error);
|
console.log(error);
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
initializeItems(u: UserProfile)
|
initializeItems(u: UserProfile)
|
||||||
@ -83,21 +85,23 @@ export class SearchPage
|
|||||||
this.userProfile.save(this.local);
|
this.userProfile.save(this.local);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isError(t: string)
|
||||||
|
{
|
||||||
|
return t === "Error";
|
||||||
|
}
|
||||||
isPassage(t: string)
|
isPassage(t: string)
|
||||||
{
|
{
|
||||||
return t === "Passage";
|
return t === "Passage";
|
||||||
}
|
}
|
||||||
|
|
||||||
isStrongs(t: string)
|
isStrongs(t: string)
|
||||||
{
|
{
|
||||||
return t === "Strongs";
|
return t === "Strongs";
|
||||||
}
|
}
|
||||||
|
|
||||||
isWords(t: string)
|
isWords(t: string)
|
||||||
{
|
{
|
||||||
return t === "Words";
|
return t === "Words";
|
||||||
}
|
}
|
||||||
|
|
||||||
addItemToList(item)
|
addItemToList(item)
|
||||||
{
|
{
|
||||||
if (this.userProfile.user.append_to_bottom)
|
if (this.userProfile.user.append_to_bottom)
|
||||||
@ -129,65 +133,90 @@ export class SearchPage
|
|||||||
this.getItems(data.qry);
|
this.getItems(data.qry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
getItems(search)
|
getItems(search)
|
||||||
{
|
{
|
||||||
try
|
this.loader = this.loadingCtrl.create({
|
||||||
{
|
content: "Looking up query..."
|
||||||
let qs = search.split(";");
|
});
|
||||||
for (let x in qs)
|
this.loader.present().then(
|
||||||
|
() =>
|
||||||
{
|
{
|
||||||
if (qs.hasOwnProperty(x))
|
try
|
||||||
{
|
{
|
||||||
let q = qs[x].trim();
|
let qs = search.split(";");
|
||||||
if (q !== "")
|
for (let x in qs)
|
||||||
{
|
{
|
||||||
// its a search term.
|
if (qs.hasOwnProperty(x))
|
||||||
if (q.search(/[0-9]/i) === -1)
|
|
||||||
{
|
{
|
||||||
let result = this.wordService.getResult(q);
|
let q = qs[x].trim();
|
||||||
this.addItemToList({ data: result, type: "Words", dict: "na" });
|
if (q !== "")
|
||||||
}
|
{
|
||||||
else if (q.search(/(H|G)[0-9]/i) !== -1)
|
// its a search term.
|
||||||
{
|
if (q.search(/[0-9]/i) === -1)
|
||||||
// its a strongs lookup
|
{
|
||||||
let dict = q.substring(0, 1);
|
let result = this.wordService.getResult(q);
|
||||||
|
if (result.status == 0)
|
||||||
|
this.addItemToList({ data: result, type: "Words", dict: "na" });
|
||||||
|
else
|
||||||
|
this.addItemToList({ data: result.msg, type: "Error", dict: "na" });
|
||||||
|
}
|
||||||
|
else if (q.search(/(H|G)[0-9]/i) !== -1)
|
||||||
|
{
|
||||||
|
// its a strongs lookup
|
||||||
|
let dict = q.substring(0, 1);
|
||||||
|
|
||||||
if (dict.search(/h/i) !== -1)
|
if (dict.search(/h/i) !== -1)
|
||||||
{
|
{
|
||||||
dict = "heb";
|
dict = "heb";
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
dict = "grk";
|
dict = "grk";
|
||||||
}
|
}
|
||||||
q = q.substring(1, q.length);
|
q = q.substring(1, q.length);
|
||||||
let result = this.strongsService.getResult(parseInt(q), dict);
|
let result = this.strongsService.getResult(parseInt(q), dict);
|
||||||
if (this.userProfile.user.strongs_modal)
|
if (result.status == -1)
|
||||||
this.presentStrongsModal(result);
|
this.addItemToList({ data: result.msg, type: "Error", dict: "na" });
|
||||||
else
|
else
|
||||||
this.addItemToList({ data: result, type: "Strongs", dict: "na" });
|
{
|
||||||
}
|
if (this.userProfile.user.strongs_modal)
|
||||||
else
|
this.presentStrongsModal(result);
|
||||||
{
|
else
|
||||||
// its a verse reference.
|
this.addItemToList({ data: result, type: "Strongs", dict: "na" });
|
||||||
if (q.trim() !== "")
|
}
|
||||||
{
|
}
|
||||||
let myref = new Reference(q.trim());
|
else
|
||||||
let r = this.bibleService.getResult(myref.Section);
|
{
|
||||||
r.ref = myref.toString();
|
// its a verse reference.
|
||||||
this.addItemToList({ data: r, type: "Passage", dict: r.testament == 'new' ? "G" : "H" });
|
if (q.trim() !== "")
|
||||||
|
{
|
||||||
|
let myref = new Reference(q.trim());
|
||||||
|
let r = this.bibleService.getResult(myref.Section);
|
||||||
|
r.ref = myref.toString();
|
||||||
|
if (r.status == 0)
|
||||||
|
this.addItemToList({ data: r, type: "Passage", dict: r.testament == 'new' ? "G" : "H" });
|
||||||
|
else
|
||||||
|
this.addItemToList({ data: r.msg, type: "Error", dict: "na" });
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (this.userProfile.user.clear_search_after_query)
|
||||||
|
$(".searchbar-input").val("");
|
||||||
|
|
||||||
|
this.userProfile.save(this.local);
|
||||||
|
}
|
||||||
|
catch (error)
|
||||||
|
{
|
||||||
|
this.addItemToList({ data: error, type: "Error", dict: "na" });
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
this.loader.dismiss();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this.userProfile.user.clear_search_after_query)
|
);
|
||||||
$(".searchbar-input").val("");
|
|
||||||
|
|
||||||
this.userProfile.save(this.local);
|
|
||||||
}
|
|
||||||
catch (error)
|
|
||||||
{
|
|
||||||
console.log(error);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,19 +0,0 @@
|
|||||||
// This file includes polyfills needed by Angular 2 and is loaded before
|
|
||||||
// the app. You can add your own extra polyfills to this file.
|
|
||||||
import 'core-js/es6/symbol';
|
|
||||||
import 'core-js/es6/object';
|
|
||||||
import 'core-js/es6/function';
|
|
||||||
import 'core-js/es6/parse-int';
|
|
||||||
import 'core-js/es6/parse-float';
|
|
||||||
import 'core-js/es6/number';
|
|
||||||
import 'core-js/es6/math';
|
|
||||||
import 'core-js/es6/string';
|
|
||||||
import 'core-js/es6/date';
|
|
||||||
import 'core-js/es6/array';
|
|
||||||
import 'core-js/es6/regexp';
|
|
||||||
import 'core-js/es6/map';
|
|
||||||
import 'core-js/es6/set';
|
|
||||||
import 'core-js/es6/reflect';
|
|
||||||
|
|
||||||
import 'core-js/es7/reflect';
|
|
||||||
import 'zone.js/dist/zone';
|
|
@ -23,20 +23,33 @@ export class StrongsService
|
|||||||
def: null,
|
def: null,
|
||||||
rmac: null,
|
rmac: null,
|
||||||
crossrefs: null,
|
crossrefs: null,
|
||||||
rmaccode: ""
|
rmaccode: "",
|
||||||
|
status: 0,
|
||||||
|
msg: ":)"
|
||||||
};
|
};
|
||||||
let url = dict + Math.ceil(sn / 100) + ".json";
|
let url = dict + Math.ceil(sn / 100) + ".json";
|
||||||
if (dict === "grk")
|
if (dict === "grk")
|
||||||
{
|
{
|
||||||
self.result.prefix = "G";
|
self.result.prefix = "G";
|
||||||
if (sn > 5624) return this.result;
|
if (sn > 5624 || sn < 1)
|
||||||
|
{
|
||||||
|
self.result.status = -1;
|
||||||
|
self.result.msg = "Strongs Number G" + sn + " is out of range.";
|
||||||
|
}
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
self.result.prefix = "H";
|
self.result.prefix = "H";
|
||||||
if (sn > 8674) return this.result;
|
if (sn > 8674 || sn < 1)
|
||||||
|
{
|
||||||
|
self.result.status = -1;
|
||||||
|
self.result.msg = "Strongs Number H" + sn + " is out of range.";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.result.sn = sn;
|
this.result.sn = sn;
|
||||||
|
|
||||||
|
if (self.result.status == -1)
|
||||||
|
return self.result;
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
async: false,
|
async: false,
|
||||||
type: "GET",
|
type: "GET",
|
||||||
@ -49,9 +62,14 @@ export class StrongsService
|
|||||||
error: function (request, status, error)
|
error: function (request, status, error)
|
||||||
{
|
{
|
||||||
console.log(error);
|
console.log(error);
|
||||||
|
self.result.status = -1;
|
||||||
|
self.result.msg = "Unable to retrieve Strongs Data for " + self.result.prefix + self.result.sn;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (self.result.status === -1)
|
||||||
|
return self.result;
|
||||||
|
|
||||||
self.result.def = self.result.strongs.find(el => (el.i === this.result.prefix + this.result.sn));
|
self.result.def = self.result.strongs.find(el => (el.i === this.result.prefix + this.result.sn));
|
||||||
self.result.strongs = [];
|
self.result.strongs = [];
|
||||||
|
|
||||||
@ -74,9 +92,14 @@ export class StrongsService
|
|||||||
error: function (request, status, error)
|
error: function (request, status, error)
|
||||||
{
|
{
|
||||||
console.log(error);
|
console.log(error);
|
||||||
|
self.result.status = -1;
|
||||||
|
self.result.msg = "Unable to retrieve Strongs Cross References for " + self.result.prefix + self.result.sn;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (self.result.status === -1)
|
||||||
|
return self.result;
|
||||||
|
|
||||||
if (dict === "grk")
|
if (dict === "grk")
|
||||||
{
|
{
|
||||||
url = `data/rmac/rs${Math.ceil(sn / 1000)}.json`;
|
url = `data/rmac/rs${Math.ceil(sn / 1000)}.json`;
|
||||||
|
@ -6,10 +6,9 @@
|
|||||||
type WordLookupResult = {
|
type WordLookupResult = {
|
||||||
refs: string[],
|
refs: string[],
|
||||||
word: string,
|
word: string,
|
||||||
status: Status,
|
status: number,
|
||||||
msg: string
|
msg: string
|
||||||
}
|
}
|
||||||
enum Status { Success, Failure };
|
|
||||||
|
|
||||||
type IndexResult = {
|
type IndexResult = {
|
||||||
refs: string[];
|
refs: string[];
|
||||||
@ -43,7 +42,9 @@ type BibleVerse = {
|
|||||||
type BiblePassageResult = {
|
type BiblePassageResult = {
|
||||||
cs: BiblePassage[],
|
cs: BiblePassage[],
|
||||||
testament: string,
|
testament: string,
|
||||||
ref: string
|
ref: string,
|
||||||
|
status: number,
|
||||||
|
msg: string
|
||||||
}
|
}
|
||||||
|
|
||||||
type StrongsDefinition = { n: number, i: string, tr: string, de: string, lemma: string, p: string }
|
type StrongsDefinition = { n: number, i: string, tr: string, de: string, lemma: string, p: string }
|
||||||
@ -72,6 +73,8 @@ type StrongsResult =
|
|||||||
rmac: RMACDefinition,
|
rmac: RMACDefinition,
|
||||||
crossrefs: StrongsCrossReference,
|
crossrefs: StrongsCrossReference,
|
||||||
rmaccode: string,
|
rmaccode: string,
|
||||||
|
status: number,
|
||||||
|
msg: string
|
||||||
};
|
};
|
||||||
|
|
||||||
type Section = {
|
type Section = {
|
||||||
|
@ -47,24 +47,22 @@ export class WordService
|
|||||||
|
|
||||||
// Now we need to test results. If there is more than one item in the array, we need to find the set
|
// Now we need to test results. If there is more than one item in the array, we need to find the set
|
||||||
// that is shared by all of them. IF not, we can just return those refs.
|
// that is shared by all of them. IF not, we can just return those refs.
|
||||||
if (results.length == 0)
|
if (results.length == 0 || results == null || results == undefined)
|
||||||
{
|
{
|
||||||
return { word: qry, refs: null, status: 1, msg: ":)" };
|
return { word: qry, refs: null, status: -1, msg: "No passages found for query: " + qry + "." };
|
||||||
}
|
|
||||||
else if (results.length == 1)
|
|
||||||
{
|
|
||||||
let temp = { word: qry, refs: results[0], status: 0, msg: ":)" };
|
|
||||||
return temp;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let shared: string[];
|
||||||
|
if (results.length == 1)
|
||||||
|
shared = results[0];
|
||||||
else
|
else
|
||||||
|
shared = this.findSharedSet(results);
|
||||||
|
|
||||||
|
if (shared == null || shared == undefined || shared.length == 0)
|
||||||
{
|
{
|
||||||
let shared = this.findSharedSet(results);
|
return { word: qry, refs: null, status: -1, msg: "No passages found for query: " + qry + "." };
|
||||||
if (shared == null)
|
|
||||||
{
|
|
||||||
return { word: qry, refs: null, status: 1, msg: "No passages found." };
|
|
||||||
}
|
|
||||||
return { word: qry, refs: shared[0], status: 0, msg: ":)" };
|
|
||||||
}
|
}
|
||||||
|
return { word: qry, refs: shared, status: 0, msg: ":)" };
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|