Switch to using icons when rendering a DN, and move the server icons to the topmenu

This commit is contained in:
2025-03-04 23:03:42 +11:00
parent 57b6b8c1f1
commit 070aabfc88
11 changed files with 199 additions and 163 deletions

View File

@@ -48,23 +48,11 @@
var subpage = window.location.hash;
$(document).ready(function() {
// Enable navigating to a page via a URL fragment, and that fragment is defined with a server-icon
if (subpage) {
// Enable navigating to a page via a URL fragment, and that fragment is defined with a server-icon
var valid = Object.values($('.server-icon > a').map(function() {
return $(this).attr('id');
})).indexOf(subpage.substring(1));
if (valid !== -1) {
// @todo this condition can probably be removed
console.log('teleporting...:'+subpage.substring(1));
// The click() event wont have been registered yet, so we need to delay us clicking it
setTimeout(function() { $(subpage).click(); },250);
} else if (valid === -1) {
// Clear the hash
history.replaceState(null,null,' ');
getNode(subpage.substring(1));
}
// Clear the hash
history.replaceState(null,null,' ');
getNode(subpage.substring(1));
}
});
</script>