HelpButton

85 views
Skip to first unread message

Ste Wilson

unread,
Apr 13, 2019, 3:33:29 PM4/13/19
to TiddlyWiki
The preamble:
I've just discovers at some point in the past I'd grabbed HelpButton macro off Jed (thanks Jed). Having just rediscover this nugget of coding goodness (thanks Jed) I thought I'd apply it somewhere!

Do any wizards out there know how this wonderment can be made to keep the text inside the tiddler bounds and not (at least on mobile) poking off the edge of the screen?


Jed Carty

unread,
Apr 13, 2019, 4:16:45 PM4/13/19
to TiddlyWiki
I completely forgot I made that macro and have no idea where it is.


So I may be able to help if you give me a link to it or the macro code.

This is why I made bob, I am trying to be organised.

Ste Wilson

unread,
Apr 14, 2019, 6:12:53 AM4/14/19
to TiddlyWiki
On Saturday, 13 April 2019 21:16:45 UTC+1, Jed Carty wrote: > I completely forgot I made that macro and have no idea where it is. > > > > So I may be able to help if you give me a link to it or the macro code. > > > This is why I made bob, I am trying to be organised.

\define HelpButton(label, ButtonText:?)
^^(<$button popup="""$:/temp/popup/$(currentTiddler)$/$label$""" class='tc-btn-invisible tc-tiddlylink'>$ButtonText$</$button>)<$reveal type='popup' state="""$:/temp/popup/$(currentTiddler)$/$label$"""><div class='tc-drop-down' style='width:1500px;max-width:75vw;white-space:pre-wrap;padding:10px;text-align:left;font-size:1.5em;border-radus:0.5em;'><$transclude field="""$label$"""/></div></$reveal>^^
\end

Usage:

```
This adds a help button that looks like this<<HelpButton demo>>
```

This adds a help button that looks like this<<HelpButton demo>>


```
This adds a help button that looks like this<<HelpButton demo2 'why?'>>
```

This adds a help button that looks like this<<HelpButton demo2 'why?'>>


Contents of the `demo` field: {{!!demo}}

Contents of the `demo2` field: {{!!demo2}}

You make a field for each label that contains the help information. This can have html and simple wikitext. Since it is a field linebreaks need to be added using html `<br>` tags.


Jed Carty

unread,
Apr 14, 2019, 3:04:23 PM4/14/19
to TiddlyWiki
This is better at least, it should work for mobile much better. There are some widths where the help will partly be outside the tiddler but it shouldn't ever be off the screen.


\define HelpButton(label, ButtonText:?)
^^(^^<$button
  popup="""$:/temp/popup/$(currentTiddler)$/$label$"""
  class='tc-btn-invisible tc-tiddlylink'
>
  ^^$ButtonText$^^
</$button>^^)^^
<$reveal
  type='popup'
  state="""$:/temp/popup/$(currentTiddler)$/$label$"""
>
  <div
    class='tc-drop-down'
    style='max-width:100%;white-space:pre-wrap;padding:10px;text-align:left;font-size:1.5em;border-radus:0.5em;'
  ><$transclude
      field="""$label$"""
    /></div>
</$reveal>

Ste Wilson

unread,
Apr 15, 2019, 3:18:03 AM4/15/19
to TiddlyWiki
Thanks once again :)
Reply all
Reply to author
Forward
0 new messages