Spaces in aI cause inaction

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
User avatar
gardenguy
Advanced
Advanced
Posts: 22
Joined: Sat Jul 05, 2003 11:29 pm
Location: Hinsdale, MA USA
Contact:

Spaces in aI cause inaction

Post by gardenguy »

Unless there is something wrong with my editor (and there have been some issues), it appears that I can NOT have any spaces in the individual aI array menu listings. For example:
aI("text=Eating; status=Find a place to eat;url=http://hinsdale.sallyanddavid.com/code/ ... Restaurant");
is broken such that the status bar shows the url, not the text "Find a place to eat". If I delete that single space after "Eating;" and before "status", then the text appears in the status bar. In a similar way, if I put a space after "place to eat;" and before "url=" then the link will not click thru.
Is it just me?
Thanks
David
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Post by Andy »

It's the way the menu works.

If it finds a space it includes it as a charcter so "status" becomes " status" and isn't a match anymore. We could trim the spaces but it would add a delay to the rendering of the menu.

If it's a real problem we might look at it again.

Cheers
Andy
User avatar
gardenguy
Advanced
Advanced
Posts: 22
Joined: Sat Jul 05, 2003 11:29 pm
Location: Hinsdale, MA USA
Contact:

It's a feature

Post by gardenguy »

Andy,
My intent was to share what I learned and hope this gets in that manual we are all axiously awaiting (holding breath now).
Thanks so much for your hard work.
David
User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

Post by Hergio »

Andy,
I haven't had alot of time lately to experiment but I wanted to throw out a question to you about this topic. How would you put a semi colon into a menu label, or a status message since your code looks for the semicolon? I am assuming you parse up the string and look for matches like ";keyword=" and if not, you assume the semi colon and subsequent words are still part of the previous keyword's value.

Just a little thing that popped into my head and I haven't had a chance to test it myself.
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Post by Andy »

This is something that we really need documentation for.

The docs will also need to be quite comprehensive now because the menu can do so much more, it is getting quite complex.

Anyway, we have dealt with this problem. If you need to add any html entity such as none breaking spaces etc, they all include a semi colon. This doesn't really matter as the menu is smart enough to know that it is a HTML entity and deal with it. Like this:

Code: Select all

aI("text=Semi colon = &#59 space =  ;showmenu=menu");


However, if you just need to include a semi colon as plain text, you'll need to enclose it in backquotes like this:

Code: Select all

aI("text=Menu Item;status=`semi ; ; ;  colon`");
This is also used for when you need to include html inside a menu item.

Cheers
Andy
jbreslow
Advanced
Advanced
Posts: 28
Joined: Mon Oct 14, 2002 10:04 pm

Post by jbreslow »

Does surrounding the semi-colon in backquotes apply to a semi-colon that is in a url?


I.E.

http://mysite.com/command.shtml?calid=F ... 2_weekview
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Post by Andy »

It should do.

Try:

Code: Select all

aI("text=Test Item;url=`http://mysite.com/command.shtml?calid=FA03-EPI2;FA03-HA2;FA03-HEM2;FA03-HIST2;FA03-ICM2;FA03-SBS2&view=fa03ms2_weekview`;");
Cheers
Andy
jbreslow
Advanced
Advanced
Posts: 28
Joined: Mon Oct 14, 2002 10:04 pm

Post by jbreslow »

Yeah, that didn't work. Here is what the returning URL is when I tried to open it into a new window.


http://mysite.com/website/'http://calen ... ;FA03-ICM2
User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

Post by Hergio »

Then try

Code: Select all

aI("text=Test Item;url=`/command.shtml?calid=FA03-EPI2;FA03-HA2;FA03-HEM2;FA03-HIST2;FA03-ICM2;FA03-SBS2&view=fa03ms2_weekview`;");
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."
Post Reply