(Note: Create a tiddler, tag it with $:/tags/Stylesheet, set the type to text/css
My question is how to limit this to shadow tiddlers, or specific system tiddlers? Is there any CSS solution or I have to go to use Wikitext and check the tiddler is a shadow tiddler?
Perfect! Thank you, Eric.
I assume if a shadow tiddler is edited, then it is a normal tiddler or a system tiddler (depend to the name prefix), am I right?
This is because if we allow to edit a shadow tiddler, the above rule won’t be applied to such tiddler.
Yes, I did. I also tried adding the lines to a stylesheet tiddler that already worked, without success. I will check everything again, probably made a silly mistake.
The solution works on all recent TW versions including 5.3.5.
Check your tiddler for tag ($:/tags/Stylesheet), and type (text/css)
Also look at the new TW-Utility which uses this solution.
So editing should be blocked for ALL system tiddlers, including shadow tiddlers. BUT: only editing of shadow tiddlers is blocked now. Other system tiddlers can still be edited.
BTW, using the last code by Eric (with the .tc-tiddler-shadow class) has the same result, but this is as it should be of course.
I took an empty TW from the site (5.3.6) and copied the edit blocker tiddler to it (the version that blocks editing any tiddler starting with ‘$:/’). It worked on system tiddlers! The same tiddler did not work in my wiki where it came from (5.3.5).
Then I disabled all plugins in the original wiki, then saved and refreshed. These are:
context-menu-plugin
simplecalendar
mob (JD Mobile layout)
Menu Bar
Search in Fields
Shiraz
Tiddler Commander
TiddlyFormula
This caused a little mystery in itself, because at least some of the plugins still worked even after the refresh (I looked at simplecalendar and Menu Bar). Turned out the wiki tab was ‘pinned’ in Firefox. Only after unpinning, saving, closing and reopening the wiki, the plugins were really disabled.
All this had no effect on the ‘edit bug’. With all plugins disbled, I could still edit normal system files, but not shadow files. I created a system tiddler in the empty wiki (empty apart from the edit blocker tiddler). I could not edit it after leaving the editor, but the same tiddler copied into my original wiki was editable there.
I tested the edit blocker on another of my wiki’s (also 5.3.5). It worked perfectly. So the problem lies within at least one specific wiki.
@Mohammad, I will now try to make a minimal demo wiki to put on Tiddlyhost.
For myself, the problem is solved. I decided to experiment a bit with the part of the code after the selection, i.e. after the part between brackets.
Exp. 1. just change color background: worked in all cases
Exp. 2. show no buttons at all (removing ‘:not(…)’ part): worked OK
Exp. 3. show only one other button, so changed ‘close’ into ‘edit’ or ‘info’: worked OK!
Exp. 4. changed ‘info’ back into ‘close’. Hey presto! The code suddenly worked as advertised.
This solves the problem, but not the riddle: the original edit blocker tiddler worked flawlessly from the beginning in another wiki.
I then deleted ALL non-system tiddlers and images from the original wiki, apart from the edit blocker and a few small test-tiddlers. This also solved the problem. So somewhere in those 869 tiddlers the snag must be. I will try to make a few smart guesses and pinpoint the source of the problem, if possible.
Meanwhile, have a good New Year’s Eve and a Happy Healthy 2025!