scripture-viewer/BibleServerCli/data/www/book/index.html

80 lines
2.9 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Scripture Viewer</title>
<link rel="stylesheet" href="./bulma.min.css">
</head>
<body>
<section class="hero is-primary">
<div class="hero-body">
<p class="title">
Scripture Viewer
</p>
<p class="subtitle">
Read The Bible in browser
</p>
</div>
</section>
<nav class="breadcrumb" aria-label="breadcrumbs">
<ul>
<li><a href="./">Home</a></li>
<li><a href="./" id="bible_link">Bible</a></li>
<li class="is-active"><a href="#" id="book_link" aria-current="page">Book</a></li>
</ul>
</nav>
<article class="tile is-child notification ">
<p class="title">Chapter Select</p>
<p class="subtitle" id="subtitle">Select a chapter from...</p>
<div class="content" id="chapters">
</div>
</article>
<script>
const chapters = document.getElementById('chapters');
const subtitle = document.getElementById('subtitle');
const bible_link = document.getElementById('bible_link');
const book_link = document.getElementById('book_link');
//List Of Books in the
function init()
{
const params = new Proxy(new URLSearchParams(window.location.search), {
get: (searchParams, prop) => searchParams.get(prop),
});
// Get the value of "some_key" in eg "https://example.com/?some_key=some_value"
let bible = params.bible; // "some_value"
let book = params.book;
bible_link.href=`./bible?bible=${encodeURIComponent(bible)}`;
bible_link.innerText=bible;
book_link.innerText=book;
subtitle.innerText = `Select a chapter from ${book}`;
fetch(`./api/v1/GetChapterCount${window.location.search}`).then(e=>e.json()).then(e=>{
/* e.Books.forEach(element => {
var b = document.createElement('a');
b.href = `./book?bible=${encodeURIComponent(bible)}&book=${encodeURIComponent(element)}`;
b.innerText = element;
books.appendChild(b);
books.appendChild(document.createElement('br'))
});*/
for(i=0;i<e;i++)
{
var link = document.createElement('a');
link.classList.add('button');
link.classList.add('is-primary');
link.href=`./chapter${window.location.search}&chapter=${i+1}`;
link.innerText = (i+1);
chapters.appendChild(link);
}
});
}
init();
</script>
</body>
</html>