Hi Ciofegates

Hide elements when ReadOnly
1
First you have to make the TspotSetupPlugin *not* show backstaqge and
*not* allow editing:
Replace: "// make it so you can by default see edit controls via http
config.options.chkHttpReadOnly = false; window.readOnly = false; //
make sure of it (for tw 2.2) window.showBackstage = true; // show
backstage too"
with: // make it so you can by default do *not* see edit controls via
http config.options.chkHttpReadOnly = true; window.readOnly = true; //
make sure of it (for tw 2.2) window.showBackstage = false; // hide
backstage too
2
Now install InlineJavascriptPlugin from TiddlyTools.com
(You will need http://www.tiddlytools.com/#InlineJavascriptPlugin to
make this script work..)
3
You can hide an element, when your TW is readonly, if you put this
around it: {{span{<script>
place.style.display=readOnly?'none':'inline';</script>YourElement}}}
4
For your timeline you could do this:
SideBarTabs <<tabs txtMainTab "Timeline"
"Timeline" [[SideBarTabs##TabTimeline]] "All" "All tiddlers" TabAll
"Tags" "All tags" TabTags "More" "More lists" TabMore>>/% !TabTimeline
{{span{<script> place.style.display=readOnly?'none':'inline';</
script><<tiddler TabTimeline>>
!end %/}}}
5
The ViewTemplate can do the same if you replace: "<div
class='subtitle'><span macro='view modifier link'></span>, <span
macro='view modified date'></span> (<span macro='message
views.wikified.createdPrompt'></span> <span macro='view created
date'></span>)</div>"
with: <div class='subtitle'><span macro='tiddler TiddlerSubTitle'></
span></div>
And create a new tiddler TiddlerSubTitle
{{span{<script>place.style.display=readOnly?'none':'inline';</script>
<<view modifier link wikified'>>, <<view modified date>> (<<message
views.wikified.createdPrompt>><<view created date>>) }}}

Here's my proof of concept: http://sandkasse.tiddlyspot.com

Click EditOnline in the MainMenu to the left to view the timeline and
get the tiddler subtitles back again..

Cheers Måns Mårtensson


On 20 Dec., 10:48, Ciofegates <[email protected]> wrote:
> Moreover, is it possible to suppress the timeline panel on the right?
> Or display it only for athenticated users?

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/tiddlywiki?hl=en.

Reply via email to