A button to switch between storyview and full screen mode and their previous states

201 views
Skip to first unread message

Mohammad

unread,
May 17, 2018, 12:30:47 AM5/17/18
to tiddl...@googlegroups.com
Hi 
I want to put a button to toggle between these two states at once.

  • state1:   storyview: classic,   full-screen-mode: off
  • state2:   storyview: zoomin,   full-screen-mode: on

Another question:
  Is it possible to switch from some storyview, full-screen-xx  and return back later to their previous states!
I mean toggle  storyview and full-screen mode between some states and their previous states


Please advise!


Best
Mohammad
 

BurningTreeC

unread,
May 17, 2018, 4:34:06 AM5/17/18
to TiddlyWiki
<$reveal state="$:/state/zoomin-fullscreen" type="nomatch" text="yes">
<$button class="tc-btn-invisible">
<$action-setfield $tiddler="$:/state/zoomin-fullscreen" text="yes"/>
<$action-setfield $tiddler="$:/view" text="zoomin"/>
<$action-sendmessage $message="tm-full-screen"/>
zoomin
</$button>
</$reveal>
<$reveal state="$:/state/zoomin-fullscreen" type="match" text="yes">
<$button class="tc-btn-invisible">
<$action-setfield $tiddler="$:/state/zoomin-fullscreen" text="no"/>
<$action-setfield $tiddler="$:/view" text="classic"/>
<$action-sendmessage $message="tm-full-screen"/>
zoomout
</$button>
</$reveal>


that would be a simple button to toggle your modes
note that there's no reliant way to distinguish between toggling fullscreen off if it's on or on if it's off
that means that if you press "escape" while you're fullscreen or click the fullscreen button in the sidebar this button then sets fullscreen on when you leave zoomin mode

---

your second question:
I assume that with states you mean the tiddlers that are shown and maybe if the sidebar is shown or not
You can do that, too

The shown tiddlers are stored in the "$:/StoryList" tiddler
The sidebar state is in "$:/state/sidebar"

Knowing that, you can extend the button:

<$reveal state="$:/state/zoomin-fullscreen" type="nomatch" text="yes">
<$button class="tc-btn-invisible">
<$action-setfield $tiddler="$:/state/zoomin-fullscreen" text="yes"/>
<$action-setfield $tiddler="$:/view" text="zoomin"/>
<$action-sendmessage $message="tm-full-screen"/>
<$action-setfield $tiddler="$:/storylist/classic/save" text={{$:/StoryList!!list}}/>
<$action-setfield $tiddler="$:/StoryList" $field="list" $value={{$:/storylist/zoomin/save}}/>
<$action-setfield $tiddler="$:/sidebarstate/classic/save" text={{$:/state/sidebar}}/>
<$action-setfield $tiddler="$:/state/sidebar" text={{$:/sidebarstate/zoomin/save}}/>
zoomin
</$button>
</$reveal>
<$reveal state="$:/state/zoomin-fullscreen" type="match" text="yes">
<$button class="tc-btn-invisible">
<$action-setfield $tiddler="$:/state/zoomin-fullscreen" text="no"/>
<$action-setfield $tiddler="$:/view" text="classic"/>
<$action-sendmessage $message="tm-full-screen"/>
<$action-setfield $tiddler="$:/storylist/zoomin/save" text={{$:/StoryList!!list}}/>
<$action-setfield $tiddler="$:/StoryList" $field="list" $value={{$:/storylist/classic/save}}/>
<$action-setfield $tiddler="$:/sidebarstate/zoomin/save" text={{$:/state/sidebar}}/>
<$action-setfield $tiddler="$:/state/sidebar" text={{$:/sidebarstate/classic/save}}/>
zoomout
</$button>
</$reveal>

you can try this code on tiddlywiki.com to see if it fits your needs

best wishes, BTC

@TiddlyTweeter

unread,
May 17, 2018, 5:50:18 AM5/17/18
to TiddlyWiki
Ciao BTC.

Useful!

I also tried in TiddlyDesktop, where it doesn't work. I guess that is because the architecture is quite different (in that it doesn't have the same "gubbins" of a standard browser?)

Best wishes
@TiddlyTweeter

BurningTreeC

unread,
May 17, 2018, 8:25:23 AM5/17/18
to TiddlyWiki
@TiddlyTweeter

I believe TD doesn't allow fullscreen mode but I don't know why

all the best, BTC

Jeremy Ruston

unread,
May 17, 2018, 8:27:08 AM5/17/18
to tiddl...@googlegroups.com
I believe TD doesn't allow fullscreen mode but I don't know why

Ah, that’s a bug, which I can confirm. It’s supposed to work, but must have been broken by an earlier nw.js update.

Best wishes

Jeremy


all the best, BTC

--
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 https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/7d7c446c-971f-48f5-b3fe-9bff96b8e9ad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

BurningTreeC

unread,
May 17, 2018, 8:35:30 AM5/17/18
to TiddlyWiki


Am Donnerstag, 17. Mai 2018 14:27:08 UTC+2 schrieb Jeremy Ruston:
I believe TD doesn't allow fullscreen mode but I don't know why

Ah, that’s a bug, which I can confirm. It’s supposed to work, but must have been broken by an earlier nw.js update.

 
I had TD with nw.js version  0.30.0 and if I remember right there it was possible to go fullscreen. touch-zoom was working for sure, that was a nice discovery
 
Best wishes

Jeremy

Mohammad

unread,
May 17, 2018, 11:48:12 AM5/17/18
to tiddl...@googlegroups.com
Many thanks @BurningTreeC

For me also doesnot work on TiddlyDesktop. But works in Chrome!
I appreciate your time. It always return to classic view. For me it is okay now, but just for curiosity, where the TW itself store the state of storyview ? 
 
Best
Mohammad

BurningTreeC

unread,
May 17, 2018, 12:28:18 PM5/17/18
to TiddlyWiki
Many thanks @BurningTreeC

For me also doesnot work on TiddlyDesktop. But works in Chrome!
I appreciate your time. It always return to classic view. For me it is okay now, but just for curiosity, where the TW itself store the state of storyview ? 

That is stored in the "$:/view" tiddler 
 
Best
Mohammad

Mohammad

unread,
May 17, 2018, 12:36:29 PM5/17/18
to TiddlyWiki
@BurningTreeC
Thank you for your kind help!

Mohammad

unread,
May 18, 2018, 7:10:05 AM5/18/18
to TiddlyWiki
@BurningTreeC
 Is it possible to toggle the sidebar (hide/show) at the same time with this button?

/Mohammad
Reply all
Reply to author
Forward
0 new messages