This repository has been archived on 2024-09-05. You can view files and clone it, but cannot push or open issues or pull requests.
shimmie2/ext/view/script.js

29 lines
885 B
JavaScript

function joinUrlSegments(base, query) {
let separatorChar = "?";
if(base.includes("?")) {
separatorChar = "&";
}
return base + separatorChar + query;
}
document.addEventListener('DOMContentLoaded', () => {
if(document.location.hash.length > 3) {
var query = document.location.hash.substring(1);
$('LINK#prevlink').attr('href', function(i, attr) {
return joinUrlSegments(attr,query);
});
$('LINK#nextlink').attr('href', function(i, attr) {
return joinUrlSegments(attr,query);
});
$('A#prevlink').attr('href', function(i, attr) {
return joinUrlSegments(attr,query);
});
$('A#nextlink').attr('href', function(i, attr) {
return joinUrlSegments(attr,query);
});
$('span#image_delete_form form').attr('action', function(i, attr) {
return joinUrlSegments(attr,query);
});
}
});