Added scripture ref to link.

This commit is contained in:
Benjamin A. Shelton 2026-08-06 19:02:04 -06:00
commit bd59a73859
Signed by: zancarius
GPG key ID: 8BD42DBD6C337E01
2 changed files with 5 additions and 5 deletions

View file

@ -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"/>

View file

@ -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;
@ -148,7 +146,7 @@ function render(dialog, response, refs) {
if ('poem' in v) { if ('poem' in v) {
para.classList.add('poem-'+v.poem); para.classList.add('poem-'+v.poem);
if (para.innerHTML.length != 0 || para.innerText.length != 0) { if (para.innerHTML.length != 0 || para.innerText.length != 0) {
section.insertAdjacentElement('beforeend', section.insertAdjacentElement('beforeend',
para); para);
} }
para = document.createElement('p'); para = document.createElement('p');
@ -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();
}); });
}; };