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

30 lines
885 B
JavaScript
Raw Normal View History

function joinUrlSegments(base, query) {
let separatorChar = "?";
if(base.includes("?")) {
separatorChar = "&";
}
return base + separatorChar + query;
}
2020-03-02 17:12:43 +00:00
document.addEventListener('DOMContentLoaded', () => {
2018-11-05 22:59:53 +00:00
if(document.location.hash.length > 3) {
var query = document.location.hash.substring(1);
2020-02-04 01:22:26 +00:00
$('LINK#prevlink').attr('href', function(i, attr) {
return joinUrlSegments(attr,query);
2018-11-05 22:59:53 +00:00
});
2020-02-04 01:22:26 +00:00
$('LINK#nextlink').attr('href', function(i, attr) {
return joinUrlSegments(attr,query);
2020-02-04 01:22:26 +00:00
});
$('A#prevlink').attr('href', function(i, attr) {
return joinUrlSegments(attr,query);
2020-02-04 01:22:26 +00:00
});
$('A#nextlink').attr('href', function(i, attr) {
return joinUrlSegments(attr,query);
2018-11-05 22:59:53 +00:00
});
$('span#image_delete_form form').attr('action', function(i, attr) {
return joinUrlSegments(attr,query);
});
2018-11-05 22:59:53 +00:00
}
});