Added scripture ref to link.
This commit is contained in:
parent
1763a427ba
commit
bd59a73859
2 changed files with 5 additions and 5 deletions
|
|
@ -44,8 +44,6 @@ function parseRef(ref) {
|
|||
return title;
|
||||
};
|
||||
|
||||
console.log('refdata:', refdata, book, _map);
|
||||
|
||||
if (chapter !== undefined) {
|
||||
refdata['chapter'] = parseInt(chapter);
|
||||
}
|
||||
|
|
@ -95,13 +93,13 @@ function render(dialog, response, refs) {
|
|||
let para = document.createElement('p');
|
||||
|
||||
dialog.querySelector('a.bg').href = `https://www.biblegateway.com/passage/?search=${refs.ref}&version=ESV`
|
||||
dialog.querySelector('a.bg span').insertAdjacentText('beforeend', refs.fullTitle());
|
||||
|
||||
const heading = document.createElement('h1');
|
||||
heading.insertAdjacentText('beforeend',
|
||||
`${refs.fullTitle()}`);
|
||||
article.insertAdjacentElement('beforeend', heading);
|
||||
|
||||
|
||||
for (const c of content) {
|
||||
if (c.type === 'heading') {
|
||||
continue;
|
||||
|
|
@ -148,7 +146,7 @@ function render(dialog, response, refs) {
|
|||
if ('poem' in v) {
|
||||
para.classList.add('poem-'+v.poem);
|
||||
if (para.innerHTML.length != 0 || para.innerText.length != 0) {
|
||||
section.insertAdjacentElement('beforeend',
|
||||
section.insertAdjacentElement('beforeend',
|
||||
para);
|
||||
}
|
||||
para = document.createElement('p');
|
||||
|
|
@ -197,6 +195,7 @@ export const bindModals = () => {
|
|||
if (evt.target === dialog[0]) {
|
||||
dialog[0]?.close();
|
||||
dialog[0]?.querySelector('article')?.replaceChildren();
|
||||
dialog[0]?.querySelector('a.bg span').replaceChildren();
|
||||
}
|
||||
});
|
||||
dialog[0]?.querySelector('button[data-close]')?.addEventListener('click', (evt) => {
|
||||
|
|
@ -204,6 +203,7 @@ export const bindModals = () => {
|
|||
dialog[0]?.close();
|
||||
dialog[0]?.classList.add('hidden');
|
||||
dialog[0]?.querySelector('article')?.replaceChildren();
|
||||
dialog[0]?.querySelector('a.bg span').replaceChildren();
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue