Update scripts

This commit is contained in:
Ryan Prather 2024-05-23 17:42:21 -04:00
parent 050b0cd8f7
commit 216ef0d1ec

View File

@ -380,13 +380,20 @@ function openRef(closeSidebar = true) {
}
function closeRef() {
refQuery = document.querySelector('#refQuery');
refQuery.style.display = 'none';
document.querySelector('#referenceSearch').value = '';
document.querySelector('#referenceSearch').style.display = '';
document.querySelector('#referenceType').value = '';
document.querySelector('#referenceBook').value = '';
document.querySelector('#referenceBook').style.display = 'none';
document.querySelector('#chapter-range').innerText = '';
document.querySelector('#verse-range').innerText = '';
document.querySelector('#refQuery').style.display = 'none';
}
function queryRef(type = null, book = null, input = null) {
if (!input) {
var input = document.querySelector('#refQuery #search').value;
var input = document.querySelector('#refQuery #referenceSearch').value;
}
if (!type) {
var type = document.querySelector('#referenceType').value;
@ -419,11 +426,6 @@ function queryRef(type = null, book = null, input = null) {
references[results.title] = results.text;
input.value = '';
document.querySelector('#referenceType').value = '';
document.querySelector('#referenceBook').value = '';
document.querySelector('#referenceBook').style.display = 'none';
document.querySelector('#refQuery #search').value = '';
closeRef();
saved = false;
@ -532,6 +534,7 @@ function retrieveBooks() {
document.querySelector('#chapter-range').innerText = '';
document.querySelector('#verse-range').innerText = '';
document.querySelector('#referenceSearch').value = '';
document.querySelector('#referenceSearch').style.display = 'none';
const selectedType = document.querySelector('#referenceType').value;
if (!selectedType) { return; }
@ -539,6 +542,7 @@ function retrieveBooks() {
bookList.style.display = "block";
bookList.innerHTML = '';
if (selectedType == 'bible') {
document.querySelector('#referenceSearch').style.display = 'block';
var none = document.createElement("option");
none.value = '';
none.text = '-- Select --';