Added scripture ref to link.
This commit is contained in:
parent
1763a427ba
commit
bd59a73859
2 changed files with 5 additions and 5 deletions
|
|
@ -74,7 +74,7 @@ const meta = `{
|
||||||
</article>
|
</article>
|
||||||
<nav>
|
<nav>
|
||||||
<a href="#" class="bg">
|
<a href="#" class="bg">
|
||||||
Open on Bible Gateway
|
Open <span class="underline"></span> on Bible Gateway
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-link inline" viewBox="0 0 16 16">
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-link inline" viewBox="0 0 16 16">
|
||||||
<path d="M6.354 5.5H4a3 3 0 0 0 0 6h3a3 3 0 0 0 2.83-4H9q-.13 0-.25.031A2 2 0 0 1 7 10.5H4a2 2 0 1 1 0-4h1.535c.218-.376.495-.714.82-1z"/>
|
<path d="M6.354 5.5H4a3 3 0 0 0 0 6h3a3 3 0 0 0 2.83-4H9q-.13 0-.25.031A2 2 0 0 1 7 10.5H4a2 2 0 1 1 0-4h1.535c.218-.376.495-.714.82-1z"/>
|
||||||
<path d="M9 5.5a3 3 0 0 0-2.83 4h1.098A2 2 0 0 1 9 6.5h3a2 2 0 1 1 0 4h-1.535a4 4 0 0 1-.82 1H12a3 3 0 1 0 0-6z"/>
|
<path d="M9 5.5a3 3 0 0 0-2.83 4h1.098A2 2 0 0 1 9 6.5h3a2 2 0 1 1 0 4h-1.535a4 4 0 0 1-.82 1H12a3 3 0 1 0 0-6z"/>
|
||||||
|
|
|
||||||
|
|
@ -44,8 +44,6 @@ function parseRef(ref) {
|
||||||
return title;
|
return title;
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log('refdata:', refdata, book, _map);
|
|
||||||
|
|
||||||
if (chapter !== undefined) {
|
if (chapter !== undefined) {
|
||||||
refdata['chapter'] = parseInt(chapter);
|
refdata['chapter'] = parseInt(chapter);
|
||||||
}
|
}
|
||||||
|
|
@ -95,13 +93,13 @@ function render(dialog, response, refs) {
|
||||||
let para = document.createElement('p');
|
let para = document.createElement('p');
|
||||||
|
|
||||||
dialog.querySelector('a.bg').href = `https://www.biblegateway.com/passage/?search=${refs.ref}&version=ESV`
|
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');
|
const heading = document.createElement('h1');
|
||||||
heading.insertAdjacentText('beforeend',
|
heading.insertAdjacentText('beforeend',
|
||||||
`${refs.fullTitle()}`);
|
`${refs.fullTitle()}`);
|
||||||
article.insertAdjacentElement('beforeend', heading);
|
article.insertAdjacentElement('beforeend', heading);
|
||||||
|
|
||||||
|
|
||||||
for (const c of content) {
|
for (const c of content) {
|
||||||
if (c.type === 'heading') {
|
if (c.type === 'heading') {
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -197,6 +195,7 @@ export const bindModals = () => {
|
||||||
if (evt.target === dialog[0]) {
|
if (evt.target === dialog[0]) {
|
||||||
dialog[0]?.close();
|
dialog[0]?.close();
|
||||||
dialog[0]?.querySelector('article')?.replaceChildren();
|
dialog[0]?.querySelector('article')?.replaceChildren();
|
||||||
|
dialog[0]?.querySelector('a.bg span').replaceChildren();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
dialog[0]?.querySelector('button[data-close]')?.addEventListener('click', (evt) => {
|
dialog[0]?.querySelector('button[data-close]')?.addEventListener('click', (evt) => {
|
||||||
|
|
@ -204,6 +203,7 @@ export const bindModals = () => {
|
||||||
dialog[0]?.close();
|
dialog[0]?.close();
|
||||||
dialog[0]?.classList.add('hidden');
|
dialog[0]?.classList.add('hidden');
|
||||||
dialog[0]?.querySelector('article')?.replaceChildren();
|
dialog[0]?.querySelector('article')?.replaceChildren();
|
||||||
|
dialog[0]?.querySelector('a.bg span').replaceChildren();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue