szurubooru
szurubooru copied to clipboard
how to change this block?
I didnt learn js, but it looks like a menu item is defined by this class which takes a key(?) and some useful parameters https://github.com/rr-/szurubooru/blob/8088ff3bbe101907c2cea3341bc4437285b3d12d/client/js/models/top_navigation.js#L6
there is a function here that you'll need to add a line to create your item in the menu. I assume the link parameter is actually a link, and its already based on / of the server
ret.add("myitem", new TopNavigationItem("X", "ItemName", "linktofileonserver"));
https://github.com/rr-/szurubooru/blob/8088ff3bbe101907c2cea3341bc4437285b3d12d/client/js/models/top_navigation.js#L79
I'm guessing its as simple as adding your own ret.add
call to that function
where the second parameter is a new TopNavigationItem, and the constructor parameters for that object(?) are all the necessary things.
Also, there is the ability to limit the visibility of links based on permissions: https://github.com/rr-/szurubooru/blob/8088ff3bbe101907c2cea3341bc4437285b3d12d/client/js/controllers/top_navigation_controller.js#L31