Replies: 1 comment 1 reply
-
|
PrivateBin is designed in the style of a single page app: all HTML for all possible views is delivered by the PHP side in one go and the JS client displays and hides items, as necessary. As to why it does this by hiding and displaying DOM nodes using CSS instead of removing and adding bits into the tree, that is both for performance reasons as well as to reduce the amount of code needed on the JS side. If we were to remove and add pieces of the DOM tree at run-time, the JS would need to generate these in memory and attach them to the live page tree. That is a more expensive operation compared to just setting or removing a CSS class on a static tree. Furthermore the JS side would then need to know the DOM snippets of all the templates and variants. This would not just mean a lot more JS code, but also would make creation of templates much more convoluted, as you couldn't have all the HTML and styling in one file, but had to add pieces of your template code into the JS code in multiple locations, regenerate the SRI hashes, ... |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi.
I'm trying to modify the default front end template to match my organization's needs. The most important part is accessibility, because PrivateBin's current template has lots of accessibility problems.
While modifying the template I noticed that for some reason menus and buttons that are not actually in use in some pages (like the copy URL page or viewing the content page) are still included in the HTML code - just hidden with CSS.
Does someone know the reason for this? I would assume that completely removing unnecessary menus and buttons from pages that don't need them would be more efficent and at least would produce more comprehensible, safe and manageable PHP code.
Beta Was this translation helpful? Give feedback.
All reactions