summaryrefslogtreecommitdiff
path: root/src/scripts/quran.js
diff options
context:
space:
mode:
authoraltaf-creator <athaalaa@gmail.com>2023-07-17 14:16:21 +0700
committeraltaf-creator <athaalaa@gmail.com>2023-07-17 14:16:21 +0700
commit12efa76e679624563d508685ac17d411c3c4441e (patch)
tree449f9a18206aff346522c214ad9e95a26c42c29e /src/scripts/quran.js
parent0b7f5bb72a6cb913927e3b1dd4024287a9b26d29 (diff)
Added zoom feature, Added sura index
Diffstat (limited to 'src/scripts/quran.js')
-rw-r--r--src/scripts/quran.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/scripts/quran.js b/src/scripts/quran.js
index c50d9c0..5fac7b5 100644
--- a/src/scripts/quran.js
+++ b/src/scripts/quran.js
@@ -78,7 +78,7 @@ function loadSura(xml, translationIndex, index) {
var children = sura[suraIndex].children;
- txt += "<ol>"
+ txt += "<ol id=\"sura-ol\">"
for (var i = 0; i < children.length; i++) {
txt += `<li class="sura-li">${children[i].getAttribute('text')}</li>
<p id="t-${i}"></p>
@@ -88,8 +88,7 @@ function loadSura(xml, translationIndex, index) {
loadTranslation(index, translationIndex);
- document.getElementById("header").innerHTML = metadata[3] +
- " - <b>" + sura[suraIndex].getAttribute('name') + "</b>";
+ document.getElementById("header").innerHTML = metadata[0] + ": " + metadata[3] + " - <b>" + sura[suraIndex].getAttribute('name') + "</b>";
document.getElementById("navbar-text").innerHTML = metadata[3] +
" - <b>" + sura[suraIndex].getAttribute('name') + "</b>";
document.getElementById("subheader").innerHTML = metadata[1] + " Aya <br>" + metadata[4];
@@ -169,7 +168,7 @@ function loadMetadataButtons(xml) {
var index = sura[i].getAttribute('index');
var tname = sura[i].getAttribute('tname');
- document.getElementById("sidebar-sura").innerHTML += `<a class="side-buttons" href="#" onclick="load(${index}, ${tIndex})"><i class="fa-solid fa-book-quran"></i> ${tname}</a>`;
+ document.getElementById("sidebar-sura").innerHTML += `<a class="side-buttons" href="#" onclick="load(${index}, ${tIndex}); updateZoom()"><i class="fa-solid fa-book-quran"></i> ${index}: ${tname}</a>`;
}
}
@@ -200,4 +199,6 @@ function loadTranslationAya(xml, index, aya) {
txt = children[i].getAttribute("text");
document.getElementById(`t-${i}`).innerHTML = txt;
}
+
+ updateZoom();
}