Re: Way to tweak menumore?

13 views
Skip to first unread message

wolfgang

unread,
May 25, 2009, 4:16:53 AM5/25/09
to TiddlyWiki
Dave G.:

> > I'd like to do something like this:
>
> >http://oldcat.googlegroups.com/web/MenuMoreEn.html
>
> > But it is currently set so that when you click on a topmenu item, the
> > tiddler opens and the tiddler's content also appears in the mainmenu
> > to the left. Is there any way to do this so that the tiddler does not
> > open in the viewer area? I'm not sure how to do that.
>

Eric S.:

> In the above document, the topmenu is defined in [[TopMenu]], and uses
> HTML links to invoke javascript to switch between the menus displayed
> on the left.
>
> The javascript for each link contains a line like this:
> story.displayTiddler(null,'MenuAItems');
>
> If you remove that line from each link, it will then only switch the
> left menus without also displaying the corresponding menu definition
> tiddler.
>
> -e
>

Eric, your advise works for not opening a new tiddler while still
switching the left menu.
But it still closes any open tiddler too.

By removing also the preceeding line:

story.closeAllTiddlers();

an alert shows up, that I'm about to leave the page, and it does go
blank with a small 'none' in the upper left corner if I proceed.

Is there any other way to have all tiddler still left open with this
script?

http://www.giffmex.org/nteng/philemontiddly.html#TopMenu
http://oldcat.googlegroups.com/web/MenuMoreEn.html?gda=j8YRpUAAAACZpqdPZP85_wXX8V_YfXizhQoYbyNEKl0KhW4NFxy3V2G1qiJ7UbTIup-M2XPURDTb654oTp4ejupRWMqnTFyP#TopMenu

regards..

Eric Shulman

unread,
May 25, 2009, 6:55:42 AM5/25/09
to TiddlyWiki
> Eric, your advise works for not opening a new tiddler while still
> switching the left menu.
> But it still closes any open tiddler too.
> By removing also the preceeding line:
>  story.closeAllTiddlers();
> an alert shows up, that I'm about to leave the page, and it does go
> blank with a small 'none' in the upper left corner if I proceed.

You need to make sure that each link handler (the
href="javascript:...." part) ends with:
return false;

This will prevent the browser from atttempting a page transition.

The reason this occurred is that the 'return value' from the href-
invoked script is always equal to the value of the last statement or
expression evaluated. "story.closeAllTiddlers()" has an implicit
value of 0 (equivalent to 'false'). As such, when that was the last
statement, the script was returning false... hence, no page
transition.

However, when you removed that last statement, the previous statement
(i.e., 'docment.getElementById(...).style.display="none") then became
the last one... and, because the value of an assignment statement is
the same as the value that is being assigned, the script as a whole
takes on a 'return value' of "none".

The result: a page transition occurs, and the return value "none" is
used as the target content for the new page, just as you observed.

enjoy,
-e

Måns

unread,
May 25, 2009, 9:13:34 AM5/25/09
to TiddlyWiki
Hi Wolfgang and Eric

I'm trying to customize MenuMore to behave in a way that is similar to
Dave Giffords Philemon.
I changed the story.displayTiddler(null,'MenuAItems'); to
story.displayTiddler(null,'MainTiddler for menuA');
I couldn't just remove "story.closeAllTiddlers();" and replace it
with "return false;" - it had no effect what so ever..
But I wanted to show something related to the menuswitch anyway so it
doesn't really matter..

2 questions regarding MenuMore:

1) How do I get to the backstage? -
2) If there isn't a backstage - how do I upgrade it to 2.5?

YS Måns Mårtensson
> http://www.giffmex.org/nteng/philemontiddly.html#TopMenuhttp://oldcat.googlegroups.com/web/MenuMoreEn.html?gda=j8YRpUAAAACZpq...
>
> regards..

wolfgang

unread,
May 25, 2009, 7:34:22 PM5/25/09
to TiddlyWiki
> I couldn't just remove "story.closeAllTiddlers();" and replace it
> with "return false;" - it had no effect what so ever..

Thanks for your help Eric. I uploaded a sample TW to:

http://menuflex.tiddlyspot.com/

Clicking the items in the TopMenu:
'PageTemplate' shows the effect of removing
story.displayTiddler(null,'MenuItems');
'StyleSheet' by also replacing
story.closeAllTiddlers(); with return false;

What I've done wrong?

Also, what is the reason the left menu bar isn't opening on startup?

>
> 2 questions regarding MenuMore:
>
> 1) How do I get to the backstage? -
> 2) If there isn't a backstage - how do I upgrade it to 2.5?
>

