Eric,
Works like a charm, as I fully expected. Thanks.
Now can you suggest a way to incorporate hiding the right sidebar into this
method? I've been toying with TiddlyTools ToggleRight Sidebar to hide the
sidebar, but it seems like you have to tweak the siteSubtitle and put some
extra character there to make that solution work. I don't really want a
toggle. Just like the toolbar, I just want it off when in readOnly mode. I
don't want to add extra characters to my page header.
Regards,
the Captain
On Wednesday, December 11, 2013 9:25:54 AM UTC-5, Captain Packers wrote:
>
> Thanks Eric. I'll give that a try when I get back to that project later
> this week. Appreciate the timely reply.
>
> Reards,
> The Captain
>
> On Tuesday, December 10, 2013 5:00:17 PM UTC-5, Eric Shulman wrote:
>>
>> On Tuesday, December 10, 2013 1:02:03 PM UTC-8, Captain Packers wrote:
>>>
>>> I've been sifting through posts for several hours now and can't quite
>>> find the answer I'm looking for. Since I'm using SinglePageMode when in
>>> readOnly mode, I would like to also hide the tiddler toolbar altogether
>>> when in readOnly mode. I don't even need to give the viewer the options to
>>> close tiddlers.
>>> I've seen the options that hide the edit and view commands, but they
>>> always show the close, close others, and sometimes permaview (whatever that
>>> is) options.
>>>
>>
>> The toolbar commands are defined by a "slice table" contained in
>> [[ToolbarCommands]], which looks like this:
>>
>>> |~ViewToolbar|closeTiddler closeOthers +editTiddler > fields syncing
>>> permalink references jump|
>>> |~EditToolbar|+saveTiddler -cancelTiddler deleteTiddler|
>>
>>
>> The ViewToolbar and EditToolbar slices are then included by the
>> [[ViewTemplate]] and [[EditTemplate]], respectively:
>>
>>> <div class='toolbar' role='navigation' macro='toolbar
>>> [[ToolbarCommands::ViewToolbar]]'></div>
>>
>> and
>>
>>> <div class='toolbar' macro='toolbar
>>> [[ToolbarCommands::EditToolbar]]'></div>
>>
>>
>> Notice that the toolbar display has a CSS class of 'toolbar'. This means
>> that you could hide the toolbar simply by adding
>> .toolbar { display:none; }
>> to your [[StyleSheet]] definitions. However, this is NOT a workable
>> solution, as it will remove the toolbar all the time, even when readOnly is
>> false, making the document completely un-editable!
>>
>> Fortunately, there is a way to apply this rule conditionally by using the
>> TWCore's "systemTheme" mechanism to automatically switch between
>> alternative stylesheet definitions based on the value of the readOnly flag.
>>
>> Start by putting the "hide the toolbar" CSS rule into another tiddler,
>> e.g. [[NoToolbar]] that contains a reference to the regular [[StyleSheet]],
>> followed by the desired rule, like this:
>>
>>> [[StyleSheet]]
>>> .toolbar { display:none; }
>>
>>
>> Then, create a new tiddler, [[CustomTheme]], containing a slice table
>> with one row:
>>
>>> |StyleSheetReadOnly|NoToolbar|
>>
>>
>> Lastly, create a 'startup configuration' tiddler, [[zzConfig]], that sets
>> the CustomTheme as the default for the document:
>>
>>> config.options.txtTheme="CustomTheme";
>>
>>
>> Save and reload your document to apply all your changes. When you view
>> your document locally with #readOnly:no, the standard [[StyleSheet]] is
>> applied, and you should see no difference, i.e. the toolbars should still
>> be present. When viewing with #readOnly:yes (or remotely via http:), then
>> the CustomTheme automatically invokes the alternative [[NoToolbar]] styles,
>> applying the .toolbar {display:none;} rule as intended, resulting in no
>> visible toolbars. QED.
>>
>> enjoy,
>> -e
>> Eric Shulman
>> TiddlyTools / ELS Design Studios
>>
>> EVERY DONATION IS IMPORTANT!
>> HELP ME TO HELP YOU - MAKE A CONTRIBUTION TO MY "TIP JAR"...
>> http://TiddlyTools.github.com/fundraising.html#MakeADonation
>>
>> Professional TiddlyWiki Consulting Services...
>> Analysis, Design, and Custom Solutions:
>> http://www.TiddlyTools.com/#Contact
>>
>
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/groups/opt_out.