Removed debugging output.
This commit is contained in:
parent
639dba4520
commit
011142c578
1 changed files with 0 additions and 61 deletions
|
|
@ -145,7 +145,6 @@ function render(dialog, response, refs) {
|
|||
default:
|
||||
console.error('unhandled type:', c.type);
|
||||
}
|
||||
//console.log(c);
|
||||
}
|
||||
section.insertAdjacentElement('beforeend', para);
|
||||
article.insertAdjacentElement('beforeend', section);
|
||||
|
|
@ -223,18 +222,13 @@ class RenderScripture {
|
|||
txnOnChange(evt) {
|
||||
const tx = evt.target.selectedOptions[0].value;
|
||||
this.translation = tx;
|
||||
console.log(tx, this.ls);
|
||||
if (this.ls) {
|
||||
localStorage.setItem('__translation', tx);
|
||||
}
|
||||
console.log(this.translation);
|
||||
console.log(this.dialog[0])
|
||||
console.log(this.dialog[0]?.getAttribute('data-scripture'))
|
||||
const refs = parseRef(this.dialog[0]?.getAttribute('data-scripture'));
|
||||
this.dialog[0]?.querySelector('article')?.replaceChildren();
|
||||
this.dialog[0]?.querySelector('.spinner svg')
|
||||
.classList.remove('hidden');
|
||||
console.log(refs);
|
||||
this.readScripture(refs);
|
||||
}
|
||||
|
||||
|
|
@ -339,59 +333,4 @@ export const bindModals = () => {
|
|||
const elems = document.querySelectorAll('a[data-scripture]');
|
||||
const dialog = document.querySelectorAll('dialog[data-scripture]');
|
||||
const renderer = new RenderScripture(dialog);
|
||||
/*let translation = 'BSB';
|
||||
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();
|
||||
const uri = `https://bible.helloao.org/api/${tx}/${refs.book.toUpperCase()}/${refs.chapter}.json`;
|
||||
dialog[0]?.showModal();
|
||||
dialog[0]?.setAttribute('data-scripture', scripture);
|
||||
dialog[0]?.classList.remove("hidden");
|
||||
dialog[0]?.querySelector('.spinner svg')
|
||||
.classList.remove('hidden');
|
||||
|
||||
fetch(uri)
|
||||
.then((response) => {
|
||||
return response.json();
|
||||
})
|
||||
.then((response) => {
|
||||
render(dialog[0], response, refs);
|
||||
dialog[0]?.querySelector('.spinner svg')
|
||||
.classList.add('hidden');
|
||||
});
|
||||
});
|
||||
});
|
||||
dialog[0]?.addEventListener('click', (evt) => {
|
||||
if (evt.target === dialog[0]) {
|
||||
dialog[0]?.close();
|
||||
dialog[0]?.classList.add('hidden');
|
||||
dialog[0]?.querySelector('article')?.replaceChildren();
|
||||
}
|
||||
});
|
||||
dialog[0]?.querySelector('button[data-close]')?.addEventListener('click', (evt) => {
|
||||
evt.preventDefault();
|
||||
dialog[0]?.close();
|
||||
dialog[0]?.classList.add('hidden');
|
||||
dialog[0]?.querySelector('article')?.replaceChildren();
|
||||
});
|
||||
const sel = dialog[0]?.querySelector('select.translation');
|
||||
console.log(sel);
|
||||
sel?.replaceChildren();
|
||||
for (const tx in translations) {
|
||||
const opt = document.createElement('option');
|
||||
opt.setAttribute('value', tx);
|
||||
opt.insertAdjacentText('beforeend', translations[tx][0]);
|
||||
if (tx == translation) {
|
||||
opt.setAttribute('selected', 'selected');
|
||||
}
|
||||
sel?.insertAdjacentElement('beforeend', opt);
|
||||
}
|
||||
sel?.addEventListener('change', (evt) => {
|
||||
console.log('onchange');
|
||||
console.log(evt);
|
||||
console.log(evt.target.selectedOptions[0].value);
|
||||
});*/
|
||||
};
|
||||
Loading…
Reference in a new issue