1) MenuMore is with an older TW Version which didn't had an backstage.
2) You can import its tiddlers into a new version of TW either through
the backstage, or with Eric's ImportTiddlersPlugin.

regards..

Måns

unread,
May 25, 2009, 8:45:10 PM5/25/09
to TiddlyWiki
Thank you Wolfgang..

I've tried to combine TwT-notes with treeview and Dave's MenuMore
version with my own TW..
In the process I discovered that MenuMore's javascripts in html -
doesn't accept HTMLFormattingPlugin http://www.tiddlytools.com/#HTMLFormattingPlugin
and Morris' TwT-notes (or treeviewPlugin) doesn't accept
EditFieldPlugin http://www.tiddlytools.com/#EditFieldPlugin...

I can live without both plugins (if I have to ...) - but I know too
little about css to alter the stylesheet to make the viewarea fill the
screen to the right...
And i don't know how to change the tree backgroud to go with the
menubar... so it's pretty ugly just now...
You can watch/download it here: http://dl.getdropbox.com/u/1064531/NoterMenuer.html
- if You'd like to take a look at it... (Sorry ... but it is in
Danish)

I'm also interessted in finding out how to make the left menubar open
with one of the mainmenus on startup...

YS Måns Mårtensson

Eric Shulman

unread,
May 25, 2009, 8:51:57 PM5/25/09
to TiddlyWiki
> Clicking the items in the TopMenu:
> 'PageTemplate' shows the effect of removing
>  story.displayTiddler(null,'MenuItems');
> 'StyleSheet' by also replacing
>  story.closeAllTiddlers();  with  return false;
> What I've done wrong?

Because you are using the href="..." to define the handler, you can't
use the 'return false;' syntax.

Here's a better bit of HTML syntax using the onclick="..." handler

<a href="javascript:;" onclick="if (story) {
document.getElementById('mainMenuD').style.display = 'block';
document.getElementById('mainMenuA').style.display = 'none';
...
document.getElementById('mainMenuJ').style.display = 'none';
return false;
}">StyleSheet</a>

-e

Måns

unread,
May 25, 2009, 9:01:00 PM5/25/09
to TiddlyWiki
Am I so lucky that this will make it possible to use
HTMLFormattingPlugin as well??
I've tried to insert the <nowiki> command into the htmlcode - with no
effect...


YS Måns Mårtensson

wolfgang

unread,
May 26, 2009, 5:11:18 AM5/26/09
to TiddlyWiki
> Here's a better bit of HTML syntax using the onclick="..." handler
>
> <a href="javascript:;" onclick="if (story) {

Thanks Eric again. This was the solution to my main question

> I've tried to combine TwT-notes with treeview and Dave's MenuMore
> version with my own TW..

That's also my reason for trying to adapt MenuMore to the Overflow
style by FND with variable MainMenu width, so that visualisation
plugins menus have the variable space needed, while still keeping a
regular MainMenu in the same place.

> I've tried to insert the <nowiki> command into the htmlcode - with no
> effect...
>

Try <hide linebreaks> right after the first <html> tag.

> I can live without both plugins (if I have to ...) - but I know too
> little about css to alter the stylesheet to make the viewarea fill the
> screen to the right...

You have many style adjustment in your TW, so I don' really know if
this works in your case:

#sidebar{display:none}

.> Also, what is the reason the left menu bar isn't opening on
startup?

> I'm also interessted in finding out how to make the left menubar open
> with one of the mainmenus on startup...

We'll have to compare it with the original code again Mans, since it
does it in the original MenuMore.

regards..

wolfgang

unread,
May 27, 2009, 6:57:20 PM5/27/09
to TiddlyWiki
> > How about a html ThumbThing for text? - Opening a popup with tiddler
> > content by hovering above a link?
>
> You can achieve this with just a slight tweak to
> http://www.TiddlyTools.com/#ShowPopup
> by changing
> onclick="..."
> to
> onmouseover="..."
>
> enjoy,
> -e

Wow, just realized that with the slight changing of 'onclick' to
'onhover' MenuMore's top menu items can easily be changed to opening
on hover (well, not every one is as bright ;-). Replacing many plugins
which I use in combination - to create elaborate menus and have fast
access to deeply buried content of my TWs - as there are:
PopupTipsPlugin, DropdownMenuPlugin, NestedSlidersPlugin,
MoveablePanelsPlugin, InlineJavascriptPlugin...

But 'on hover' is not always that beneficial, especially with the
adaptation of MenuMore to open with variable width MainMenus (css by
FND). Though I found simple html scripts to toggle the PageTemplate,
the sidebar menus and tried to adapt these. Still, by fail and trial I
haven't been able to change them to a simple class change: from
'onclick' to 'onhover' and back again, without any further
dependencies (ie. InlineJavascriptPlugin). Therefore my question: How
a html script switch in this case would look like?

