Nuova pagina sitoctt internals, Fix misti di pagine, Ristrutturazione file

This commit is contained in:
2024-12-08 19:03:10 +01:00
parent c509fa6445
commit 01e4470eaa
22 changed files with 114 additions and 49 deletions

View File

@ -0,0 +1,28 @@
(function(){
if (location.protocol !== 'file:') {
window.PatchLocalFileAnchor = Void;
return;
}
window.PatchLocalFileAnchor = (function PatchLocalFileAnchor (anchorEl) {
var href = anchorEl.href;
if (href.startsWith('file://')) {
var tokens = href.split('#');
href = tokens[0];
if (href.endsWith('/')) {
href += 'index.html';
}
tokens = tokens.slice(1);
if (tokens.length) {
href += ('#' + tokens.join('#'));
}
anchorEl.href = href;
}
});
window.addEventListener('DOMContentLoaded', (function(){
Array.from(document.querySelectorAll('a[href]')).forEach(PatchLocalFileAnchor);
}));
})();