diff --git a/src/api/getbible_v2_api.js b/src/api/getbible_v2_api.js
index fc703bd..737e85b 100644
--- a/src/api/getbible_v2_api.js
+++ b/src/api/getbible_v2_api.js
@@ -4,6 +4,8 @@
let BASE_URL = 'https://getbible.net';
let API_VERSION = 'v2';
+export { BASE_URL, API_VERSION };
+
export default {
get_translations(){
diff --git a/src/api/idb.js b/src/api/idb.js
index 841b61f..4d2e194 100644
--- a/src/api/idb.js
+++ b/src/api/idb.js
@@ -27,6 +27,21 @@ export default {
let db = e.target.result;
db.createObjectStore("saved_translations", { keyPath:'abbreviation' });
db.createObjectStore("translations", { keyPath:'abbreviation' });
+
+ // let index = translations.createIndex('book_idx', 'name');
+ // let transaction = db.transaction("books"); // readonly
+ // let books = transaction.objectStore("books");
+ // let bookIndex = translations.index("book_idx");
+
+ // let request = bookIndex.getAll("Genesis");
+
+ // request.onsuccess = function() {
+ // if (request.result !== undefined) {
+ // console.log("Books", request.result); // array of books with name="Genesis"
+ // } else {
+ // console.log("No such books");
+ // }
+ // }
};
});
},
@@ -134,50 +149,50 @@ export default {
});
},
- async search(name, keyPath) {
+ // async search(name, keyPath) {
- let db = await this.getDb();
+ // let db = await this.getDb();
- return new Promise((resolve, reject) => {
+ // return new Promise((resolve, reject) => {
- let trans = db.transaction([name],'readonly');
- trans.oncomplete = () => {
- resolve(tr);
- };
+ // let trans = db.transaction([name],'readonly');
+ // trans.oncomplete = () => {
+ // resolve(tr);
+ // };
- let store = trans.objectStore(name);
- let tr = {};
+ // let store = trans.objectStore(name);
+ // let tr = {};
- store.openCursor().onsuccess = e => {
- let cursor = e.target.result;
- if (cursor) {
- if (keyPath == cursor.value.keyPath){
- tr = cursor.value
- for (const book in cursor.value.books) {
- for (const chapters in book) {
- for (const verses in chapters) {
- for (const verse in verses) {
- if(verse.text.includes(keyPath)){
- console.log("We found a row with value: " + JSON.stringify(verse.text));
- }
- }
- }
- }
- }
+ // store.openCursor().onsuccess = e => {
+ // let cursor = e.target.result;
+ // if (cursor) {
+ // if (keyPath == cursor.value.keyPath){
+ // tr = cursor.value
+ // for (const book in cursor.value.books) {
+ // for (const chapters in book) {
+ // for (const verses in chapters) {
+ // for (const verse in verses) {
+ // if(verse.text.includes(keyPath)){
+ // console.log("We found a row with value: " + JSON.stringify(verse.text));
+ // }
+ // }
+ // }
+ // }
+ // }
- }
- cursor.continue();
- }
- };
- trans.onerror = e => {
- reject(e)
- }
- trans.onabort = e => {
- reject(e)
- }
- trans.commit();
+ // }
+ // cursor.continue();
+ // }
+ // };
+ // trans.onerror = e => {
+ // reject(e)
+ // }
+ // trans.onabort = e => {
+ // reject(e)
+ // }
+ // trans.commit();
- });
- },
+ // });
+ // },
}
\ No newline at end of file
diff --git a/src/components/Options.vue b/src/components/Options.vue
index 79bd4f4..c8d5bb2 100644
--- a/src/components/Options.vue
+++ b/src/components/Options.vue
@@ -11,126 +11,127 @@
\ No newline at end of file
diff --git a/src/components/Selection.vue b/src/components/Selection.vue
index 64371d5..8883909 100644
--- a/src/components/Selection.vue
+++ b/src/components/Selection.vue
@@ -1,6 +1,6 @@
-
No translation added.
Please click
HERE to Open Settings
+
No translations added.
Please click
HERE to Open Settings
@@ -73,14 +73,14 @@ export default {
t(i){
return this.translations.find(t => t.abbreviation === i)
},
- set_translation(a) {
+ set_translation(a) {
console.log("Hello");
this.$store.dispatch('set_translation', {selected_translation:a})
},
set_book(b){
this.$store.dispatch('set_book', b)
},
- set_chapter(c){
+ set_chapter(c){
this.$store.dispatch('set_chapter', c)
},
open_settings(){
diff --git a/src/store/mutations.js b/src/store/mutations.js
index c471b90..01a22ee 100644
--- a/src/store/mutations.js
+++ b/src/store/mutations.js
@@ -3,34 +3,10 @@
export default {
add_translation (state, payload ) {
- // payload = {
- // translation:{
- // name: 'translation',
- // putObj: {}
- // },
- // saved_translations:{
- // name: 'saved_translation',
- // putObj: {}
- // }
- // }
-
-
state.saved_translations.push(payload.saved_translations.putObj)
},
REMOVE_TRANSLATION (state, payload ) {
- // payload example
- // payload = {
- // translation:{
- // name: 'translation',
- // keyPath: 'aksjv'
- // },
- // saved_translations:{
- // name: 'saved_translation',
- // keyPath: "askjv"
- // }
- // }
-
const {keyPath} = payload.saved_translations;