From 79d79b1a00ea736bb2d8e1b05571ae62bee5d4ba Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Sun, 30 Nov 2025 00:28:45 -0500 Subject: [PATCH] Add PDF button and TOC shortcuts to resource index keyboard nav MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - PDF button is now selectable via arrow navigation - 'p' key downloads PDF directly - 't' key jumps to TOC block 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- kjvstudy_org/templates/resource_index.html | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/kjvstudy_org/templates/resource_index.html b/kjvstudy_org/templates/resource_index.html index b87933f..739ea49 100644 --- a/kjvstudy_org/templates/resource_index.html +++ b/kjvstudy_org/templates/resource_index.html @@ -301,8 +301,8 @@ document.addEventListener('DOMContentLoaded', function() { // Two-section navigation: TOC block -> content elements // Or when inside TOC: individual TOC entries - // Content elements include section titles (h3 with links), paragraphs, and verse items - const contentElements = Array.from(document.querySelectorAll('.intro-text, .resource-name, .resource-item-description p, .verse-item')); + // Content elements include PDF button, section titles (h3 with links), paragraphs, and verse items + const contentElements = Array.from(document.querySelectorAll('.resource-download-btn, .intro-text, .resource-name, .resource-item-description p, .verse-item')); const tocItems = Array.from(tocList.querySelectorAll('li a')); let currentSection = 'content'; // 'content' or 'toc' @@ -431,6 +431,15 @@ document.addEventListener('DOMContentLoaded', function() { currentSection = 'content'; selectedIndex = -1; selectedTocIndex = -1; + } else if (e.key === 'p') { + // p: Download PDF + e.preventDefault(); + var pdfBtn = document.querySelector('.resource-download-btn'); + if (pdfBtn) window.location.href = pdfBtn.href; + } else if (e.key === 't') { + // t: Jump to TOC + e.preventDefault(); + selectTocBlock(); } }); });