custom button in backstage

3 views
Skip to first unread message

FND

unread,
Jan 22, 2008, 7:05:59 AM1/22/08
to TiddlyWikiDev
Hello all,

Wolfgang reported that after inserting a custom button into the
backstage*, the backstage bar does not properly close anymore.

In my attempts to figure out what's causing this issue, I have made some
progress - without actually being able to fix the problem though.
Here's a simple testcase (with instructions):
http://fnd.lewcid.org/tmp/backstageBug.html

I would greatly appreciate if someone could take a look and point me in
the right direction!


-- F.


cf. http://www.tiddlywiki.org/wiki/Backstage#Customization

FND

unread,
Mar 14, 2008, 3:59:23 PM3/14/08
to Tiddly...@googlegroups.com
> In my attempts to figure out what's causing this issue, I have made some
> progress - without actually being able to fix the problem though.

After talking to Martin, we agree that this is more of a feature request
than a bug.
The current technique* is quite hacky. What we really need is that the
TiddlyWiki core supports adding such buttons (not just tabs) to the
backstage bar.

Any suggestions on how this could be done?


-- F.


* http://www.tiddlywiki.org/wiki/Backstage#Customization

Eric Shulman

unread,
Mar 14, 2008, 6:20:36 PM3/14/08
to TiddlyWikiDev
> The current technique* is quite hacky. What we really need is that the
> TiddlyWiki core supports adding such buttons (not just tabs) to the
> backstage bar.

This is actually easy to do, and doesn't require a hijack of
backstage.init().

For example,
http://www.TiddlyTools.com/#BackstageTweaks
contains the following code that adds a button to the backstage
toolbar to invoke the "Jash" javascript shell. Note the definition
of "action" instead of "contents"... that's the key difference between
creating a tab and a button...

// add Jash
// REQUIRES: jash.js, jash.css
config.tasks.shellTask = {
text: "Jash",
tooltip: "JASH: Javascript Shell",
action: function() { clearMessage(); toggleJash(); }
}
config.backstageTasks.push("shellTask");


HTH,
-e

FND

unread,
Mar 15, 2008, 7:46:27 AM3/15/08
to Tiddly...@googlegroups.com
> Note the definition of "action" instead of "contents"...
> that's the key difference between creating a tab and a button

Thanks Eric (also for adding this info to the community wiki).

We had considered using the action property, but that only works for
buttons that call a certain function when clicked by the user.
It doesn't help if you need custom contents in the backstage bar, like
wikified contents (e.g. the search macro, as described in the example on
the community wiki. Another use case I have is to create an A element
with a HREF and TARGET attribute.
I believe those are valid options that should be available to plugin
authors - and I somehow got a feeling that fixing this issue should be
simple, but I just can't figure it out.


-- F.

Reply all
Reply to author
Forward
0 new messages