Removed debugging output from console.

This commit is contained in:
Benjamin A. Shelton 2026-08-18 14:56:56 -06:00
commit bf5a36d590
Signed by: zancarius
GPG key ID: 8BD42DBD6C337E01

View file

@ -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);