Skip to content

Commit

Permalink
Url -> URL and other fixes to url presentation
Browse files Browse the repository at this point in the history
  • Loading branch information
AfzGit committed Jul 17, 2024
1 parent e7b3bfa commit f55d802
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ <h4 id="tafsir-print" style="background-color: rgb(239, 204, 157)">
<h4 id="copy-status" style="background-color: darkgoldenrod">
Clipboard
</h4>
<h3 id="result" style="background-color: rosybrown">Urls</h3>
<h3 id="result" style="background-color: rosybrown">URLs</h3>
<p id="jump-bottom"></p>
</div>
<script src="script.js"></script>
Expand Down
18 changes: 11 additions & 7 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ const site2 = "https://quranwbw.com/";
// https://tanzil.net/#2:6
const site3 = "https://tanzil.net/";

const jump = `<a href="#quran">Quran</a> - <a href="#copy-status">Clipboard</a> - <a href="#result">Urls</a>`;
const jumpTafsir = `<a href="#quran">Quran</a> - <a href="#tafsir-print">Tafsir</a> - <a href="#copy-status">Clipboard</a> - <a href="#result">Urls</a>`;
const jump = `<a href="#quran">Quran</a> - <a href="#copy-status">Clipboard</a> - <a href="#result">URLs</a>`;
const jumpTafsir = `<a href="#quran">Quran</a> - <a href="#tafsir-print">Tafsir</a> - <a href="#copy-status">Clipboard</a> - <a href="#result">URLs</a>`;

// copy variables
let fullc, arc, enc, tafsirCopy;
Expand Down Expand Up @@ -199,20 +199,24 @@ document.getElementById("urlForm").addEventListener("submit", function (e) {
"buttons"
).innerHTML = `<button type="submit" onclick="document.getElementById('ayah-num').value = parseInt(document.getElementById('ayah-num').value) - 1;" > Prev </button> - <button type="submit" onclick="document.getElementById('ayah-num').value = parseInt(document.getElementById('ayah-num').value) + 1;" > Next </button>`;

// URLs
document.getElementById("result").innerHTML =
"URLs<hr class='black-hr'>";

// QuranCom
document.getElementById(
"result"
).innerHTML = `<li><a href="${url1}" target="_blank">${surah}:${ayahNum} on Quran.com</a></li>`;
).innerHTML += `<li>Quran.com: <a href="${url1}" target="_blank">${surah}:${ayahNum}</a></li>`;

// QuranWBW
document.getElementById(
"result"
).innerHTML += `<li><a href="${url2}" target="_blank">${surah}:${ayahNum} on QuranWBW</a></li>`;
).innerHTML += `<li>QuranWBW: <a href="${url2}" target="_blank">${surah}:${ayahNum}</a></li>`;

// Tanzil
document.getElementById(
"result"
).innerHTML += `<li><a href="${url3}" target="_blank">${surah}:${ayahNum} on Tanzil</a> (Translation: <a href="${url4}" target="_blank">Hilali</a>)</li>`;
).innerHTML += `<li>Tanzil: <a href="${url3}" target="_blank">${surah}:${ayahNum}</a> (Translation: <a href="${url4}" target="_blank">Hilali</a>)</li>`;

// Append and copy ayah
getAyah(surah, ayahNum, lang)
Expand Down Expand Up @@ -252,7 +256,7 @@ document.getElementById("urlForm").addEventListener("submit", function (e) {
console.error("Error fetching data:", error);
document.getElementById(
"quran"
).innerHTML = `${error}<br><br>Potential culprits: <br>- Website/Network problem. <br>- Are you sure the Ayah number is correct for that Surah?<br><br>Try the <a href="#result">Urls below</a> instead.`;
).innerHTML = `${error}<br><br>Potential culprits: <br>- Website/Network problem. <br>- Are you sure the Ayah number is correct for that Surah?<br><br>Try the <a href="#result">URLs below</a> instead.`;
});

if (!tafsirHTML == "") {
Expand Down Expand Up @@ -284,7 +288,7 @@ document.getElementById("urlForm").addEventListener("submit", function (e) {
console.error("Error fetching tafsir: ", error);
document.getElementById(
"tafsir-print"
).innerHTML = `${error}<br><br>Potential culprits: <br>- Website/Network problem. <br>- Are you sure the Ayah number is correct for that Surah?<br><br>Try the <a href="#result">Urls below</a> instead.`;
).innerHTML = `${error}<br><br>Potential culprits: <br>- Website/Network problem. <br>- Are you sure the Ayah number is correct for that Surah?<br><br>Try the <a href="#result">URLs below</a> instead.`;
});

// jumpers top and bottom
Expand Down

0 comments on commit f55d802

Please sign in to comment.