MarseyWorld/files/assets/js/post_navigation.js

13 lines
416 B
JavaScript
Raw Normal View History

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