[TW5] Hide the edit button in tagged tiddlers

262 views
Skip to first unread message

Jonathan Haug

unread,
Sep 26, 2015, 9:16:36 AM9/26/15
to tiddl...@googlegroups.com

Dear all,

could someone help me with the following task:

I want to *hide the edit button* in some specific tiddlers, which I
marked with the tag "locked".
This is to prevent accidental editing of important content.

Use case: I want to build a knowledge base wiki for multiple users. Most
tiddlers should be free to edit, but some tiddlers are reserved for
critical informations which should not be edited.

I'm aware of the fact, that this is not a perfect protection, but that
would be fine for me.
The tiddlywiki-html-file resides on a shared folder within a
Windows-Network.

So, my question is: How do I hide the edit button on *some* tiddlers?

Thanks in advance

Jonathan





Ton Gerner

unread,
Sep 26, 2015, 10:25:16 AM9/26/15
to tiddl...@googlegroups.com, jonath...@wolke7.net
Hi Jonathan,

You can style certain tagged tiddlers in a special way.

So, if these tiddlers are tagged 'locked' you can create tiddler e.g. Locked style, tagged with $:/tags/Stylesheet and containing:

.tc-tagged-locked svg.tc-image-edit-button {
     display
: none;
}

This does the trick.

Cheers,

Ton

Tobias Beer

unread,
Sep 26, 2015, 12:41:35 PM9/26/15
to TiddlyWiki, jonath...@wolke7.net
Hi Ton,

Looks neatly pragmatic...
 
.tc-tagged-locked svg.tc-image-edit-button {
     display
: none;
}

This works well, although I feel like
TiddlyWiki should put the css class
on the button and not on the svg.

Best wishes,

— tb

jonath...@wolke7.net

unread,
Sep 26, 2015, 6:04:38 PM9/26/15
to tiddl...@googlegroups.com

 

 

Hi Ton,

 

thanks, this looks like the perfect solution.

 

Cu

Jonathan

 

Von: Ton Gerner [mailto:ton.g...@gmail.com]
Gesendet: Samstag, 26. September 2015 16:25
An: TiddlyWiki < >
Cc: jonath...@wolke7.net
Betreff: Re: [TW5] Hide the edit button in tagged tiddlers

 

Hi Jonathan,

You can style certain tagged tiddlers in a special way, see

Ton Gerner

unread,
Sep 27, 2015, 7:23:08 AM9/27/15
to tiddl...@googlegroups.com
Hi Tobias,


On Saturday, September 26, 2015 at 6:41:35 PM UTC+2, Tobias Beer wrote:
Hi Ton,

Looks neatly pragmatic...
 
;-)
 
 
.tc-tagged-locked svg.tc-image-edit-button {
     display
: none;
}

This works well, although I feel like
TiddlyWiki should put the css class
on the button and not on the svg.
 
Sounds logical. But at the moment it is just that, see the CSS in the Readonly theme:

svg.tw-image-new-button, svg.tw-image-options-button, svg.tw-image-save-button, svg.tw-image-edit-button, svg.tw-image-delete-button, svg.tw-image-cancel-button, svg.tw-image-done-button {
     display
: none;
}

Cheers,

Ton

Best wishes,

— tb
Reply all
Reply to author
Forward
0 new messages