2024-02-03 03:42:04 +00:00
|
|
|
let post_permalinks = sessionStorage.getItem("post_permalinks")
|
2024-01-31 00:12:40 +00:00
|
|
|
|
2024-02-03 03:42:04 +00:00
|
|
|
if (post_permalinks) {
|
|
|
|
post_permalinks = post_permalinks.split(', ');
|
2024-03-07 21:14:39 +00:00
|
|
|
let current_index = post_permalinks.indexOf(`'${location.href}'`)
|
2024-02-03 03:42:04 +00:00
|
|
|
if (current_index > -1) {
|
2024-03-07 21:14:39 +00:00
|
|
|
let permalink_after = post_permalinks[current_index+1]
|
2024-02-03 03:42:04 +00:00
|
|
|
|
|
|
|
if (permalink_after) {
|
2024-03-07 21:14:39 +00:00
|
|
|
let pid = permalink_after.split('/').slice(-2, -1)[0]
|
|
|
|
while (comments[pid]) {
|
|
|
|
current_index += 1
|
|
|
|
permalink_after = post_permalinks[current_index]
|
|
|
|
pid = permalink_after.split('/').slice(-2, -1)[0]
|
|
|
|
}
|
|
|
|
|
2024-02-03 03:42:04 +00:00
|
|
|
for (const btn of document.getElementsByClassName('post_navigation')) {
|
|
|
|
btn.classList.remove('d-none')
|
|
|
|
btn.href = permalink_after.slice(1, -1)
|
|
|
|
}
|
2024-04-06 07:50:04 +00:00
|
|
|
|
|
|
|
document.addEventListener('keydown', (e) => {
|
|
|
|
if (
|
|
|
|
["d", "ArrowRight"].includes(e.key) &&
|
|
|
|
!["TEXTAREA", "INPUT"].includes(document.activeElement.tagName) &&
|
2024-04-07 04:06:16 +00:00
|
|
|
!(e.ctrlKey || e.metaKey || e.shiftKey || e.altKey) &&
|
|
|
|
!expandImageModal.classList.contains('show')
|
2024-04-06 07:50:04 +00:00
|
|
|
) {
|
|
|
|
location.href = permalink_after.slice(1, -1)
|
|
|
|
}
|
|
|
|
})
|
2024-01-31 19:07:25 +00:00
|
|
|
}
|
2024-01-31 00:12:40 +00:00
|
|
|
}
|
|
|
|
}
|