+
\ No newline at end of file
diff --git a/DynamicBibleIonic/src/components/strongs/strongs.scss b/DynamicBibleIonic/src/components/strongs/strongs.scss
new file mode 100644
index 00000000..d6d560f0
--- /dev/null
+++ b/DynamicBibleIonic/src/components/strongs/strongs.scss
@@ -0,0 +1,3 @@
+strongs ion-scroll {
+ height: 250px;
+}
\ No newline at end of file
diff --git a/DynamicBibleIonic/src/components/words/words.scss b/DynamicBibleIonic/src/components/words/words.scss
new file mode 100644
index 00000000..e8cfe2aa
--- /dev/null
+++ b/DynamicBibleIonic/src/components/words/words.scss
@@ -0,0 +1,17 @@
+
+words ion-scroll {
+ white-space: nowrap;
+ height: 250px;
+}
+
+ion-col .button{
+ background-color: #fbfbfb;
+ padding: 9px 6px 9px 6px;
+ width: 100%;
+ height: 100%;
+}
+
+
+ion-col {
+ margin-bottom: 0px !important;
+}
\ No newline at end of file
diff --git a/DynamicBibleIonic/src/mocks.ts b/DynamicBibleIonic/src/mocks.ts
new file mode 100644
index 00000000..9ca6a322
--- /dev/null
+++ b/DynamicBibleIonic/src/mocks.ts
@@ -0,0 +1,82 @@
+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();
+ });
+ }
+}
\ No newline at end of file
diff --git a/DynamicBibleIonic/src/pages/search/search.scss b/DynamicBibleIonic/src/pages/search/search.scss
index aecf4831..f097f209 100644
--- a/DynamicBibleIonic/src/pages/search/search.scss
+++ b/DynamicBibleIonic/src/pages/search/search.scss
@@ -28,23 +28,3 @@ body {
.card-md h2 {
font-size: 2rem;
}
-
-ion-scroll {
- white-space: nowrap;
- height: 250px;
-}
-
-ion-col {
- //border-bottom: 1px solid #cbcbcb !important;
-}
-
-ion-col .button{
- background-color: #fbfbfb;
- padding: 9px 6px 9px 6px;
- width: 100%;
- height: 100%;
-}
-
-ion-col {
- margin-bottom: 0px !important;
-}
\ No newline at end of file
diff --git a/DynamicBibleIonic/src/pages/search/search.ts b/DynamicBibleIonic/src/pages/search/search.ts
index 6dd433ef..05d55163 100644
--- a/DynamicBibleIonic/src/pages/search/search.ts
+++ b/DynamicBibleIonic/src/pages/search/search.ts
@@ -5,11 +5,9 @@ import {BibleService} from "../../bible-service";
import {LoadingController, ModalController } from "ionic-angular";
import {StrongsService} from "../../strongs-service";
import {WordService} from "../../word-service";
-import {Strongs} from "../../components/strongs/strongs";
-import {Passage} from "../../components/passage/passage.ts";
import {StrongsModal} from "../../components/strongs-modal/strongs-modal.ts";
import {Storage} from '@ionic/storage';
-import {Words} from '../../components/words/words.ts';
+import {UserHelpers} from '../../Helpers';
class Item
{
@@ -27,7 +25,7 @@ export class SearchPage
{
searchQuery: string = "";
last: number;
- user: User = { strongs_modal: true, clear_search_after_query: true, items: [] };
+ user: User = { strongs_modal: true, clear_search_after_query: true, items: [], append_to_bottom: false };
constructor(
private strongsService: StrongsService
@@ -44,9 +42,9 @@ export class SearchPage
if (profile === null)
this.local.set('profile', JSON.stringify(this.user));
else
- {
t = JSON.parse(profile);
- }
+
+ new UserHelpers(local).validate(this.user, t);
this.initializeItems(t);
}).catch(error =>
@@ -105,6 +103,14 @@ export class SearchPage
this.local.set('profile', JSON.stringify(this.user));
}
+ addItemToList(item)
+ {
+ if (this.user.append_to_bottom)
+ this.user.items.push(item);
+ else
+ this.user.items.unshift(item);
+ }
+
getItems(search)
{
try
@@ -121,7 +127,7 @@ export class SearchPage
if (q.search(/[0-9]/i) === -1)
{
let result = this.wordService.getResult(q);
- this.user.items.unshift({ id: this.last++, data: result, type: "Words", dict: "na" });
+ this.addItemToList({ id: this.last++, data: result, type: "Words", dict: "na" });
}
else if (q.search(/(H|G)[0-9]/i) !== -1)
{
@@ -140,7 +146,7 @@ export class SearchPage
if (this.user.strongs_modal)
this.presentStrongsModal(result);
else
- this.user.items.unshift({ id: this.last++, data: result, type: "Strongs", dict: "na" });
+ this.addItemToList({ id: this.last++, data: result, type: "Strongs", dict: "na" });
}
else
{
@@ -150,7 +156,7 @@ export class SearchPage
let myref = new Reference(q.trim());
let r = this.bibleService.getResult(myref.Section);
r.ref = myref.toString();
- this.user.items.unshift({ id: this.last++, data: r, type: "Passage", dict: r.testament == 'new' ? "G" : "H" });
+ this.addItemToList({ id: this.last++, data: r, type: "Passage", dict: r.testament == 'new' ? "G" : "H" });
}
}
}
diff --git a/DynamicBibleIonic/src/pages/settings/settings.html b/DynamicBibleIonic/src/pages/settings/settings.html
index 157370c5..ef11b832 100644
--- a/DynamicBibleIonic/src/pages/settings/settings.html
+++ b/DynamicBibleIonic/src/pages/settings/settings.html
@@ -8,15 +8,21 @@
-
- Show Strongs as Modal
-
-
-
- Clear Search Bar after Query
-
-
-
-
-
+
+
+ Show Strongs as Modal
+
+
+
+ Clear Search Bar after Query
+
+
+
+ Append Results to the Bottom of List
+
+
+
+
+
+
\ No newline at end of file
diff --git a/DynamicBibleIonic/src/pages/settings/settings.ts b/DynamicBibleIonic/src/pages/settings/settings.ts
index e1d9a0a4..9fe4214c 100644
--- a/DynamicBibleIonic/src/pages/settings/settings.ts
+++ b/DynamicBibleIonic/src/pages/settings/settings.ts
@@ -2,6 +2,7 @@
import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import { Storage } from '@ionic/storage';
+import {UserHelpers} from '../../Helpers';
@Component({
selector: 'settings',
@@ -9,17 +10,20 @@ import { Storage } from '@ionic/storage';
})
export class SettingsPage
{
- user: User = { strongs_modal: true, clear_search_after_query: true, items: [] };
+ user: User = { strongs_modal: true, clear_search_after_query: true, items: [], append_to_bottom: false };
constructor(public navCtrl: NavController, public local: Storage)
{
// Check if there is a profile saved in local storage
this.local.get('profile').then(profile =>
{
- if (profile === null)
- this.save();
- else
- this.user = JSON.parse(profile);
+ let t = this.user;
+
+ if (profile !== null)
+ t = JSON.parse(profile);
+
+ new UserHelpers(local).validate(this.user, t);
+ this.user = t;
}).catch(error =>
{
console.log(error);
@@ -33,7 +37,7 @@ export class SettingsPage
reset()
{
- this.user = { strongs_modal: true, clear_search_after_query: true, items: [] };
+ this.user = { strongs_modal: true, clear_search_after_query: true, items: [], append_to_bottom: false };
this.save();
}
diff --git a/DynamicBibleIonic/src/polyfills.ts b/DynamicBibleIonic/src/polyfills.ts
new file mode 100644
index 00000000..4f829e14
--- /dev/null
+++ b/DynamicBibleIonic/src/polyfills.ts
@@ -0,0 +1,19 @@
+// 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';
\ No newline at end of file
diff --git a/DynamicBibleIonic/src/types.ts b/DynamicBibleIonic/src/types.ts
index 21835783..070f1cce 100644
--- a/DynamicBibleIonic/src/types.ts
+++ b/DynamicBibleIonic/src/types.ts
@@ -15,7 +15,8 @@ type CardItem = { id: number, data: any, type: string, dict: string }
type User = {
strongs_modal: boolean,
clear_search_after_query: boolean,
- items: CardItem[]
+ items: CardItem[],
+ append_to_bottom: boolean
}
type BiblePassage = {
diff --git a/DynamicBibleIonic/typings/browser.d.ts b/DynamicBibleIonic/typings/browser.d.ts
index c0dec551..39b21deb 100644
--- a/DynamicBibleIonic/typings/browser.d.ts
+++ b/DynamicBibleIonic/typings/browser.d.ts
@@ -1,2 +1,2 @@
-///
+///
///
diff --git a/DynamicBibleIonic/typings/browser/ambient/es6-shim/index.d.ts b/DynamicBibleIonic/typings/browser/ambient/es6-shim/index.d.ts
deleted file mode 100644
index fe86f5ed..00000000
--- a/DynamicBibleIonic/typings/browser/ambient/es6-shim/index.d.ts
+++ /dev/null
@@ -1,670 +0,0 @@
-// Generated by typings
-// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/7de6c3dd94feaeb21f20054b9f30d5dabc5efabd/es6-shim/es6-shim.d.ts
-// Type definitions for es6-shim v0.31.2
-// Project: https://github.com/paulmillr/es6-shim
-// Definitions by: Ron Buckton
-// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-
-declare type PropertyKey = string | number | symbol;
-
-interface IteratorResult {
- done: boolean;
- value?: T;
-}
-
-interface IterableShim {
- /**
- * Shim for an ES6 iterable. Not intended for direct use by user code.
- */
- "_es6-shim iterator_"(): Iterator;
-}
-
-interface Iterator {
- next(value?: any): IteratorResult;
- return?(value?: any): IteratorResult;
- throw?(e?: any): IteratorResult;
-}
-
-interface IterableIteratorShim extends IterableShim, Iterator {
- /**
- * Shim for an ES6 iterable iterator. Not intended for direct use by user code.
- */
- "_es6-shim iterator_"(): IterableIteratorShim;
-}
-
-interface StringConstructor {
- /**
- * Return the String value whose elements are, in order, the elements in the List elements.
- * If length is 0, the empty string is returned.
- */
- fromCodePoint(...codePoints: number[]): string;
-
- /**
- * String.raw is intended for use as a tag function of a Tagged Template String. When called
- * as such the first argument will be a well formed template call site object and the rest
- * parameter will contain the substitution values.
- * @param template A well-formed template string call site representation.
- * @param substitutions A set of substitution values.
- */
- raw(template: TemplateStringsArray, ...substitutions: any[]): string;
-}
-
-interface String {
- /**
- * Returns a nonnegative integer Number less than 1114112 (0x110000) that is the code point
- * value of the UTF-16 encoded code point starting at the string element at position pos in
- * the String resulting from converting this object to a String.
- * If there is no element at that position, the result is undefined.
- * If a valid UTF-16 surrogate pair does not begin at pos, the result is the code unit at pos.
- */
- codePointAt(pos: number): number;
-
- /**
- * Returns true if searchString appears as a substring of the result of converting this
- * object to a String, at one or more positions that are
- * greater than or equal to position; otherwise, returns false.
- * @param searchString search string
- * @param position If position is undefined, 0 is assumed, so as to search all of the String.
- */
- includes(searchString: string, position?: number): boolean;
-
- /**
- * Returns true if the sequence of elements of searchString converted to a String is the
- * same as the corresponding elements of this object (converted to a String) starting at
- * endPosition – length(this). Otherwise returns false.
- */
- endsWith(searchString: string, endPosition?: number): boolean;
-
- /**
- * Returns a String value that is made from count copies appended together. If count is 0,
- * T is the empty String is returned.
- * @param count number of copies to append
- */
- repeat(count: number): string;
-
- /**
- * Returns true if the sequence of elements of searchString converted to a String is the
- * same as the corresponding elements of this object (converted to a String) starting at
- * position. Otherwise returns false.
- */
- startsWith(searchString: string, position?: number): boolean;
-
- /**
- * Returns an HTML anchor element and sets the name attribute to the text value
- * @param name
- */
- anchor(name: string): string;
-
- /** Returns a HTML element */
- big(): string;
-
- /** Returns a