MarseyWorld/files/assets/js/post_navigation.js

17 lines
485 B
JavaScript
Raw Normal View History

2024-02-03 03:42:04 +00:00
let post_permalinks = sessionStorage.getItem("post_permalinks")
2024-02-03 03:42:04 +00:00
if (post_permalinks) {
post_permalinks = post_permalinks.split(', ');
const current_index = post_permalinks.indexOf(`'${location.href}'`)
if (current_index > -1) {
const permalink_after = post_permalinks[current_index+1]
if (permalink_after) {
for (const btn of document.getElementsByClassName('post_navigation')) {
btn.classList.remove('d-none')
btn.href = permalink_after.slice(1, -1)
}
2024-01-31 19:07:25 +00:00
}
}
}