Skip to content
This repository has been archived by the owner on Mar 19, 2020. It is now read-only.

Commit

Permalink
Fix openVerse NET bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
MasterOfTheTiger committed Jul 2, 2018
1 parent f86a050 commit 2d9667b
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion app/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function getNETVerse(ref) {
document.getElementById('nettext').innerHTML = '<em>Check your Internet connection.</em>';
console.log('Offline ERROR');
} else {
url = 'https://labs.bible.org/api/?passage= ' + ref + '&formatting=full';
url = 'https://labs.bible.org/api/?passage= ' + ref;
fetch(url, {
mode: 'cors'
})
Expand Down Expand Up @@ -90,6 +90,16 @@ async function getVerses(reference, version) {
// Closes the error after 5 seconds
setTimeout(function () { document.getElementById('error').style.display = "none" }, 5000);
}
var bold = document.getElementsByTagName('b');
var a = chapterAndVerse(reference);
for (let i = 0; i < bold.length; i++) {
const element = bold[i];
element.addEventListener('click', function() {
console.log(reference);

openVerse(a.book.name + ' ' + a.chapter + ':' + i);
});
}
return result;
});
}
Expand Down

0 comments on commit 2d9667b

Please sign in to comment.