On Dec 27, 3:58 pm, pinkp8ther <[email protected]> wrote:
> Alright I'm new here so go easy on me.  I've been looking for a
> solution for this, but I guess I haven't hit the right combination of
> keywords to find it.
>
> First, I running a pretty plain version of TiddlyWiki.  The only Plug-
> In I have added (for now) is SinglePageMode.
>
> I would like to do two things:
> 1) Add/Replace the Close button in the ToolBarCommands with a Home
> button that will open the DefaultTiddlers.

You can define a 'home' command yourself, by putting the following
code into a tiddler tagged with systemConfig (i.e., a plugin):
--------------------
config.commands.home={
        text: "home",
        tooltip: "restore initial display",
        handler: function(event,src,title) {
                story.closeAllTiddlers(); restart();
        }
}
--------------------
Then, in ToolbarCommands, replace the command keyword 'closeTiddler'
with 'home'.

> 2) If no pages are visible, all tiddlers closed, then open the
> DefaultTiddlers.

This can also be done via a small plugin.  The trick here is to
*hijack* the TWCore function that processes the closing of tiddlers,
so that you can add extra handling that checks to see if the story is
empty (no tiddlers remain displayed), and then trigger a restart().
Something like this:
-----------------
(function() {
TWCore_closeTiddler=Story.prototype.closeTiddler;
Story.prototype.closeTiddler=function() {
        TWCore_closeTiddler.apply(this,arguments);
        if(this.isEmpty()) restart();
};
})();
-----------------

> There must be a plug-in or something for this.  In fact I'm surprised
> that SinglePageMode doesn't already have this option.

Both of these tweaks are interesting concepts that could work well
with some uses of  SinglePageModePlugin.  I might just add them to the
standard distro of the plugin.  In the mean time, the above tweaks
should get you where you want to go.

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios

----
TiddlyTools needs YOUR financial support...
Help ME to continue to help YOU...
make a generous donation today:
   http://www.TiddlyTools.com/#Donations

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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/tiddlywiki?hl=en.

Reply via email to