Some more questions, which arose out of creating most possible
flexible menus without dependencies to any plugins from this other
thread:
http://groups.google.com/group/TiddlyWiki/browse_thread/thread/dd115fffaa4375de/68acc6d5d58284c9

>
> 1) As it is, a onhover popups open below and at the first letter of a
> popup link. How do I change the css to have it open to the left of it?
>
> 2) Also I haven't found out where I lost the original behavior of
> MenuMore to start up with an opened MainMenu. Any help with this,
> or a different solution would be highly appreciated.
>
> 3) How do I trim the search box, so it can be placed into the TopMenu
> without widening it?
>
> 4) I'm grateful for any other suggestion, other css tweaks or html
> scripts worth the inclusion...

... especially ways of transclusion to make this otherwise very
mistake prone adaptation of MenuMore more foolproof to those without
prior knowledge of html and css.

regards..

wolfgang

unread,
May 27, 2009, 7:08:27 PM5/27/09
to TiddlyWiki
> Wow, just realized that with the slight changing of 'onclick' to
> 'onhover' MenuMore's top menu items can easily be changed to opening
> on hover (well, not every one is as bright ;-). Replacing many plugins
>
> But 'on hover' is not always that beneficial, especially with the

some more brightness ;-)

'onhover' should of course read: 'onmouseover'

wolfgang

unread,
May 31, 2009, 8:50:29 PM5/31/09
to TiddlyWiki
> > I'm also interessted in finding out how to make the left menubar open
> > with one of the mainmenus on startup...
>
> We'll have to compare it with the original code again Mans, since it
> does it in the original MenuMore.
>


Hureka, found the culprit.
Only one more display:block; for mainMenuA was all what was needed.
Now the main MainMenu does open on a startup.

regards..

Måns

unread,
Jun 1, 2009, 3:37:14 AM6/1/09
to TiddlyWiki
Great Wolfgang - I think your MenuFlex should be announced - with it's
own thread - so I took the liberty!
Hope it's ok. http://groups.google.com/group/TiddlyWiki/browse_thread/thread/6da1582e325a46a5?hl=en

YS Måns Mårtensson

wolfgang

unread,
Jun 1, 2009, 8:13:48 AM6/1/09
to TiddlyWiki
> Great Wolfgang - I think your MenuFlex should be announced - with it's
> own thread - so I took the liberty!
> Hope it's ok.http://groups.google.com/group/TiddlyWiki/browse_thread/thread/6da158...
>

Thanks Mans, the main bugs have been ironed out.
However, it still needs some more polishing.

regards...

wolfgang

unread,
Jun 3, 2009, 8:57:03 PM6/3/09
to TiddlyWiki
>
> You need to make sure that each link handler (the
> href="javascript:...." part) ends with:
> return false;
>
> This will prevent the browser from atttempting a page transition.
>
.
>
> However, it still needs some more polishing.
>

Now, as it is possible to make a menu switch without opening a tiddler
in the display area of MenuMore - together with dynamically widening
main menus - the problem arises that the display area does not
refresh. Therefore leaving gap,s with varied width main menus
switched.

I tried it with pasting different code snippets, for example:
story.refreshDisplay(); return false;}">$1</a></html> - but it didn't
work to cause a refresh. What would be the right way?

Regards..





wolfgang

unread,
Jun 5, 2009, 7:55:37 AM6/5/09
to TiddlyWiki
> Now, as it is possible to make a menu switch without opening a tiddler
> in the display area of MenuMore - together with dynamically widening
> main menus - the problem arises that the display area does not
> refresh. Therefore leaving gaps with varied width main menus
> switched.
>
> I tried it with pasting different code snippets, for example:
> story.refreshDisplay(); return false;}">$1</a></html> - but it didn't
> work to cause a refresh. What would be the right way?
>


story.refreshTiddler(getAttribute('tiddler'),null,true); return
false;;}">$1</a></html>

- did the trick. It only doesn't always work with Shadowed tiddlers
though. Which isn't really an issue at all.


On 1 Jun., 09:37, Måns <humam...@gmail.com> wrote:

> Great Wolfgang - I think your MenuFlex should be announced - with it's
> own thread - so I took the liberty!
> Hope it's ok.http://groups.google.com/group/TiddlyWiki/browse_thread/thread/6da158...

> > However, it still needs some more polishing.
>

Except for some of the individual menus - especially the automatic
creation of nestled popups with tags - the theme itself with the
function for switching between individual main menus is pretty
polished now.

:-)

http://menuflex.tiddlyspot.com/
Reply all
Reply to author
Forward
0 new messages