Added heading.
This commit is contained in:
parent
c92ad82fe2
commit
1763a427ba
2 changed files with 24 additions and 2 deletions
|
|
@ -151,6 +151,9 @@ dialog.scripture {
|
|||
text-transform: uppercase;
|
||||
}
|
||||
}
|
||||
h1 {
|
||||
@apply font-bold mb-2 text-2xl;
|
||||
}
|
||||
nav {
|
||||
@apply mt-8;
|
||||
a {
|
||||
|
|
|
|||
|
|
@ -31,11 +31,23 @@ function parseRef(ref) {
|
|||
refdata.book = _map[book];
|
||||
}
|
||||
refdata.meta = books[refdata.book];
|
||||
refdata.fullTitle = () => {
|
||||
let title = refdata.meta.title+' ';
|
||||
title += refdata.chapter;
|
||||
|
||||
if (refdata.verses?.start > 0) {
|
||||
title += ':'+refdata.verses.start;
|
||||
}
|
||||
if (refdata.verses?.end > 0 && refdata.verses?.end > refdata.verses?.start) {
|
||||
title += '-'+refdata.verses.end;
|
||||
}
|
||||
return title;
|
||||
};
|
||||
|
||||
console.log('refdata:', refdata, book, _map);
|
||||
|
||||
if (chapter !== undefined) {
|
||||
refdata['chapter'] = chapter;
|
||||
refdata['chapter'] = parseInt(chapter);
|
||||
}
|
||||
|
||||
if (verses !== undefined) {
|
||||
|
|
@ -79,10 +91,17 @@ function render(dialog, response, refs) {
|
|||
console.log('render refs:', refs);
|
||||
|
||||
const section = document.createElement('section');
|
||||
const article = dialog?.querySelector('article');
|
||||
let para = document.createElement('p');
|
||||
|
||||
dialog.querySelector('a.bg').href = `https://www.biblegateway.com/passage/?search=${refs.ref}&version=ESV`
|
||||
|
||||
const heading = document.createElement('h1');
|
||||
heading.insertAdjacentText('beforeend',
|
||||
`${refs.fullTitle()}`);
|
||||
article.insertAdjacentElement('beforeend', heading);
|
||||
|
||||
|
||||
for (const c of content) {
|
||||
if (c.type === 'heading') {
|
||||
continue;
|
||||
|
|
@ -144,7 +163,7 @@ function render(dialog, response, refs) {
|
|||
//console.log(c);
|
||||
}
|
||||
section.insertAdjacentElement('beforeend', para);
|
||||
dialog?.querySelector('article').insertAdjacentElement('beforeend', section);
|
||||
article.insertAdjacentElement('beforeend', section);
|
||||
}
|
||||
|
||||
export const bindModals = () => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue