added reader

This commit is contained in:
2025-11-27 02:11:17 +01:00
parent 76aa21ef14
commit a6c753085e
5 changed files with 1350 additions and 14 deletions

View File

@@ -164,14 +164,17 @@ function renderTable() {
pageItems.forEach(ch => {
const row = document.createElement('tr');
row.innerHTML = `
<td>${ch.number}</td>
<td>${ch.title || `Chapter ${ch.number}`}</td>
<td><span class="pill" style="font-size:0.75rem;">${ch.provider}</span></td>
<td>
<button class="read-btn-small" onclick="openReader('${ch.id}')">Read</button>
</td>
`;
<td>${ch.number}</td>
<td>${ch.title || 'Chapter ' + ch.number}</td>
<td><span class="pill" style="font-size:0.75rem;">${ch.provider}</span></td>
<td>
<button class="read-btn-small" onclick="openReader('${bookId}', '${ch.number - 1}', '${ch.provider}')">
Read
</button>
</td>
`;
tbody.appendChild(row);
});
@@ -202,9 +205,10 @@ function updatePagination() {
nextBtn.onclick = () => { currentPage++; renderTable(); };
}
function openReader(chapterId) {
alert("Opening Reader for Chapter ID: " + chapterId);
// window.location.href = `/read/${bookId}/${chapterId}`;
function openReader(bookId, chapterId, provider) {
const c = encodeURIComponent(chapterId);
const p = encodeURIComponent(provider);
window.location.href = `/read/${bookId}/${c}/${p}`;
}
init();