added reader
This commit is contained in:
@@ -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();
|
||||
Reference in New Issue
Block a user