Removed debugging output from console.
This commit is contained in:
parent
2f95b6c80a
commit
45c4b8ad6e
1 changed files with 0 additions and 12 deletions
|
|
@ -11,19 +11,13 @@ const translations = {
|
|||
};
|
||||
|
||||
function parseRef(ref) {
|
||||
console.log(ref);
|
||||
ref = ref.replace(/%3[Aa]/, ':').replace(/\+/, ' ');
|
||||
console.log(ref);
|
||||
const m = ref.match(/((\d+(\+|\s))?[a-zA-Z]+)(\+|\s)?([0-9]+)?\:?([0-9]+(-?[0-9]+)?)?/);
|
||||
|
||||
console.log(m);
|
||||
|
||||
const book = m[1].toLowerCase();
|
||||
const chapter = m[5];
|
||||
const verses = m[6]?.replaceAll(/–/g, '-');
|
||||
|
||||
console.log(`parseRef: ${book}, ${chapter}, ${verses}`);
|
||||
|
||||
if (book === undefined) {
|
||||
return {};
|
||||
}
|
||||
|
|
@ -65,7 +59,6 @@ function parseRef(ref) {
|
|||
};
|
||||
}
|
||||
}
|
||||
console.log(refdata, book);
|
||||
|
||||
if ('verses' in refdata) {
|
||||
if (refdata.verses.start < 1) {
|
||||
|
|
@ -90,8 +83,6 @@ function render(dialog, response, refs) {
|
|||
return;
|
||||
}
|
||||
|
||||
console.log('render refs:', refs);
|
||||
|
||||
const section = document.createElement('section');
|
||||
const article = dialog?.querySelector('article');
|
||||
let para = document.createElement('p');
|
||||
|
|
@ -168,15 +159,12 @@ function render(dialog, response, refs) {
|
|||
export const bindModals = () => {
|
||||
const elems = document.querySelectorAll('a[data-scripture]');
|
||||
const dialog = document.querySelectorAll('dialog[data-scripture]');
|
||||
console.log(dialog);
|
||||
elems.forEach((e) => {
|
||||
e.addEventListener('click', (evt) => {
|
||||
const scripture = e.attributes.getNamedItem('data-scripture');
|
||||
const refs = parseRef(scripture.value);
|
||||
const tx = refs.meta?.tx || 'BSB';
|
||||
evt.preventDefault();
|
||||
console.log('scripture:', scripture);
|
||||
console.log('refs:', refs);
|
||||
const uri = `https://bible.helloao.org/api/${tx}/${refs.book.toUpperCase()}/${refs.chapter}.json`;
|
||||
dialog[0]?.showModal();
|
||||
dialog[0]?.setAttribute('data-scripture', scripture);
|
||||
|
|
|
|||
Loading…
Reference in a new issue