Automatically hide sidebar when viewed online?

152 views
Skip to first unread message

David Gifford

unread,
Feb 13, 2015, 12:06:04 PM2/13/15
to tiddl...@googlegroups.com
Hi all

No idea if this is even possible, but hey, worth asking.

Is there, or could there be, a plugin or snippet of something to put in a TiddlyWiki so that when it is viewed locally, the sidebar is visible, but when viewed online, the sidebar is hidden? The reason I ask is that I have noticed that mobile screens tend to push the tiddlers down underneath the sidebar, and I would like to publish TWs of content where the users don't really need the sidebar anyway, I have a search window and a few key links in a topbar. But I don't want to have to click the 'hide sidebar' button at the top right every time I upload, and unclick it the next time I work with it.

I seem to recall TW classic having an option to show or hide editing features when online. So I thought maybe there might be a way to do this, too.

Dave

Tobias Beer

unread,
Feb 13, 2015, 1:13:38 PM2/13/15
to tiddl...@googlegroups.com
hi Dave,
 
Is there, or could there be, a plugin or snippet of something to put in a TiddlyWiki so that when it is viewed locally, the sidebar is visible, but when viewed online, the sidebar is hidden?

I don't think there is yet and while possibly easy to create this is definitely core territory.

As for me it could work like this...

On startup TiddlyWiki sets a css class to the html-element corresponding to the protocol.

<html class="http"/>

or, exceptionally...

<html class="http https"/>

or...

<html class="file"/>

That way, you could define multiple, location dependent styles or do work things differently in some js code...

.site-foo .tc-sidebar-scrollable {
display
:none;

}

By the way, it's a bit confusing that the class would be "tc-sidebar-scrollable", why is that?

Best wishes, Tobias.

Jeremy Ruston

unread,
Feb 14, 2015, 9:45:11 AM2/14/15
to TiddlyWiki
Hi Dave

> Is there, or could there be, a plugin or snippet of something to put in a TiddlyWiki so that when it is viewed locally, the sidebar is visible, but when viewed online, the sidebar is hidden? 

This ticket is a proposal for the core that would enable one to set the sidebar status according to a comparison with the URL, so you could do exactly what you're asking:


Best wishes

Jeremy


--
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 tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.



--
Jeremy Ruston
mailto:jeremy...@gmail.com

David Gifford

unread,
Feb 14, 2015, 9:53:15 AM2/14/15
to tiddl...@googlegroups.com
Thanks Jeremy!

--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/YpF1AzQCAJQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.

Mat

unread,
Feb 19, 2015, 7:48:33 AM2/19/15
to tiddl...@googlegroups.com
Another route, more a'la TWc zzConfig, is perhaps a conditional if "username == David" then show...

<:-)
Reply all
Reply to author
Forward
0 new messages