mirror of
https://gitlab.com/walljm/dynamicbible.git
synced 2025-07-27 01:19:52 -04:00
TESTS: moar tests...
This commit is contained in:
parent
edf6475e6a
commit
7ce775059f
@ -36,3 +36,4 @@ DynamicBibleIonic/platforms/android/build.gradle
|
|||||||
DynamicBibleIonic/platforms/android/android.json
|
DynamicBibleIonic/platforms/android/android.json
|
||||||
DynamicBibleIonic/platforms/android/AndroidManifest.xml
|
DynamicBibleIonic/platforms/android/AndroidManifest.xml
|
||||||
DynamicBibleIonic/platforms/android/.gitignore
|
DynamicBibleIonic/platforms/android/.gitignore
|
||||||
|
DynamicBibleIonic/.idea
|
||||||
|
@ -1,290 +1,292 @@
|
|||||||
import { Reference } from './Reference';
|
import { Reference } from './Reference';
|
||||||
|
|
||||||
describe('Reference', () => {
|
describe('Reference', () => {
|
||||||
|
|
||||||
it('Should parse the reference: Gen 1:1', () => {
|
it('Should parse the reference: Gen 1:1', () => {
|
||||||
let ref = new Reference("Gen 1:1").toString();
|
let ref = new Reference("Gen 1:1").toString();
|
||||||
expect(ref).toBe('Genesis 1:1');
|
expect(ref).toBe('Genesis 1:1');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Should parse the reference: Gen 1:1-11', () => {
|
it('Should parse the reference: Gen 1:1-11', () => {
|
||||||
let ref = new Reference("Gen 1:1-11").toString();
|
let ref = new Reference("Gen 1:1-11").toString();
|
||||||
expect(ref).toBe('Genesis 1:1 - 11');
|
expect(ref).toBe('Genesis 1:1 - 11');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Should parse the reference: Gen 1-2', () => {
|
it('Should parse the reference: Gen 1-2', () => {
|
||||||
let ref = new Reference("Gen 1-2").toString();
|
let ref = new Reference("Gen 1-2").toString();
|
||||||
expect(ref).toBe('Genesis 1:1 - 2:*');
|
expect(ref).toBe('Genesis 1:1 - 2:*');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Should parse the reference: John 3:16', () => {
|
it('Should parse the reference: John 3:16', () => {
|
||||||
let ref = new Reference("John 3:16").toString();
|
let ref = new Reference("John 3:16").toString();
|
||||||
expect(ref).toBe('John 3:16');
|
expect(ref).toBe('John 3:16');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Should parse the reference: John 3-6', () => {
|
it('Should parse the reference: John 3-6', () => {
|
||||||
let ref = new Reference("Jn 3-6").toString();
|
let ref = new Reference("Jn 3-6").toString();
|
||||||
expect(ref).toBe('John 3:1 - 6:*');
|
expect(ref).toBe('John 3:1 - 6:*');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Should parse the reference: 1 Corinthians 3:5-6:5', () => {
|
it('Should parse the reference: 1 Corinthians 3:5-6:5', () => {
|
||||||
let ref = new Reference("1 Corinthians 3:5-6:5").toString();
|
let ref = new Reference("1 Corinthians 3:5-6:5").toString();
|
||||||
expect(ref).toBe('1 Corinthians 3:5 - 6:5');
|
expect(ref).toBe('1 Corinthians 3:5 - 6:5');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Should parse the reference: 2 Samuel 5:5-6:5', () => {
|
it('Should parse the reference: 2 Samuel 5:5-6:5', () => {
|
||||||
expect(new Reference("II sam 5:5-6:5").toString()).toBe('2 Samuel 5:5 - 6:5');
|
expect(new Reference("II sam 5:5-6:5").toString()).toBe('2 Samuel 5:5 - 6:5');
|
||||||
});
|
});
|
||||||
|
|
||||||
let booknames = [
|
let booknames = [
|
||||||
{ "abbr": "gen", "actual": "Genesis" },
|
{ "abbr": "gen", "actual": "Genesis" },
|
||||||
{ "abbr": "ge", "actual": "Genesis" },
|
{ "abbr": "ge", "actual": "Genesis" },
|
||||||
{ "abbr": "genesis", "actual": "Genesis" },
|
{ "abbr": "genesis", "actual": "Genesis" },
|
||||||
{ "abbr": "gn", "actual": "Genesis" },
|
{ "abbr": "gn", "actual": "Genesis" },
|
||||||
{ "abbr": "exodus", "actual": "Exodus" },
|
{ "abbr": "exodus", "actual": "Exodus" },
|
||||||
{ "abbr": "ex", "actual": "Exodus" },
|
{ "abbr": "ex", "actual": "Exodus" },
|
||||||
{ "abbr": "exo", "actual": "Exodus" },
|
{ "abbr": "exo", "actual": "Exodus" },
|
||||||
{ "abbr": "exod", "actual": "Exodus" },
|
{ "abbr": "exod", "actual": "Exodus" },
|
||||||
{ "abbr": "exd", "actual": "Exodus" },
|
{ "abbr": "exd", "actual": "Exodus" },
|
||||||
{ "abbr": "leviticus", "actual": "Leviticus" },
|
{ "abbr": "leviticus", "actual": "Leviticus" },
|
||||||
{ "abbr": "lev", "actual": "Leviticus" },
|
{ "abbr": "lev", "actual": "Leviticus" },
|
||||||
{ "abbr": "le", "actual": "Leviticus" },
|
{ "abbr": "le", "actual": "Leviticus" },
|
||||||
{ "abbr": "levi", "actual": "Leviticus" },
|
{ "abbr": "levi", "actual": "Leviticus" },
|
||||||
{ "abbr": "lv", "actual": "Leviticus" },
|
{ "abbr": "lv", "actual": "Leviticus" },
|
||||||
{ "abbr": "numbers", "actual": "Numbers" },
|
{ "abbr": "numbers", "actual": "Numbers" },
|
||||||
{ "abbr": "num", "actual": "Numbers" },
|
{ "abbr": "num", "actual": "Numbers" },
|
||||||
{ "abbr": "nu", "actual": "Numbers" },
|
{ "abbr": "nu", "actual": "Numbers" },
|
||||||
{ "abbr": "numb", "actual": "Numbers" },
|
{ "abbr": "numb", "actual": "Numbers" },
|
||||||
{ "abbr": "number", "actual": "Numbers" },
|
{ "abbr": "number", "actual": "Numbers" },
|
||||||
{ "abbr": "deuteronomy", "actual": "Deuteronomy" },
|
{ "abbr": "deuteronomy", "actual": "Deuteronomy" },
|
||||||
{ "abbr": "deut", "actual": "Deuteronomy" },
|
{ "abbr": "deut", "actual": "Deuteronomy" },
|
||||||
{ "abbr": "de", "actual": "Deuteronomy" },
|
{ "abbr": "de", "actual": "Deuteronomy" },
|
||||||
{ "abbr": "dt", "actual": "Deuteronomy" },
|
{ "abbr": "dt", "actual": "Deuteronomy" },
|
||||||
{ "abbr": "deu", "actual": "Deuteronomy" },
|
{ "abbr": "deu", "actual": "Deuteronomy" },
|
||||||
{ "abbr": "joshua", "actual": "Joshua" },
|
{ "abbr": "joshua", "actual": "Joshua" },
|
||||||
{ "abbr": "josh", "actual": "Joshua" },
|
{ "abbr": "josh", "actual": "Joshua" },
|
||||||
{ "abbr": "jos", "actual": "Joshua" },
|
{ "abbr": "jos", "actual": "Joshua" },
|
||||||
{ "abbr": "judges", "actual": "Judges" },
|
{ "abbr": "judges", "actual": "Judges" },
|
||||||
{ "abbr": "jud", "actual": "Judges" },
|
{ "abbr": "jud", "actual": "Judges" },
|
||||||
{ "abbr": "jdg", "actual": "Judges" },
|
{ "abbr": "jdg", "actual": "Judges" },
|
||||||
{ "abbr": "judg", "actual": "Judges" },
|
{ "abbr": "judg", "actual": "Judges" },
|
||||||
{ "abbr": "ruth", "actual": "Ruth" },
|
{ "abbr": "ruth", "actual": "Ruth" },
|
||||||
{ "abbr": "ru", "actual": "Ruth" },
|
{ "abbr": "ru", "actual": "Ruth" },
|
||||||
{ "abbr": "1 samuel", "actual": "1 Samuel" },
|
{ "abbr": "1 samuel", "actual": "1 Samuel" },
|
||||||
{ "abbr": "1 sa", "actual": "1 Samuel" },
|
{ "abbr": "1 sa", "actual": "1 Samuel" },
|
||||||
{ "abbr": "1 sam", "actual": "1 Samuel" },
|
{ "abbr": "1 sam", "actual": "1 Samuel" },
|
||||||
{ "abbr": "1 sml", "actual": "1 Samuel" },
|
{ "abbr": "1 sml", "actual": "1 Samuel" },
|
||||||
{ "abbr": "i samuel", "actual": "1 Samuel" },
|
{ "abbr": "i samuel", "actual": "1 Samuel" },
|
||||||
{ "abbr": "i sa", "actual": "1 Samuel" },
|
{ "abbr": "i sa", "actual": "1 Samuel" },
|
||||||
{ "abbr": "i sam", "actual": "1 Samuel" },
|
{ "abbr": "i sam", "actual": "1 Samuel" },
|
||||||
{ "abbr": "i sml", "actual": "1 Samuel" },
|
{ "abbr": "i sml", "actual": "1 Samuel" },
|
||||||
{ "abbr": "1st samuel", "actual": "1 Samuel" },
|
{ "abbr": "1st samuel", "actual": "1 Samuel" },
|
||||||
{ "abbr": "1st sa", "actual": "1 Samuel" },
|
{ "abbr": "1st sa", "actual": "1 Samuel" },
|
||||||
{ "abbr": "1st sam", "actual": "1 Samuel" },
|
{ "abbr": "1st sam", "actual": "1 Samuel" },
|
||||||
{ "abbr": "1st sml", "actual": "1 Samuel" },
|
{ "abbr": "1st sml", "actual": "1 Samuel" },
|
||||||
{ "abbr": "first samuel", "actual": "1 Samuel" },
|
{ "abbr": "first samuel", "actual": "1 Samuel" },
|
||||||
{ "abbr": "first sa", "actual": "1 Samuel" },
|
{ "abbr": "first sa", "actual": "1 Samuel" },
|
||||||
{ "abbr": "first sam", "actual": "1 Samuel" },
|
{ "abbr": "first sam", "actual": "1 Samuel" },
|
||||||
{ "abbr": "first sml", "actual": "1 Samuel" },
|
{ "abbr": "first sml", "actual": "1 Samuel" },
|
||||||
{ "abbr": "2 samuel", "actual": "2 Samuel" },
|
{ "abbr": "2 samuel", "actual": "2 Samuel" },
|
||||||
{ "abbr": "2 sa", "actual": "2 Samuel" },
|
{ "abbr": "2 sa", "actual": "2 Samuel" },
|
||||||
{ "abbr": "2 sam", "actual": "2 Samuel" },
|
{ "abbr": "2 sam", "actual": "2 Samuel" },
|
||||||
{ "abbr": "2 sml", "actual": "2 Samuel" },
|
{ "abbr": "2 sml", "actual": "2 Samuel" },
|
||||||
{ "abbr": "ii samuel", "actual": "2 Samuel" },
|
{ "abbr": "ii samuel", "actual": "2 Samuel" },
|
||||||
{ "abbr": "ii sa", "actual": "2 Samuel" },
|
{ "abbr": "ii sa", "actual": "2 Samuel" },
|
||||||
{ "abbr": "ii sam", "actual": "2 Samuel" },
|
{ "abbr": "ii sam", "actual": "2 Samuel" },
|
||||||
{ "abbr": "ii sml", "actual": "2 Samuel" },
|
{ "abbr": "ii sml", "actual": "2 Samuel" },
|
||||||
{ "abbr": "2nd samuel", "actual": "2 Samuel" },
|
{ "abbr": "2nd samuel", "actual": "2 Samuel" },
|
||||||
{ "abbr": "2nd sa", "actual": "2 Samuel" },
|
{ "abbr": "2nd sa", "actual": "2 Samuel" },
|
||||||
{ "abbr": "2nd sam", "actual": "2 Samuel" },
|
{ "abbr": "2nd sam", "actual": "2 Samuel" },
|
||||||
{ "abbr": "2nd sml", "actual": "2 Samuel" },
|
{ "abbr": "2nd sml", "actual": "2 Samuel" },
|
||||||
{ "abbr": "second samuel", "actual": "2 Samuel" },
|
{ "abbr": "second samuel", "actual": "2 Samuel" },
|
||||||
{ "abbr": "second sa", "actual": "2 Samuel" },
|
{ "abbr": "second sa", "actual": "2 Samuel" },
|
||||||
{ "abbr": "second sam", "actual": "2 Samuel" },
|
{ "abbr": "second sam", "actual": "2 Samuel" },
|
||||||
{ "abbr": "second sml", "actual": "2 Samuel" },
|
{ "abbr": "second sml", "actual": "2 Samuel" },
|
||||||
{ "abbr": "sec samuel", "actual": "2 Samuel" },
|
{ "abbr": "sec samuel", "actual": "2 Samuel" },
|
||||||
{ "abbr": "sec sa", "actual": "2 Samuel" },
|
{ "abbr": "sec sa", "actual": "2 Samuel" },
|
||||||
{ "abbr": "sec sam", "actual": "2 Samuel" },
|
{ "abbr": "sec sam", "actual": "2 Samuel" },
|
||||||
{ "abbr": "sec sml", "actual": "2 Samuel" },
|
{ "abbr": "sec sml", "actual": "2 Samuel" },
|
||||||
{ "abbr": "1 kings", "actual": "1 Kings" },
|
{ "abbr": "1 kings", "actual": "1 Kings" },
|
||||||
{ "abbr": "1 king", "actual": "1 Kings" },
|
{ "abbr": "1 king", "actual": "1 Kings" },
|
||||||
{ "abbr": "1 kgs", "actual": "1 Kings" },
|
{ "abbr": "1 kgs", "actual": "1 Kings" },
|
||||||
{ "abbr": "1 kn", "actual": "1 Kings" },
|
{ "abbr": "1 kn", "actual": "1 Kings" },
|
||||||
{ "abbr": "1 k", "actual": "1 Kings" },
|
{ "abbr": "1 k", "actual": "1 Kings" },
|
||||||
{ "abbr": "1 ki", "actual": "1 Kings" },
|
{ "abbr": "1 ki", "actual": "1 Kings" },
|
||||||
{ "abbr": "i kings", "actual": "1 Kings" },
|
{ "abbr": "i kings", "actual": "1 Kings" },
|
||||||
{ "abbr": "i king", "actual": "1 Kings" },
|
{ "abbr": "i king", "actual": "1 Kings" },
|
||||||
{ "abbr": "i kgs", "actual": "1 Kings" },
|
{ "abbr": "i kgs", "actual": "1 Kings" },
|
||||||
{ "abbr": "i kn", "actual": "1 Kings" },
|
{ "abbr": "i kn", "actual": "1 Kings" },
|
||||||
{ "abbr": "i k", "actual": "1 Kings" },
|
{ "abbr": "i k", "actual": "1 Kings" },
|
||||||
{ "abbr": "i ki", "actual": "1 Kings" },
|
{ "abbr": "i ki", "actual": "1 Kings" },
|
||||||
{ "abbr": "1st kings", "actual": "1 Kings" },
|
{ "abbr": "1st kings", "actual": "1 Kings" },
|
||||||
{ "abbr": "1st king", "actual": "1 Kings" },
|
{ "abbr": "1st king", "actual": "1 Kings" },
|
||||||
{ "abbr": "1st kgs", "actual": "1 Kings" },
|
{ "abbr": "1st kgs", "actual": "1 Kings" },
|
||||||
{ "abbr": "1st kn", "actual": "1 Kings" },
|
{ "abbr": "1st kn", "actual": "1 Kings" },
|
||||||
{ "abbr": "1st k", "actual": "1 Kings" },
|
{ "abbr": "1st k", "actual": "1 Kings" },
|
||||||
{ "abbr": "1st ki", "actual": "1 Kings" },
|
{ "abbr": "1st ki", "actual": "1 Kings" },
|
||||||
{ "abbr": "first kings", "actual": "1 Kings" },
|
{ "abbr": "first kings", "actual": "1 Kings" },
|
||||||
{ "abbr": "first king", "actual": "1 Kings" },
|
{ "abbr": "first king", "actual": "1 Kings" },
|
||||||
{ "abbr": "first kgs", "actual": "1 Kings" },
|
{ "abbr": "first kgs", "actual": "1 Kings" },
|
||||||
{ "abbr": "first kn", "actual": "1 Kings" },
|
{ "abbr": "first kn", "actual": "1 Kings" },
|
||||||
{ "abbr": "first k", "actual": "1 Kings" },
|
{ "abbr": "first k", "actual": "1 Kings" },
|
||||||
{ "abbr": "first ki", "actual": "1 Kings" },
|
{ "abbr": "first ki", "actual": "1 Kings" },
|
||||||
{ "abbr": "2 Kings", "actual": "2 Kings" },
|
{ "abbr": "2 Kings", "actual": "2 Kings" },
|
||||||
{ "abbr": "2 king", "actual": "2 Kings" },
|
{ "abbr": "2 king", "actual": "2 Kings" },
|
||||||
{ "abbr": "2 kgs", "actual": "2 Kings" },
|
{ "abbr": "2 kgs", "actual": "2 Kings" },
|
||||||
{ "abbr": "2 kn", "actual": "2 Kings" },
|
{ "abbr": "2 kn", "actual": "2 Kings" },
|
||||||
{ "abbr": "2 k", "actual": "2 Kings" },
|
{ "abbr": "2 k", "actual": "2 Kings" },
|
||||||
{ "abbr": "2 ki", "actual": "2 Kings" },
|
{ "abbr": "2 ki", "actual": "2 Kings" },
|
||||||
{ "abbr": "ii kings", "actual": "2 Kings" },
|
{ "abbr": "ii kings", "actual": "2 Kings" },
|
||||||
{ "abbr": "ii king", "actual": "2 Kings" },
|
{ "abbr": "ii king", "actual": "2 Kings" },
|
||||||
{ "abbr": "ii kgs", "actual": "2 Kings" },
|
{ "abbr": "ii kgs", "actual": "2 Kings" },
|
||||||
{ "abbr": "ii kn", "actual": "2 Kings" },
|
{ "abbr": "ii kn", "actual": "2 Kings" },
|
||||||
{ "abbr": "ii k", "actual": "2 Kings" },
|
{ "abbr": "ii k", "actual": "2 Kings" },
|
||||||
{ "abbr": "ii ki", "actual": "2 Kings" },
|
{ "abbr": "ii ki", "actual": "2 Kings" },
|
||||||
{ "abbr": "2nd kings", "actual": "2 Kings" },
|
{ "abbr": "2nd kings", "actual": "2 Kings" },
|
||||||
{ "abbr": "2nd king", "actual": "2 Kings" },
|
{ "abbr": "2nd king", "actual": "2 Kings" },
|
||||||
{ "abbr": "2nd kgs", "actual": "2 Kings" },
|
{ "abbr": "2nd kgs", "actual": "2 Kings" },
|
||||||
{ "abbr": "2nd kn", "actual": "2 Kings" },
|
{ "abbr": "2nd kn", "actual": "2 Kings" },
|
||||||
{ "abbr": "2nd k", "actual": "2 Kings" },
|
{ "abbr": "2nd k", "actual": "2 Kings" },
|
||||||
{ "abbr": "2nd ki", "actual": "2 Kings" },
|
{ "abbr": "2nd ki", "actual": "2 Kings" },
|
||||||
{ "abbr": "second kings", "actual": "2 Kings" },
|
{ "abbr": "second kings", "actual": "2 Kings" },
|
||||||
{ "abbr": "second king", "actual": "2 Kings" },
|
{ "abbr": "second king", "actual": "2 Kings" },
|
||||||
{ "abbr": "second kgs", "actual": "2 Kings" },
|
{ "abbr": "second kgs", "actual": "2 Kings" },
|
||||||
{ "abbr": "second kn", "actual": "2 Kings" },
|
{ "abbr": "second kn", "actual": "2 Kings" },
|
||||||
{ "abbr": "second k", "actual": "2 Kings" },
|
{ "abbr": "second k", "actual": "2 Kings" },
|
||||||
{ "abbr": "second ki", "actual": "2 Kings" },
|
{ "abbr": "second ki", "actual": "2 Kings" },
|
||||||
{ "abbr": "sec kings", "actual": "2 Kings" },
|
{ "abbr": "sec kings", "actual": "2 Kings" },
|
||||||
{ "abbr": "sec king", "actual": "2 Kings" },
|
{ "abbr": "sec king", "actual": "2 Kings" },
|
||||||
{ "abbr": "sec kgs", "actual": "2 Kings" },
|
{ "abbr": "sec kgs", "actual": "2 Kings" },
|
||||||
{ "abbr": "sec kn", "actual": "2 Kings" },
|
{ "abbr": "sec kn", "actual": "2 Kings" },
|
||||||
{ "abbr": "sec k", "actual": "2 Kings" },
|
{ "abbr": "sec k", "actual": "2 Kings" },
|
||||||
{ "abbr": "sec ki", "actual": "2 Kings" },
|
{ "abbr": "sec ki", "actual": "2 Kings" },
|
||||||
{ "abbr": "2 Chronicles", "actual": "2 Chronicles" },
|
{ "abbr": "2 Chronicles", "actual": "2 Chronicles" },
|
||||||
{ "abbr": "2 chronicles", "actual": "2 Chronicles" },
|
{ "abbr": "2 chronicles", "actual": "2 Chronicles" },
|
||||||
{ "abbr": "2 chron", "actual": "2 Chronicles" },
|
{ "abbr": "2 chron", "actual": "2 Chronicles" },
|
||||||
{ "abbr": "2 ch", "actual": "2 Chronicles" },
|
{ "abbr": "2 ch", "actual": "2 Chronicles" },
|
||||||
{ "abbr": "2 chr", "actual": "2 Chronicles" },
|
{ "abbr": "2 chr", "actual": "2 Chronicles" },
|
||||||
{ "abbr": "ii Chronicles", "actual": "2 Chronicles" },
|
{ "abbr": "ii Chronicles", "actual": "2 Chronicles" },
|
||||||
{ "abbr": "ii chronicles", "actual": "2 Chronicles" },
|
{ "abbr": "ii chronicles", "actual": "2 Chronicles" },
|
||||||
{ "abbr": "ii chron", "actual": "2 Chronicles" },
|
{ "abbr": "ii chron", "actual": "2 Chronicles" },
|
||||||
{ "abbr": "ii ch", "actual": "2 Chronicles" },
|
{ "abbr": "ii ch", "actual": "2 Chronicles" },
|
||||||
{ "abbr": "ii chr", "actual": "2 Chronicles" },
|
{ "abbr": "ii chr", "actual": "2 Chronicles" },
|
||||||
{ "abbr": "2nd Chronicles", "actual": "2 Chronicles" },
|
{ "abbr": "2nd Chronicles", "actual": "2 Chronicles" },
|
||||||
{ "abbr": "2nd chronicles", "actual": "2 Chronicles" },
|
{ "abbr": "2nd chronicles", "actual": "2 Chronicles" },
|
||||||
{ "abbr": "2nd chron", "actual": "2 Chronicles" },
|
{ "abbr": "2nd chron", "actual": "2 Chronicles" },
|
||||||
{ "abbr": "2nd ch", "actual": "2 Chronicles" },
|
{ "abbr": "2nd ch", "actual": "2 Chronicles" },
|
||||||
{ "abbr": "2nd chr", "actual": "2 Chronicles" },
|
{ "abbr": "2nd chr", "actual": "2 Chronicles" },
|
||||||
{ "abbr": "second Chronicles", "actual": "2 Chronicles" },
|
{ "abbr": "second Chronicles", "actual": "2 Chronicles" },
|
||||||
{ "abbr": "second chronicles", "actual": "2 Chronicles" },
|
{ "abbr": "second chronicles", "actual": "2 Chronicles" },
|
||||||
{ "abbr": "second chron", "actual": "2 Chronicles" },
|
{ "abbr": "second chron", "actual": "2 Chronicles" },
|
||||||
{ "abbr": "second ch", "actual": "2 Chronicles" },
|
{ "abbr": "second ch", "actual": "2 Chronicles" },
|
||||||
{ "abbr": "second chr", "actual": "2 Chronicles" },
|
{ "abbr": "second chr", "actual": "2 Chronicles" },
|
||||||
{ "abbr": "sec Chronicles", "actual": "2 Chronicles" },
|
{ "abbr": "sec Chronicles", "actual": "2 Chronicles" },
|
||||||
{ "abbr": "sec chronicles", "actual": "2 Chronicles" },
|
{ "abbr": "sec chronicles", "actual": "2 Chronicles" },
|
||||||
{ "abbr": "sec chron", "actual": "2 Chronicles" },
|
{ "abbr": "sec chron", "actual": "2 Chronicles" },
|
||||||
{ "abbr": "sec ch", "actual": "2 Chronicles" },
|
{ "abbr": "sec ch", "actual": "2 Chronicles" },
|
||||||
{ "abbr": "sec chr", "actual": "2 Chronicles" },
|
{ "abbr": "sec chr", "actual": "2 Chronicles" },
|
||||||
{ "abbr": "1 Chronicles", "actual": "1 Chronicles" },
|
{ "abbr": "1 Chronicles", "actual": "1 Chronicles" },
|
||||||
{ "abbr": "1 chronicles", "actual": "1 Chronicles" },
|
{ "abbr": "1 chronicles", "actual": "1 Chronicles" },
|
||||||
{ "abbr": "1 chron", "actual": "1 Chronicles" },
|
{ "abbr": "1 chron", "actual": "1 Chronicles" },
|
||||||
{ "abbr": "1 ch", "actual": "1 Chronicles" },
|
{ "abbr": "1 ch", "actual": "1 Chronicles" },
|
||||||
{ "abbr": "1 chr", "actual": "1 Chronicles" },
|
{ "abbr": "1 chr", "actual": "1 Chronicles" },
|
||||||
{ "abbr": "i Chronicles", "actual": "1 Chronicles" },
|
{ "abbr": "i Chronicles", "actual": "1 Chronicles" },
|
||||||
{ "abbr": "i chronicles", "actual": "1 Chronicles" },
|
{ "abbr": "i chronicles", "actual": "1 Chronicles" },
|
||||||
{ "abbr": "i chron", "actual": "1 Chronicles" },
|
{ "abbr": "i chron", "actual": "1 Chronicles" },
|
||||||
{ "abbr": "i ch", "actual": "1 Chronicles" },
|
{ "abbr": "i ch", "actual": "1 Chronicles" },
|
||||||
{ "abbr": "i chr", "actual": "1 Chronicles" },
|
{ "abbr": "i chr", "actual": "1 Chronicles" },
|
||||||
{ "abbr": "1st Chronicles", "actual": "1 Chronicles" },
|
{ "abbr": "1st Chronicles", "actual": "1 Chronicles" },
|
||||||
{ "abbr": "1st chronicles", "actual": "1 Chronicles" },
|
{ "abbr": "1st chronicles", "actual": "1 Chronicles" },
|
||||||
{ "abbr": "1st chron", "actual": "1 Chronicles" },
|
{ "abbr": "1st chron", "actual": "1 Chronicles" },
|
||||||
{ "abbr": "1st ch", "actual": "1 Chronicles" },
|
{ "abbr": "1st ch", "actual": "1 Chronicles" },
|
||||||
{ "abbr": "1st chr", "actual": "1 Chronicles" },
|
{ "abbr": "1st chr", "actual": "1 Chronicles" },
|
||||||
{ "abbr": "first Chronicles", "actual": "1 Chronicles" },
|
{ "abbr": "first Chronicles", "actual": "1 Chronicles" },
|
||||||
{ "abbr": "first chronicles", "actual": "1 Chronicles" },
|
{ "abbr": "first chronicles", "actual": "1 Chronicles" },
|
||||||
{ "abbr": "first chron", "actual": "1 Chronicles" },
|
{ "abbr": "first chron", "actual": "1 Chronicles" },
|
||||||
{ "abbr": "first ch", "actual": "1 Chronicles" },
|
{ "abbr": "first ch", "actual": "1 Chronicles" },
|
||||||
{ "abbr": "first chr", "actual": "1 Chronicles" },
|
{ "abbr": "first chr", "actual": "1 Chronicles" },
|
||||||
{ "abbr": "ezra", "actual": "Ezra" },
|
{ "abbr": "ezra", "actual": "Ezra" },
|
||||||
{ "abbr": "ezr", "actual": "Ezra" },
|
{ "abbr": "ezr", "actual": "Ezra" },
|
||||||
{ "abbr": "nehemiah", "actual": "Nehemiah" },
|
{ "abbr": "nehemiah", "actual": "Nehemiah" },
|
||||||
{ "abbr": "neh", "actual": "Nehemiah" },
|
{ "abbr": "neh", "actual": "Nehemiah" },
|
||||||
{ "abbr": "ne", "actual": "Nehemiah" },
|
{ "abbr": "ne", "actual": "Nehemiah" },
|
||||||
{ "abbr": "nehamiah", "actual": "Nehemiah" },
|
{ "abbr": "nehamiah", "actual": "Nehemiah" },
|
||||||
{ "abbr": "esther", "actual": "Esther" },
|
{ "abbr": "esther", "actual": "Esther" },
|
||||||
{ "abbr": "est", "actual": "Esther" },
|
{ "abbr": "est", "actual": "Esther" },
|
||||||
{ "abbr": "es", "actual": "Esther" },
|
{ "abbr": "es", "actual": "Esther" },
|
||||||
{ "abbr": "esth", "actual": "Esther" },
|
{ "abbr": "esth", "actual": "Esther" },
|
||||||
{ "abbr": "job", "actual": "Job" },
|
{ "abbr": "job", "actual": "Job" },
|
||||||
{ "abbr": "jo", "actual": "Job" },
|
{ "abbr": "jo", "actual": "Job" },
|
||||||
{ "abbr": "jb", "actual": "Job" },
|
{ "abbr": "jb", "actual": "Job" },
|
||||||
{ "abbr": "psalms", "actual": "Psalm" },
|
{ "abbr": "psalms", "actual": "Psalm" },
|
||||||
{ "abbr": "ps", "actual": "Psalm" },
|
{ "abbr": "ps", "actual": "Psalm" },
|
||||||
{ "abbr": "psa", "actual": "Psalm" },
|
{ "abbr": "psa", "actual": "Psalm" },
|
||||||
{ "abbr": "psalm", "actual": "Psalm" },
|
{ "abbr": "psalm", "actual": "Psalm" },
|
||||||
{ "abbr": "psm", "actual": "Psalm" },
|
{ "abbr": "psm", "actual": "Psalm" },
|
||||||
{ "abbr": "proverbs", "actual": "Proverbs" },
|
{ "abbr": "proverbs", "actual": "Proverbs" },
|
||||||
{ "abbr": "prov", "actual": "Proverbs" },
|
{ "abbr": "prov", "actual": "Proverbs" },
|
||||||
{ "abbr": "pr", "actual": "Proverbs" },
|
{ "abbr": "pr", "actual": "Proverbs" },
|
||||||
{ "abbr": "pro", "actual": "Proverbs" },
|
{ "abbr": "pro", "actual": "Proverbs" },
|
||||||
{ "abbr": "proverb", "actual": "Proverbs" },
|
{ "abbr": "proverb", "actual": "Proverbs" },
|
||||||
{ "abbr": "prv", "actual": "Proverbs" },
|
{ "abbr": "prv", "actual": "Proverbs" },
|
||||||
{ "abbr": "prvbs", "actual": "Proverbs" },
|
{ "abbr": "prvbs", "actual": "Proverbs" },
|
||||||
{ "abbr": "ecclesiastes", "actual": "Ecclesiastes" },
|
{ "abbr": "ecclesiastes", "actual": "Ecclesiastes" },
|
||||||
{ "abbr": "eccl", "actual": "Ecclesiastes" },
|
{ "abbr": "eccl", "actual": "Ecclesiastes" },
|
||||||
{ "abbr": "ecc", "actual": "Ecclesiastes" },
|
{ "abbr": "ecc", "actual": "Ecclesiastes" },
|
||||||
{ "abbr": "eccles", "actual": "Ecclesiastes" },
|
{ "abbr": "eccles", "actual": "Ecclesiastes" },
|
||||||
{ "abbr": "ec", "actual": "Ecclesiastes" },
|
{ "abbr": "ec", "actual": "Ecclesiastes" },
|
||||||
{ "abbr": "ecl", "actual": "Ecclesiastes" },
|
{ "abbr": "ecl", "actual": "Ecclesiastes" },
|
||||||
{ "abbr": "ecclesiaste", "actual": "Ecclesiastes" },
|
{ "abbr": "ecclesiaste", "actual": "Ecclesiastes" },
|
||||||
{ "abbr": "song of solomon", "actual": "Song of Solomon" },
|
{ "abbr": "song of solomon", "actual": "Song of Solomon" },
|
||||||
{ "abbr": "song of songs", "actual": "Song of Solomon" },
|
{ "abbr": "song of songs", "actual": "Song of Solomon" },
|
||||||
{ "abbr": "sos", "actual": "Song of Solomon" },
|
{ "abbr": "sos", "actual": "Song of Solomon" },
|
||||||
{ "abbr": "ss", "actual": "Song of Solomon" },
|
{ "abbr": "ss", "actual": "Song of Solomon" },
|
||||||
{ "abbr": "son", "actual": "Song of Solomon" },
|
{ "abbr": "son", "actual": "Song of Solomon" },
|
||||||
{ "abbr": "so", "actual": "Song of Solomon" },
|
{ "abbr": "so", "actual": "Song of Solomon" },
|
||||||
{ "abbr": "song", "actual": "Song of Solomon" },
|
{ "abbr": "song", "actual": "Song of Solomon" },
|
||||||
{ "abbr": "songs", "actual": "Song of Solomon" },
|
{ "abbr": "songs", "actual": "Song of Solomon" },
|
||||||
{ "abbr": "isaiah", "actual": "Isaiah" },
|
{ "abbr": "isaiah", "actual": "Isaiah" },
|
||||||
{ "abbr": "is", "actual": "Isaiah" },
|
{ "abbr": "is", "actual": "Isaiah" },
|
||||||
{ "abbr": "isah", "actual": "Isaiah" },
|
{ "abbr": "isah", "actual": "Isaiah" },
|
||||||
{ "abbr": "isai", "actual": "Isaiah" },
|
{ "abbr": "isai", "actual": "Isaiah" },
|
||||||
{ "abbr": "ia", "actual": "Isaiah" },
|
{ "abbr": "ia", "actual": "Isaiah" },
|
||||||
{ "abbr": "jerimiah", "actual": "Jeremiah" },
|
{ "abbr": "jerimiah", "actual": "Jeremiah" },
|
||||||
{ "abbr": "jeremiah", "actual": "Jeremiah" },
|
{ "abbr": "jeremiah", "actual": "Jeremiah" },
|
||||||
{ "abbr": "jer", "actual": "Jeremiah" },
|
{ "abbr": "jer", "actual": "Jeremiah" },
|
||||||
{ "abbr": "je", "actual": "Jeremiah" },
|
{ "abbr": "je", "actual": "Jeremiah" },
|
||||||
{ "abbr": "jere", "actual": "Jeremiah" },
|
{ "abbr": "jere", "actual": "Jeremiah" },
|
||||||
{ "abbr": "lamentations", "actual": "Lamentations" },
|
{ "abbr": "lamentations", "actual": "Lamentations" },
|
||||||
{ "abbr": "lam", "actual": "Lamentations" },
|
{ "abbr": "lam", "actual": "Lamentations" },
|
||||||
{ "abbr": "la", "actual": "Lamentations" },
|
{ "abbr": "la", "actual": "Lamentations" },
|
||||||
{ "abbr": "lamentation", "actual": "Lamentations" },
|
{ "abbr": "lamentation", "actual": "Lamentations" },
|
||||||
];
|
];
|
||||||
|
|
||||||
for (let bk of booknames) {
|
for (let bk of booknames) {
|
||||||
it('Should parse the references: ' + bk.abbr, () => {
|
it('Should parse the references: ' + bk.abbr, () => {
|
||||||
let book = Reference.parseBook(bk.abbr);
|
let book = Reference.parseBook(bk.abbr);
|
||||||
expect(book.bookname).toBe(bk.actual);
|
expect(book.bookname).toBe(bk.actual);
|
||||||
for (let i = 1; i <= book.lastchapter; i++)
|
for (let i = 1; i <= book.lastchapter; i++)
|
||||||
expect(new Reference(bk.abbr + ' ' + i).toString()).toBe(bk.actual + ' ' + i + ":1 - *");
|
expect(new Reference(bk.abbr + ' ' + i).toString()).toBe(bk.actual + ' ' + i + ":1 - *");
|
||||||
|
|
||||||
for (let i = 1; i < book.lastchapter; i++)
|
for (let i = 1; i < book.lastchapter; i++) {
|
||||||
expect(new Reference(bk.abbr + ' ' + i+'-'+(i+1)).toString()).toBe(bk.actual + ' ' + i + ":1 - "+(i+1)+":*");
|
expect(new Reference(bk.abbr + ' ' + i + '-' + (i + 1)).toString()).toBe(bk.actual + ' ' + i + ":1 - " + (i + 1) + ":*");
|
||||||
|
expect(new Reference(bk.abbr + ' ' + i + ':3-' + (i + 1)+":6").toString()).toBe(bk.actual + ' ' + i + ":3 - " + (i + 1) + ":6");
|
||||||
expect(new Reference(bk.abbr + ' 1:4-2:5').toString()).toBe(bk.actual + ' 1:4 - 2:5');
|
}
|
||||||
expect(new Reference(bk.abbr + ' 1:1 - 5').toString()).toBe(bk.actual + ' 1:1 - 5');
|
|
||||||
expect(new Reference(bk.abbr + ' 1:4 - 5').toString()).toBe(bk.actual + ' 1:4 - 5');
|
expect(new Reference(bk.abbr + ' 1:4-2:5').toString()).toBe(bk.actual + ' 1:4 - 2:5');
|
||||||
});
|
expect(new Reference(bk.abbr + ' 1:1 - 5').toString()).toBe(bk.actual + ' 1:1 - 5');
|
||||||
}
|
expect(new Reference(bk.abbr + ' 1:4 - 5').toString()).toBe(bk.actual + ' 1:4 - 5');
|
||||||
let refs = [
|
});
|
||||||
{ "src": "2 sam 3:4-6:8", "actual": "2 Samuel 3:4 - 6:8" },
|
}
|
||||||
//{ "src": "gen 50 - ex 2", "actual": "Genesis 50:1 - Exodus 2:*" },
|
let refs = [
|
||||||
];
|
{ "src": "2 sam 3:4-6:8", "actual": "2 Samuel 3:4 - 6:8" },
|
||||||
|
//{ "src": "gen 50 - ex 2", "actual": "Genesis 50:1 - Exodus 2:*" },
|
||||||
for (let ref of refs) {
|
];
|
||||||
it('Should parse the reference: ' + ref.src, () => {
|
|
||||||
expect(new Reference(ref.src).toString()).toBe(ref.actual);
|
for (let ref of refs) {
|
||||||
});
|
it('Should parse the reference: ' + ref.src, () => {
|
||||||
}
|
expect(new Reference(ref.src).toString()).toBe(ref.actual);
|
||||||
|
});
|
||||||
});
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
@ -2,12 +2,12 @@ import { Component, ViewChild } from '@angular/core';
|
|||||||
import { Platform, MenuController, Nav } from 'ionic-angular';
|
import { Platform, MenuController, Nav } from 'ionic-angular';
|
||||||
import { StatusBar, Splashscreen } from 'ionic-native';
|
import { StatusBar, Splashscreen } from 'ionic-native';
|
||||||
import {SearchPage} from "../pages/search/search";
|
import {SearchPage} from "../pages/search/search";
|
||||||
import {SettingsPage} from "../pages/settings/settings";
|
import {SettingsPage} from "../pages/settings/settings";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
templateUrl: 'app.html'
|
templateUrl: 'app.html'
|
||||||
})
|
})
|
||||||
export class MyApp
|
export class MyApp
|
||||||
{
|
{
|
||||||
@ViewChild(Nav) nav: Nav;
|
@ViewChild(Nav) nav: Nav;
|
||||||
|
|
||||||
@ -17,7 +17,7 @@ export class MyApp
|
|||||||
constructor(
|
constructor(
|
||||||
public platform: Platform,
|
public platform: Platform,
|
||||||
public menu: MenuController
|
public menu: MenuController
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
this.initializeApp();
|
this.initializeApp();
|
||||||
|
|
||||||
@ -28,9 +28,9 @@ export class MyApp
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
initializeApp()
|
initializeApp()
|
||||||
{
|
{
|
||||||
this.platform.ready().then(() =>
|
this.platform.ready().then(() =>
|
||||||
{
|
{
|
||||||
// Okay, so the platform is ready and our plugins are available.
|
// Okay, so the platform is ready and our plugins are available.
|
||||||
// Here you can do any higher level native things you might need.
|
// Here you can do any higher level native things you might need.
|
||||||
@ -39,11 +39,11 @@ export class MyApp
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
openPage(page)
|
openPage(page)
|
||||||
{
|
{
|
||||||
// close the menu when clicking a link from the menu
|
// close the menu when clicking a link from the menu
|
||||||
this.menu.close();
|
this.menu.close();
|
||||||
// navigate to the new page if it is not the current page
|
// navigate to the new page if it is not the current page
|
||||||
this.nav.setRoot(page.component);
|
this.nav.setRoot(page.component);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,48 +1,48 @@
|
|||||||
import { NgModule, ErrorHandler } from '@angular/core';
|
import { NgModule, ErrorHandler } from '@angular/core';
|
||||||
import { BrowserModule } from '@angular/platform-browser';
|
import { BrowserModule } from '@angular/platform-browser';
|
||||||
|
|
||||||
import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular';
|
import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular';
|
||||||
import { Storage } from '@ionic/storage';
|
import { Storage } from '@ionic/storage';
|
||||||
|
|
||||||
import { MyApp } from './app.component';
|
import { MyApp } from './app.component';
|
||||||
|
|
||||||
import {SearchPage} from "../pages/search/search";
|
import {SearchPage} from "../pages/search/search";
|
||||||
import {SettingsPage} from "../pages/settings/settings";
|
import {SettingsPage} from "../pages/settings/settings";
|
||||||
|
|
||||||
import {ComponentLoader} from "../components/component-loader/component-loader.ts";
|
import {ComponentLoader} from "../components/component-loader/component-loader";
|
||||||
import {Passage} from "../components/passage/passage.ts";
|
import {Passage} from "../components/passage/passage";
|
||||||
import {Strongs} from "../components/strongs/strongs.ts";
|
import {Strongs} from "../components/strongs/strongs";
|
||||||
import {Words} from "../components/words/words.ts";
|
import {Words} from "../components/words/words";
|
||||||
import {Error} from "../components/error/error.ts";
|
import {Error} from "../components/error/error";
|
||||||
import {StrongsModal} from "../components/strongs-modal/strongs-modal.ts";
|
import {StrongsModal} from "../components/strongs-modal/strongs-modal";
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [
|
declarations: [
|
||||||
MyApp,
|
MyApp,
|
||||||
SearchPage,
|
SearchPage,
|
||||||
SettingsPage,
|
SettingsPage,
|
||||||
ComponentLoader,
|
ComponentLoader,
|
||||||
Passage,
|
Passage,
|
||||||
Strongs,
|
Strongs,
|
||||||
StrongsModal,
|
StrongsModal,
|
||||||
Words,
|
Words,
|
||||||
Error
|
Error
|
||||||
],
|
],
|
||||||
imports: [
|
imports: [
|
||||||
IonicModule.forRoot(MyApp),
|
IonicModule.forRoot(MyApp),
|
||||||
BrowserModule,
|
BrowserModule,
|
||||||
],
|
],
|
||||||
bootstrap: [IonicApp],
|
bootstrap: [IonicApp],
|
||||||
entryComponents: [
|
entryComponents: [
|
||||||
MyApp,
|
MyApp,
|
||||||
SearchPage,
|
SearchPage,
|
||||||
SettingsPage,
|
SettingsPage,
|
||||||
Passage,
|
Passage,
|
||||||
Strongs,
|
Strongs,
|
||||||
StrongsModal,
|
StrongsModal,
|
||||||
Words,
|
Words,
|
||||||
Error
|
Error
|
||||||
],
|
],
|
||||||
providers: [{ provide: ErrorHandler, useClass: IonicErrorHandler }, Storage]
|
providers: [{ provide: ErrorHandler, useClass: IonicErrorHandler }, Storage]
|
||||||
})
|
})
|
||||||
export class AppModule { }
|
export class AppModule { }
|
||||||
|
@ -1,69 +1,312 @@
|
|||||||
import { getTestBed, TestBed, inject } from '@angular/core/testing';
|
import { getTestBed, TestBed, inject } from '@angular/core/testing';
|
||||||
import { XHRBackend, BaseRequestOptions, HttpModule, Http, } from '@angular/http';
|
import { XHRBackend, BaseRequestOptions, HttpModule, Http, } from '@angular/http';
|
||||||
import { MockBackend } from '@angular/http/testing';
|
import { MockBackend } from '@angular/http/testing';
|
||||||
import { BibleService } from './bible-service';
|
import { BibleService } from './bible-service';
|
||||||
import { Reference } from './Reference';
|
import { Reference } from './Reference';
|
||||||
|
|
||||||
describe('Bible Service', () => {
|
describe('Bible Service', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [HttpModule],
|
imports: [HttpModule],
|
||||||
providers: [
|
providers: [
|
||||||
BibleService,
|
BibleService,
|
||||||
{
|
{
|
||||||
provide: Http,
|
provide: Http,
|
||||||
useFactory: function (backend, defaultOptions) {
|
useFactory: function (backend, defaultOptions) {
|
||||||
return new Http(backend, defaultOptions);
|
return new Http(backend, defaultOptions);
|
||||||
},
|
},
|
||||||
deps: [MockBackend, BaseRequestOptions]
|
deps: [MockBackend, BaseRequestOptions]
|
||||||
},
|
},
|
||||||
MockBackend,
|
MockBackend,
|
||||||
BaseRequestOptions
|
BaseRequestOptions
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Should get the verse: Gen 1:1', () => {
|
it('Should get the verse: Gen 1:1', () => {
|
||||||
let svc: BibleService = getTestBed().get(BibleService);
|
let svc: BibleService = getTestBed().get(BibleService);
|
||||||
let ref = new Reference("Gen 1:1").Section;
|
let ref = new Reference("Gen 1:1").Section;
|
||||||
var r = svc.getResult(ref);
|
var r = svc.getResult(ref);
|
||||||
|
|
||||||
expect(r.msg).toBe(':)');
|
expect(r.msg).toBe(':)');
|
||||||
expect(r.ref).toBe('Genesis 1:1');
|
expect(r.ref).toBe('Genesis 1:1');
|
||||||
expect(r.status).toBe(0);
|
expect(r.status).toBe(0);
|
||||||
expect(r.testament).toBe("old");
|
expect(r.testament).toBe("old");
|
||||||
|
|
||||||
expect(r.cs.length).toBe(1);
|
expect(r.cs.length).toBe(1);
|
||||||
expect(r.cs[0].vss.length).toBe(1);
|
expect(r.cs[0].vss.length).toBe(1);
|
||||||
expect(r.cs[0].vss[0].w.length).toBe(9);
|
expect(r.cs[0].vss[0].w.length).toBe(9);
|
||||||
expect(r.cs[0].vss[0].w[0].t).toBe("In the");
|
expect(r.cs[0].vss[0].w[0].t).toBe("In the");
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Should get the passage: Gen 1:1-9', () => {
|
it('Should get the passage: Gen 1:1-9', () => {
|
||||||
let svc: BibleService = getTestBed().get(BibleService);
|
let svc: BibleService = getTestBed().get(BibleService);
|
||||||
let ref = new Reference("Gen 1:1-9").Section;
|
let ref = new Reference("Gen 1:1-9").Section;
|
||||||
var r = svc.getResult(ref);
|
var r = svc.getResult(ref);
|
||||||
|
|
||||||
expect(r.msg).toBe(':)');
|
expect(r.msg).toBe(':)');
|
||||||
expect(r.ref).toBe('Genesis 1:1 - 9');
|
expect(r.ref).toBe('Genesis 1:1 - 9');
|
||||||
expect(r.status).toBe(0);
|
expect(r.status).toBe(0);
|
||||||
expect(r.testament).toBe("old");
|
expect(r.testament).toBe("old");
|
||||||
|
|
||||||
expect(r.cs.length).toBe(1);
|
expect(r.cs.length).toBe(1);
|
||||||
expect(r.cs[0].vss.length).toBe(9);
|
expect(r.cs[0].vss.length).toBe(9);
|
||||||
expect(r.cs[0].vss[0].w.length).toBe(9);
|
expect(r.cs[0].vss[0].w.length).toBe(9);
|
||||||
expect(r.cs[0].vss[0].w[0].t).toBe("In the");
|
expect(r.cs[0].vss[0].w[0].t).toBe("In the");
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Should return an error status', () => {
|
it('Should return an error status', () => {
|
||||||
let svc: BibleService = getTestBed().get(BibleService);
|
let svc: BibleService = getTestBed().get(BibleService);
|
||||||
let ref = new Reference("Gen 100:1").Section;
|
let ref = new Reference("Gen 100:1").Section;
|
||||||
var r = svc.getResult(ref);
|
var r = svc.getResult(ref);
|
||||||
|
|
||||||
expect(r.msg).toBe('Unable to retrieve bible passage Genesis 100:1.');
|
expect(r.msg).toBe('Unable to retrieve bible passage Genesis 100:1.');
|
||||||
expect(r.ref).toBe("Genesis 100:1");
|
expect(r.ref).toBe("Genesis 100:1");
|
||||||
expect(r.status).toBe(-1);
|
expect(r.status).toBe(-1);
|
||||||
expect(r.testament).toBe('');
|
expect(r.testament).toBe('');
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
|
||||||
|
let booknames = [
|
||||||
|
{ "abbr": "gen", "actual": "Genesis" },
|
||||||
|
{ "abbr": "ge", "actual": "Genesis" },
|
||||||
|
{ "abbr": "genesis", "actual": "Genesis" },
|
||||||
|
{ "abbr": "gn", "actual": "Genesis" },
|
||||||
|
{ "abbr": "exodus", "actual": "Exodus" },
|
||||||
|
{ "abbr": "ex", "actual": "Exodus" },
|
||||||
|
{ "abbr": "exo", "actual": "Exodus" },
|
||||||
|
{ "abbr": "exod", "actual": "Exodus" },
|
||||||
|
{ "abbr": "exd", "actual": "Exodus" },
|
||||||
|
{ "abbr": "leviticus", "actual": "Leviticus" },
|
||||||
|
{ "abbr": "lev", "actual": "Leviticus" },
|
||||||
|
{ "abbr": "le", "actual": "Leviticus" },
|
||||||
|
{ "abbr": "levi", "actual": "Leviticus" },
|
||||||
|
{ "abbr": "lv", "actual": "Leviticus" },
|
||||||
|
{ "abbr": "numbers", "actual": "Numbers" },
|
||||||
|
{ "abbr": "num", "actual": "Numbers" },
|
||||||
|
{ "abbr": "nu", "actual": "Numbers" },
|
||||||
|
{ "abbr": "numb", "actual": "Numbers" },
|
||||||
|
{ "abbr": "number", "actual": "Numbers" },
|
||||||
|
{ "abbr": "deuteronomy", "actual": "Deuteronomy" },
|
||||||
|
{ "abbr": "deut", "actual": "Deuteronomy" },
|
||||||
|
{ "abbr": "de", "actual": "Deuteronomy" },
|
||||||
|
{ "abbr": "dt", "actual": "Deuteronomy" },
|
||||||
|
{ "abbr": "deu", "actual": "Deuteronomy" },
|
||||||
|
{ "abbr": "joshua", "actual": "Joshua" },
|
||||||
|
{ "abbr": "josh", "actual": "Joshua" },
|
||||||
|
{ "abbr": "jos", "actual": "Joshua" },
|
||||||
|
{ "abbr": "judges", "actual": "Judges" },
|
||||||
|
{ "abbr": "jud", "actual": "Judges" },
|
||||||
|
{ "abbr": "jdg", "actual": "Judges" },
|
||||||
|
{ "abbr": "judg", "actual": "Judges" },
|
||||||
|
{ "abbr": "ruth", "actual": "Ruth" },
|
||||||
|
{ "abbr": "ru", "actual": "Ruth" },
|
||||||
|
{ "abbr": "1 samuel", "actual": "1 Samuel" },
|
||||||
|
{ "abbr": "1 sa", "actual": "1 Samuel" },
|
||||||
|
{ "abbr": "1 sam", "actual": "1 Samuel" },
|
||||||
|
{ "abbr": "1 sml", "actual": "1 Samuel" },
|
||||||
|
{ "abbr": "i samuel", "actual": "1 Samuel" },
|
||||||
|
{ "abbr": "i sa", "actual": "1 Samuel" },
|
||||||
|
{ "abbr": "i sam", "actual": "1 Samuel" },
|
||||||
|
{ "abbr": "i sml", "actual": "1 Samuel" },
|
||||||
|
{ "abbr": "1st samuel", "actual": "1 Samuel" },
|
||||||
|
{ "abbr": "1st sa", "actual": "1 Samuel" },
|
||||||
|
{ "abbr": "1st sam", "actual": "1 Samuel" },
|
||||||
|
{ "abbr": "1st sml", "actual": "1 Samuel" },
|
||||||
|
{ "abbr": "first samuel", "actual": "1 Samuel" },
|
||||||
|
{ "abbr": "first sa", "actual": "1 Samuel" },
|
||||||
|
{ "abbr": "first sam", "actual": "1 Samuel" },
|
||||||
|
{ "abbr": "first sml", "actual": "1 Samuel" },
|
||||||
|
{ "abbr": "2 samuel", "actual": "2 Samuel" },
|
||||||
|
{ "abbr": "2 sa", "actual": "2 Samuel" },
|
||||||
|
{ "abbr": "2 sam", "actual": "2 Samuel" },
|
||||||
|
{ "abbr": "2 sml", "actual": "2 Samuel" },
|
||||||
|
{ "abbr": "ii samuel", "actual": "2 Samuel" },
|
||||||
|
{ "abbr": "ii sa", "actual": "2 Samuel" },
|
||||||
|
{ "abbr": "ii sam", "actual": "2 Samuel" },
|
||||||
|
{ "abbr": "ii sml", "actual": "2 Samuel" },
|
||||||
|
{ "abbr": "2nd samuel", "actual": "2 Samuel" },
|
||||||
|
{ "abbr": "2nd sa", "actual": "2 Samuel" },
|
||||||
|
{ "abbr": "2nd sam", "actual": "2 Samuel" },
|
||||||
|
{ "abbr": "2nd sml", "actual": "2 Samuel" },
|
||||||
|
{ "abbr": "second samuel", "actual": "2 Samuel" },
|
||||||
|
{ "abbr": "second sa", "actual": "2 Samuel" },
|
||||||
|
{ "abbr": "second sam", "actual": "2 Samuel" },
|
||||||
|
{ "abbr": "second sml", "actual": "2 Samuel" },
|
||||||
|
{ "abbr": "sec samuel", "actual": "2 Samuel" },
|
||||||
|
{ "abbr": "sec sa", "actual": "2 Samuel" },
|
||||||
|
{ "abbr": "sec sam", "actual": "2 Samuel" },
|
||||||
|
{ "abbr": "sec sml", "actual": "2 Samuel" },
|
||||||
|
{ "abbr": "1 kings", "actual": "1 Kings" },
|
||||||
|
{ "abbr": "1 king", "actual": "1 Kings" },
|
||||||
|
{ "abbr": "1 kgs", "actual": "1 Kings" },
|
||||||
|
{ "abbr": "1 kn", "actual": "1 Kings" },
|
||||||
|
{ "abbr": "1 k", "actual": "1 Kings" },
|
||||||
|
{ "abbr": "1 ki", "actual": "1 Kings" },
|
||||||
|
{ "abbr": "i kings", "actual": "1 Kings" },
|
||||||
|
{ "abbr": "i king", "actual": "1 Kings" },
|
||||||
|
{ "abbr": "i kgs", "actual": "1 Kings" },
|
||||||
|
{ "abbr": "i kn", "actual": "1 Kings" },
|
||||||
|
{ "abbr": "i k", "actual": "1 Kings" },
|
||||||
|
{ "abbr": "i ki", "actual": "1 Kings" },
|
||||||
|
{ "abbr": "1st kings", "actual": "1 Kings" },
|
||||||
|
{ "abbr": "1st king", "actual": "1 Kings" },
|
||||||
|
{ "abbr": "1st kgs", "actual": "1 Kings" },
|
||||||
|
{ "abbr": "1st kn", "actual": "1 Kings" },
|
||||||
|
{ "abbr": "1st k", "actual": "1 Kings" },
|
||||||
|
{ "abbr": "1st ki", "actual": "1 Kings" },
|
||||||
|
{ "abbr": "first kings", "actual": "1 Kings" },
|
||||||
|
{ "abbr": "first king", "actual": "1 Kings" },
|
||||||
|
{ "abbr": "first kgs", "actual": "1 Kings" },
|
||||||
|
{ "abbr": "first kn", "actual": "1 Kings" },
|
||||||
|
{ "abbr": "first k", "actual": "1 Kings" },
|
||||||
|
{ "abbr": "first ki", "actual": "1 Kings" },
|
||||||
|
{ "abbr": "2 Kings", "actual": "2 Kings" },
|
||||||
|
{ "abbr": "2 king", "actual": "2 Kings" },
|
||||||
|
{ "abbr": "2 kgs", "actual": "2 Kings" },
|
||||||
|
{ "abbr": "2 kn", "actual": "2 Kings" },
|
||||||
|
{ "abbr": "2 k", "actual": "2 Kings" },
|
||||||
|
{ "abbr": "2 ki", "actual": "2 Kings" },
|
||||||
|
{ "abbr": "ii kings", "actual": "2 Kings" },
|
||||||
|
{ "abbr": "ii king", "actual": "2 Kings" },
|
||||||
|
{ "abbr": "ii kgs", "actual": "2 Kings" },
|
||||||
|
{ "abbr": "ii kn", "actual": "2 Kings" },
|
||||||
|
{ "abbr": "ii k", "actual": "2 Kings" },
|
||||||
|
{ "abbr": "ii ki", "actual": "2 Kings" },
|
||||||
|
{ "abbr": "2nd kings", "actual": "2 Kings" },
|
||||||
|
{ "abbr": "2nd king", "actual": "2 Kings" },
|
||||||
|
{ "abbr": "2nd kgs", "actual": "2 Kings" },
|
||||||
|
{ "abbr": "2nd kn", "actual": "2 Kings" },
|
||||||
|
{ "abbr": "2nd k", "actual": "2 Kings" },
|
||||||
|
{ "abbr": "2nd ki", "actual": "2 Kings" },
|
||||||
|
{ "abbr": "second kings", "actual": "2 Kings" },
|
||||||
|
{ "abbr": "second king", "actual": "2 Kings" },
|
||||||
|
{ "abbr": "second kgs", "actual": "2 Kings" },
|
||||||
|
{ "abbr": "second kn", "actual": "2 Kings" },
|
||||||
|
{ "abbr": "second k", "actual": "2 Kings" },
|
||||||
|
{ "abbr": "second ki", "actual": "2 Kings" },
|
||||||
|
{ "abbr": "sec kings", "actual": "2 Kings" },
|
||||||
|
{ "abbr": "sec king", "actual": "2 Kings" },
|
||||||
|
{ "abbr": "sec kgs", "actual": "2 Kings" },
|
||||||
|
{ "abbr": "sec kn", "actual": "2 Kings" },
|
||||||
|
{ "abbr": "sec k", "actual": "2 Kings" },
|
||||||
|
{ "abbr": "sec ki", "actual": "2 Kings" },
|
||||||
|
{ "abbr": "2 Chronicles", "actual": "2 Chronicles" },
|
||||||
|
{ "abbr": "2 chronicles", "actual": "2 Chronicles" },
|
||||||
|
{ "abbr": "2 chron", "actual": "2 Chronicles" },
|
||||||
|
{ "abbr": "2 ch", "actual": "2 Chronicles" },
|
||||||
|
{ "abbr": "2 chr", "actual": "2 Chronicles" },
|
||||||
|
{ "abbr": "ii Chronicles", "actual": "2 Chronicles" },
|
||||||
|
{ "abbr": "ii chronicles", "actual": "2 Chronicles" },
|
||||||
|
{ "abbr": "ii chron", "actual": "2 Chronicles" },
|
||||||
|
{ "abbr": "ii ch", "actual": "2 Chronicles" },
|
||||||
|
{ "abbr": "ii chr", "actual": "2 Chronicles" },
|
||||||
|
{ "abbr": "2nd Chronicles", "actual": "2 Chronicles" },
|
||||||
|
{ "abbr": "2nd chronicles", "actual": "2 Chronicles" },
|
||||||
|
{ "abbr": "2nd chron", "actual": "2 Chronicles" },
|
||||||
|
{ "abbr": "2nd ch", "actual": "2 Chronicles" },
|
||||||
|
{ "abbr": "2nd chr", "actual": "2 Chronicles" },
|
||||||
|
{ "abbr": "second Chronicles", "actual": "2 Chronicles" },
|
||||||
|
{ "abbr": "second chronicles", "actual": "2 Chronicles" },
|
||||||
|
{ "abbr": "second chron", "actual": "2 Chronicles" },
|
||||||
|
{ "abbr": "second ch", "actual": "2 Chronicles" },
|
||||||
|
{ "abbr": "second chr", "actual": "2 Chronicles" },
|
||||||
|
{ "abbr": "sec Chronicles", "actual": "2 Chronicles" },
|
||||||
|
{ "abbr": "sec chronicles", "actual": "2 Chronicles" },
|
||||||
|
{ "abbr": "sec chron", "actual": "2 Chronicles" },
|
||||||
|
{ "abbr": "sec ch", "actual": "2 Chronicles" },
|
||||||
|
{ "abbr": "sec chr", "actual": "2 Chronicles" },
|
||||||
|
{ "abbr": "1 Chronicles", "actual": "1 Chronicles" },
|
||||||
|
{ "abbr": "1 chronicles", "actual": "1 Chronicles" },
|
||||||
|
{ "abbr": "1 chron", "actual": "1 Chronicles" },
|
||||||
|
{ "abbr": "1 ch", "actual": "1 Chronicles" },
|
||||||
|
{ "abbr": "1 chr", "actual": "1 Chronicles" },
|
||||||
|
{ "abbr": "i Chronicles", "actual": "1 Chronicles" },
|
||||||
|
{ "abbr": "i chronicles", "actual": "1 Chronicles" },
|
||||||
|
{ "abbr": "i chron", "actual": "1 Chronicles" },
|
||||||
|
{ "abbr": "i ch", "actual": "1 Chronicles" },
|
||||||
|
{ "abbr": "i chr", "actual": "1 Chronicles" },
|
||||||
|
{ "abbr": "1st Chronicles", "actual": "1 Chronicles" },
|
||||||
|
{ "abbr": "1st chronicles", "actual": "1 Chronicles" },
|
||||||
|
{ "abbr": "1st chron", "actual": "1 Chronicles" },
|
||||||
|
{ "abbr": "1st ch", "actual": "1 Chronicles" },
|
||||||
|
{ "abbr": "1st chr", "actual": "1 Chronicles" },
|
||||||
|
{ "abbr": "first Chronicles", "actual": "1 Chronicles" },
|
||||||
|
{ "abbr": "first chronicles", "actual": "1 Chronicles" },
|
||||||
|
{ "abbr": "first chron", "actual": "1 Chronicles" },
|
||||||
|
{ "abbr": "first ch", "actual": "1 Chronicles" },
|
||||||
|
{ "abbr": "first chr", "actual": "1 Chronicles" },
|
||||||
|
{ "abbr": "ezra", "actual": "Ezra" },
|
||||||
|
{ "abbr": "ezr", "actual": "Ezra" },
|
||||||
|
{ "abbr": "nehemiah", "actual": "Nehemiah" },
|
||||||
|
{ "abbr": "neh", "actual": "Nehemiah" },
|
||||||
|
{ "abbr": "ne", "actual": "Nehemiah" },
|
||||||
|
{ "abbr": "nehamiah", "actual": "Nehemiah" },
|
||||||
|
{ "abbr": "esther", "actual": "Esther" },
|
||||||
|
{ "abbr": "est", "actual": "Esther" },
|
||||||
|
{ "abbr": "es", "actual": "Esther" },
|
||||||
|
{ "abbr": "esth", "actual": "Esther" },
|
||||||
|
{ "abbr": "job", "actual": "Job" },
|
||||||
|
{ "abbr": "jo", "actual": "Job" },
|
||||||
|
{ "abbr": "jb", "actual": "Job" },
|
||||||
|
{ "abbr": "psalms", "actual": "Psalm" },
|
||||||
|
{ "abbr": "ps", "actual": "Psalm" },
|
||||||
|
{ "abbr": "psa", "actual": "Psalm" },
|
||||||
|
{ "abbr": "psalm", "actual": "Psalm" },
|
||||||
|
{ "abbr": "psm", "actual": "Psalm" },
|
||||||
|
{ "abbr": "proverbs", "actual": "Proverbs" },
|
||||||
|
{ "abbr": "prov", "actual": "Proverbs" },
|
||||||
|
{ "abbr": "pr", "actual": "Proverbs" },
|
||||||
|
{ "abbr": "pro", "actual": "Proverbs" },
|
||||||
|
{ "abbr": "proverb", "actual": "Proverbs" },
|
||||||
|
{ "abbr": "prv", "actual": "Proverbs" },
|
||||||
|
{ "abbr": "prvbs", "actual": "Proverbs" },
|
||||||
|
{ "abbr": "ecclesiastes", "actual": "Ecclesiastes" },
|
||||||
|
{ "abbr": "eccl", "actual": "Ecclesiastes" },
|
||||||
|
{ "abbr": "ecc", "actual": "Ecclesiastes" },
|
||||||
|
{ "abbr": "eccles", "actual": "Ecclesiastes" },
|
||||||
|
{ "abbr": "ec", "actual": "Ecclesiastes" },
|
||||||
|
{ "abbr": "ecl", "actual": "Ecclesiastes" },
|
||||||
|
{ "abbr": "ecclesiaste", "actual": "Ecclesiastes" },
|
||||||
|
{ "abbr": "song of solomon", "actual": "Song of Solomon" },
|
||||||
|
{ "abbr": "song of songs", "actual": "Song of Solomon" },
|
||||||
|
{ "abbr": "sos", "actual": "Song of Solomon" },
|
||||||
|
{ "abbr": "ss", "actual": "Song of Solomon" },
|
||||||
|
{ "abbr": "son", "actual": "Song of Solomon" },
|
||||||
|
{ "abbr": "so", "actual": "Song of Solomon" },
|
||||||
|
{ "abbr": "song", "actual": "Song of Solomon" },
|
||||||
|
{ "abbr": "songs", "actual": "Song of Solomon" },
|
||||||
|
{ "abbr": "isaiah", "actual": "Isaiah" },
|
||||||
|
{ "abbr": "is", "actual": "Isaiah" },
|
||||||
|
{ "abbr": "isah", "actual": "Isaiah" },
|
||||||
|
{ "abbr": "isai", "actual": "Isaiah" },
|
||||||
|
{ "abbr": "ia", "actual": "Isaiah" },
|
||||||
|
{ "abbr": "jerimiah", "actual": "Jeremiah" },
|
||||||
|
{ "abbr": "jeremiah", "actual": "Jeremiah" },
|
||||||
|
{ "abbr": "jer", "actual": "Jeremiah" },
|
||||||
|
{ "abbr": "je", "actual": "Jeremiah" },
|
||||||
|
{ "abbr": "jere", "actual": "Jeremiah" },
|
||||||
|
{ "abbr": "lamentations", "actual": "Lamentations" },
|
||||||
|
{ "abbr": "lam", "actual": "Lamentations" },
|
||||||
|
{ "abbr": "la", "actual": "Lamentations" },
|
||||||
|
{ "abbr": "lamentation", "actual": "Lamentations" },
|
||||||
|
];
|
||||||
|
|
||||||
|
for (let bk of booknames) {
|
||||||
|
it('Get Data for: ' + bk.abbr, () => {
|
||||||
|
let svc: BibleService = getTestBed().get(BibleService);
|
||||||
|
let book = Reference.parseBook(bk.abbr);
|
||||||
|
for (let i = 1; i <= book.lastchapter; i++)
|
||||||
|
{
|
||||||
|
let ref = new Reference(bk.abbr + " "+i).Section;
|
||||||
|
var r = svc.getResult(ref);
|
||||||
|
|
||||||
|
expect(r.msg).toBe(':)');
|
||||||
|
expect(r.ref).toBe(book.bookname + " "+i+":1 - *");
|
||||||
|
expect(r.status).toBe(0);
|
||||||
|
expect(r.cs[0].vss.length).toBeGreaterThan(1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { EventEmitter, Component, Output } from "@angular/core";
|
import { EventEmitter, Component, Output } from "@angular/core";
|
||||||
import { Platform, NavParams, ViewController } from 'ionic-angular';
|
import { Platform, NavParams, ViewController } from 'ionic-angular';
|
||||||
import { Reference } from '../../Reference.ts';
|
import { Reference } from '../../Reference';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: "strongs-modal",
|
selector: "strongs-modal",
|
||||||
@ -18,7 +18,7 @@ export class StrongsModal {
|
|||||||
public viewCtrl: ViewController
|
public viewCtrl: ViewController
|
||||||
) {
|
) {
|
||||||
this.item = this.params.get('strongsid') as StrongsResult;
|
this.item = this.params.get('strongsid') as StrongsResult;
|
||||||
this.onPassageClicked.subscribe(item =>
|
this.onPassageClicked.subscribe(item =>
|
||||||
this.params.get('onPassageClicked').getItems(item)
|
this.params.get('onPassageClicked').getItems(item)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -33,4 +33,4 @@ export class StrongsModal {
|
|||||||
let ref = this.makePassage(p);
|
let ref = this.makePassage(p);
|
||||||
this.onPassageClicked.emit(ref);
|
this.onPassageClicked.emit(ref);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { EventEmitter, Component, Input, Output } from "@angular/core";
|
import { EventEmitter, Component, Input, Output } from "@angular/core";
|
||||||
import { Reference } from '../../Reference.ts';
|
import { Reference } from '../../Reference';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: "strongs",
|
selector: "strongs",
|
||||||
@ -21,7 +21,7 @@ export class Strongs {
|
|||||||
constructor() {
|
constructor() {
|
||||||
}
|
}
|
||||||
|
|
||||||
close()
|
close()
|
||||||
{
|
{
|
||||||
this.onClose.emit(this.cardItem);
|
this.onClose.emit(this.cardItem);
|
||||||
}
|
}
|
||||||
@ -32,4 +32,4 @@ export class Strongs {
|
|||||||
let ref = this.makePassage(p);
|
let ref = this.makePassage(p);
|
||||||
this.onPassageClicked.emit({ card: this.cardItem, qry: ref });
|
this.onPassageClicked.emit({ card: this.cardItem, qry: ref });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import {EventEmitter, Component, Input, Output} from "@angular/core";
|
import {EventEmitter, Component, Input, Output} from "@angular/core";
|
||||||
import { Reference } from '../../Reference.ts';
|
import { Reference } from '../../Reference';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: "words",
|
selector: "words",
|
||||||
@ -25,13 +25,13 @@ export class Words {
|
|||||||
this.onClose.emit(this.cardItem);
|
this.onClose.emit(this.cardItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
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];
|
||||||
}
|
}
|
||||||
openPassage(p: string)
|
openPassage(p: string)
|
||||||
{
|
{
|
||||||
let ref = this.makePassage(p);
|
let ref = this.makePassage(p);
|
||||||
this.onPassageClicked.emit({ card: this.cardItem, qry: ref });
|
this.onPassageClicked.emit({ card: this.cardItem, qry: ref });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,222 +1,222 @@
|
|||||||
/// <reference path="../../types.ts" />
|
/// <reference path="../../types.ts" />
|
||||||
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 {Loading, 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";
|
||||||
import {Storage} from '@ionic/storage';
|
import {Storage} from '@ionic/storage';
|
||||||
import {UserProfile} from '../../UserProfile';
|
import {UserProfile} from '../../UserProfile';
|
||||||
|
|
||||||
class Item
|
class Item
|
||||||
{
|
{
|
||||||
id: number;
|
id: number;
|
||||||
data: any;
|
data: any;
|
||||||
type: Type<any>;
|
type: Type<any>;
|
||||||
dict: string;
|
dict: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
templateUrl: "search.html",
|
templateUrl: "search.html",
|
||||||
providers: [BibleService, StrongsService, WordService],
|
providers: [BibleService, StrongsService, WordService],
|
||||||
})
|
})
|
||||||
export class SearchPage
|
export class SearchPage
|
||||||
{
|
{
|
||||||
searchQuery: string = "";
|
searchQuery: string = "";
|
||||||
userProfile: UserProfile;
|
userProfile: UserProfile;
|
||||||
last: CardItem;
|
last: CardItem;
|
||||||
loader: Loading;
|
loader: Loading;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private strongsService: StrongsService
|
private strongsService: StrongsService
|
||||||
, private bibleService: BibleService
|
, private bibleService: BibleService
|
||||||
, private wordService: WordService
|
, private wordService: WordService
|
||||||
, public loadingCtrl: LoadingController
|
, public loadingCtrl: LoadingController
|
||||||
, public modalCtrl: ModalController
|
, public modalCtrl: ModalController
|
||||||
, public local: Storage)
|
, public local: Storage)
|
||||||
{
|
{
|
||||||
this.userProfile = new UserProfile(UserProfile.createDefaultUser());
|
this.userProfile = new UserProfile(UserProfile.createDefaultUser());
|
||||||
|
|
||||||
// Check if there is a profile saved in local storage
|
// Check if there is a profile saved in local storage
|
||||||
this.local.get('profile').then(profile =>
|
this.local.get('profile').then(profile =>
|
||||||
{
|
{
|
||||||
let t = this.userProfile;
|
let t = this.userProfile;
|
||||||
|
|
||||||
if (profile !== null)
|
if (profile !== null)
|
||||||
t = JSON.parse(profile);
|
t = JSON.parse(profile);
|
||||||
|
|
||||||
this.userProfile.update(t, local);
|
this.userProfile.update(t, local);
|
||||||
|
|
||||||
this.initializeItems(this.userProfile);
|
this.initializeItems(this.userProfile);
|
||||||
}).catch(error =>
|
}).catch(error =>
|
||||||
{
|
{
|
||||||
console.log(error);
|
console.log(error);
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
initializeItems(u: UserProfile)
|
initializeItems(u: UserProfile)
|
||||||
{
|
{
|
||||||
this.userProfile = u;
|
this.userProfile = u;
|
||||||
}
|
}
|
||||||
|
|
||||||
presentStrongsModal(strongs: StrongsResult)
|
presentStrongsModal(strongs: StrongsResult)
|
||||||
{
|
{
|
||||||
let modal = this.modalCtrl.create(StrongsModal, { strongsid: strongs, onPassageClicked: this });
|
let modal = this.modalCtrl.create(StrongsModal, { strongsid: strongs, onPassageClicked: this });
|
||||||
modal.present();
|
modal.present();
|
||||||
}
|
}
|
||||||
|
|
||||||
setQuery(searchbar)
|
setQuery(searchbar)
|
||||||
{
|
{
|
||||||
this.searchQuery = searchbar.target.value;
|
this.searchQuery = searchbar.target.value;
|
||||||
}
|
}
|
||||||
getQuery(searchbar)
|
getQuery(searchbar)
|
||||||
{
|
{
|
||||||
this.getItems(this.searchQuery);
|
this.getItems(this.searchQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
removeItem(item)
|
removeItem(item)
|
||||||
{
|
{
|
||||||
let idx = this.userProfile.user.items.indexOf(item);
|
let idx = this.userProfile.user.items.indexOf(item);
|
||||||
this.userProfile.user.items.splice(idx, 1);
|
this.userProfile.user.items.splice(idx, 1);
|
||||||
|
|
||||||
// save the users settings.
|
// save the users settings.
|
||||||
this.userProfile.save(this.local);
|
this.userProfile.save(this.local);
|
||||||
}
|
}
|
||||||
|
|
||||||
isError(t: string)
|
isError(t: string)
|
||||||
{
|
{
|
||||||
return t === "Error";
|
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)
|
||||||
{
|
{
|
||||||
if (this.last != null && this.userProfile.user.insert_next_to_item)
|
if (this.last != null && this.userProfile.user.insert_next_to_item)
|
||||||
{
|
{
|
||||||
let idx = this.userProfile.user.items.indexOf(this.last);
|
let idx = this.userProfile.user.items.indexOf(this.last);
|
||||||
this.userProfile.user.items.splice(idx + 1, 0, item);
|
this.userProfile.user.items.splice(idx + 1, 0, item);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
this.userProfile.user.items.push(item);
|
this.userProfile.user.items.push(item);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (this.last != null && this.userProfile.user.insert_next_to_item)
|
if (this.last != null && this.userProfile.user.insert_next_to_item)
|
||||||
{
|
{
|
||||||
let idx = this.userProfile.user.items.indexOf(this.last);
|
let idx = this.userProfile.user.items.indexOf(this.last);
|
||||||
this.userProfile.user.items.splice(idx, 0, item);
|
this.userProfile.user.items.splice(idx, 0, item);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
this.userProfile.user.items.unshift(item);
|
this.userProfile.user.items.unshift(item);
|
||||||
}
|
}
|
||||||
this.last = null;
|
this.last = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
getItemsNextToCard(data: OpenData)
|
getItemsNextToCard(data: OpenData)
|
||||||
{
|
{
|
||||||
this.last = data.card;
|
this.last = data.card;
|
||||||
this.getItems(data.qry);
|
this.getItems(data.qry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
getItems(search)
|
getItems(search)
|
||||||
{
|
{
|
||||||
this.loader = this.loadingCtrl.create({
|
this.loader = this.loadingCtrl.create({
|
||||||
content: "Looking up query..."
|
content: "Looking up query..."
|
||||||
});
|
});
|
||||||
this.loader.present().then(
|
this.loader.present().then(
|
||||||
() =>
|
() =>
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
let qs = search.split(";");
|
let qs = search.split(";");
|
||||||
for (let x in qs)
|
for (let x in qs)
|
||||||
{
|
{
|
||||||
if (qs.hasOwnProperty(x))
|
if (qs.hasOwnProperty(x))
|
||||||
{
|
{
|
||||||
let q = qs[x].trim();
|
let q = qs[x].trim();
|
||||||
if (q !== "")
|
if (q !== "")
|
||||||
{
|
{
|
||||||
// its a search term.
|
// its a search term.
|
||||||
if (q.search(/[0-9]/i) === -1)
|
if (q.search(/[0-9]/i) === -1)
|
||||||
{
|
{
|
||||||
let result = this.wordService.getResult(q);
|
let result = this.wordService.getResult(q);
|
||||||
if (result.status == 0)
|
if (result.status == 0)
|
||||||
this.addItemToList({ data: result, type: "Words", dict: "na" });
|
this.addItemToList({ data: result, type: "Words", dict: "na" });
|
||||||
else
|
else
|
||||||
this.addItemToList({ data: result.msg, type: "Error", dict: "na" });
|
this.addItemToList({ data: result.msg, type: "Error", dict: "na" });
|
||||||
}
|
}
|
||||||
else if (q.search(/(H|G)[0-9]/i) !== -1)
|
else if (q.search(/(H|G)[0-9]/i) !== -1)
|
||||||
{
|
{
|
||||||
// its a strongs lookup
|
// its a strongs lookup
|
||||||
let dict = q.substring(0, 1);
|
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 (result.status == -1)
|
if (result.status == -1)
|
||||||
this.addItemToList({ data: result.msg, type: "Error", dict: "na" });
|
this.addItemToList({ data: result.msg, type: "Error", dict: "na" });
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (this.userProfile.user.strongs_modal)
|
if (this.userProfile.user.strongs_modal)
|
||||||
this.presentStrongsModal(result);
|
this.presentStrongsModal(result);
|
||||||
else
|
else
|
||||||
this.addItemToList({ data: result, type: "Strongs", dict: "na" });
|
this.addItemToList({ data: result, type: "Strongs", dict: "na" });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// its a verse reference.
|
// its a verse reference.
|
||||||
if (q.trim() !== "")
|
if (q.trim() !== "")
|
||||||
{
|
{
|
||||||
let myref = new Reference(q.trim());
|
let myref = new Reference(q.trim());
|
||||||
let r = this.bibleService.getResult(myref.Section);
|
let r = this.bibleService.getResult(myref.Section);
|
||||||
r.ref = myref.toString();
|
r.ref = myref.toString();
|
||||||
if (r.status == 0)
|
if (r.status == 0)
|
||||||
this.addItemToList({ data: r, type: "Passage", dict: r.testament == 'new' ? "G" : "H" });
|
this.addItemToList({ data: r, type: "Passage", dict: r.testament == 'new' ? "G" : "H" });
|
||||||
else
|
else
|
||||||
this.addItemToList({ data: r.msg, type: "Error", dict: "na" });
|
this.addItemToList({ data: r.msg, type: "Error", dict: "na" });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this.userProfile.user.clear_search_after_query)
|
if (this.userProfile.user.clear_search_after_query)
|
||||||
$(".searchbar-input").val("");
|
$(".searchbar-input").val("");
|
||||||
|
|
||||||
this.userProfile.save(this.local);
|
this.userProfile.save(this.local);
|
||||||
}
|
}
|
||||||
catch (error)
|
catch (error)
|
||||||
{
|
{
|
||||||
this.addItemToList({ data: error, type: "Error", dict: "na" });
|
this.addItemToList({ data: error, type: "Error", dict: "na" });
|
||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
this.loader.dismiss();
|
this.loader.dismiss();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user