mirror of
https://github.com/kennethreitz/kjvstudy.org.git
synced 2026-06-05 23:00:16 +00:00
Fix scripture links in interactive family tree
Scripture references in the sidebar now link to the actual verse pages instead of being disabled with onclick="return false". 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -2183,7 +2183,16 @@ function showPersonInfo(person) {
|
||||
const verseField = document.getElementById('field-verse');
|
||||
if (fullPerson && fullPerson.verses && fullPerson.verses.length > 0) {
|
||||
const verse = fullPerson.verses[0];
|
||||
const verseHtml = `<a href="#" onclick="return false;">${verse.reference}</a><br><em>"${verse.text.substring(0, 100)}${verse.text.length > 100 ? '...' : ''}"</em>`;
|
||||
// Parse reference to create URL (e.g., "Genesis 5:3" -> "/book/Genesis/chapter/5/verse/3")
|
||||
const refMatch = verse.reference.match(/^(\d?\s*[A-Za-z]+)\s+(\d+):(\d+)/);
|
||||
let verseUrl = '#';
|
||||
if (refMatch) {
|
||||
const book = refMatch[1].trim();
|
||||
const chapter = refMatch[2];
|
||||
const verseNum = refMatch[3];
|
||||
verseUrl = `/book/${encodeURIComponent(book)}/chapter/${chapter}/verse/${verseNum}`;
|
||||
}
|
||||
const verseHtml = `<a href="${verseUrl}">${verse.reference}</a><br><em>"${verse.text.substring(0, 100)}${verse.text.length > 100 ? '...' : ''}"</em>`;
|
||||
verseField.innerHTML = `<div class="info-field-label">Scripture</div><div class="info-field-value">${verseHtml}</div>`;
|
||||
verseField.style.display = 'block';
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user