Wikitext solution for hiding buttons/tabs ("read only") - contributions welcomed

Here’s my solution for hiding select part of the UI when a filter is match. As always, do lots of backups and use this at your own risks.

Edit : Warning, custom sidebar tab will be deleted if you use the reset button, I’ll make a fix tomorrow !

https://read-only.tiddlyhost.com/#%24%3A%2FTiddlyTweaks%2FReadOnly

ReadOnly.json (8.9 KB)

Example of read only vs edit mode :

Limitations

  • The UI doesnt instantaneously update, it needs to be refreshed with the “save changes” button. Since you need to be logged in to be able to save on tiddlyhost, this mean that you will need to install this in a local wiki to test it out, sorry …
  • Buttons are not restored when disabling the “read” mode. This is not a big issue since the read mode is meant to be triggered for readers and thus the changes cant be saved, but can still be problematic if the wiki is meant to be downloaded then edited by the reader. For now this is fixed by using a “reset” button.

Any help to fix the limitations above / improve the code is welcomed !

2 Likes

It would be nice if there were options for select/unselect all under View Toolbar and Page Controls sections…

Good idea, I’ll look into that in the next few days :slight_smile:

1 Like

My version doesn’t match your screenshots, but I’m having major issues. Tabs remain, and one tab was deleted (whole tiddler gone!) from hitting the reset button in your control panel.

Guess I’m going to need to pursue some other solution for this…

oh, forgot to add screenshots
These are the tiddlers I had to re-import after the reset button wiped them out:

This shows the tabs that did not hide and the one that went missing…

Oh damn that’s a good catch, I need to change how the reset operate ! It’s 3 am here so I’ll do a fix tomorrow, thanks for letting me know !

1 Like