This is the news archive, where I store old news to keep the size of the news section down to something more friendly.
It's finally here. Version 2.3.0, the update we've all been waiting for. Long overdue, gone through several deadlines, and been talked about for way too long. Let's have a look at what's added:
Yes, it now works with Netscape 6.0 too. Some quirks had to be fixed through usage of a rather large hammer, but generally things went smoothly. Speed is good, everything works, another browser added to the list.
For each menu item, both regular items and sub menus, it is now possible to define a tool tip with a longer explanation of what lies behind it. The job of showing this to the user is left to the browser, which leaves Netscape 3 and Netscape 4 users without it as for now. This is due to the fact that using the title attribute, leaving most of the job to the browser, was a million times easier than fiddling around with DHTML layers.
You can now tell the tree menu to store its state in a cookie so that the user gets the same menu when he/she returns to your site. The name of the cookie and the number of days to store it is set in the options.
Instead of just being an on/off-option MTMSubsGetPlus is now a tri-state option. You can set it to "always" and have all your sub menus get a +/- sign, and you can set it to "submenu" to get +/- signs when a sub menu contains one or more sub menus, just like previously. But, you can now also set it to "never" and have a tree menu without +/- signs alltogether.
Two options have been added, one for HTML used for a header above the menu, and one for HTML used for a footer below the menu. What the HTML should be you choose yourself. There's also an option for extra style sheet properties which you can use to control the header and footer to suit your own preference.
The function MTMakeSubmenu() now has three additional arguments, allowing you to set the open/closed state of the sub menu as well as defining icons for open and closed state. This makes it a lot easier to have a sub menu open by default, as well as giving sub menus better looks through separate icons. My thanks go to Arthur Veinstein for providing code for this.
Opera 5 support most of the tree menu features in the fact that it doesn't throw any errors and it actually does give you an interactive menu. But, due to bugs in Opera's JavaScript support scrolling doesn't work correctly, cookie support is on a per-session basis, and tracking doesn't work if the user navigates using the back/forward-buttons. Bug reports will be handed to Opera Software hoping that these things will be supported later.
When browsing a tree menu site's file locally, Microsoft Internet Explorer would refuse to track correctly. I received a fix for this bug from two tree menu users and have updated the code. Thanks go to Bill Lange and David Favis-Mortlock for the code.
Also, the tracking code has been updated so it would correctly track documents with query strings (?foo=bar&etc). This means that dynamically created documents requiring query strings to work will now be tracked correctly. Mark Parenti supplied the code for this fix.
The inline style sheet written by the tree menu code has been altered slightly so that the problematic "flash" of the white background in Microsoft Internet Explorer 4 is a thing of the past. There are also changes to the code to make it more flexible and easier to maintain.
As always, get your files in the download section.
"Haven't you updated your site the past year?" somebody asked me in an e-mail the other day. Well... I have, but not a lot. Things are improving though. As you might've noticed there's a SourceForge image in the top right corner. After being the sole developer of the menu for a bit over two years I've come to the conclusion that it should be easier for others to participate. The result is that there's now a SourceForge prosjet for the tree menu. With the excellent services that SourceForge provides it will be asier for others to participate as well as to keep track of bugs, feature requests and other things. The project on SourceForge can be found through http://sourceforge.net/projects/jsmenu/
For those of you who're on the mailing list it will come as no surprise that the CVS repository on SourceForge holds the latest beta code for version 2.3.0. I'm doing the development, it's close to being finished, and things get uploaded to CVS as I go along. If you're keen on testing out the upcoming version (sans tool tips and support for Netscape 6/Mozilla) feel free to go have a look.
I send small updates to the mailing list for each CVS commit that I do, so if you want to be notified when things happen you should go join. I'll also update the site more when things get closer.
I released version 2.2.6 today. The new release is a small bugfix to make sure the menu once again works with WebTV. Prior 2.2.*-versions do not work with WebTV, and sites targeting WebTV users should therefore upgrade.
The problem with the other versions was that the script thought WebTV was Netscape v3 since WebTV reports Netscape 3-like values when you ask it what browser it is. I didn't think of this when I worked with v2.2, so there was no strict search for WebTV like there was for Opera. This has been changed now, the script does a strict search for both browsers in both the script itself and the tracking code. Apart from updating tracking code found in all documents the only thing needed to upgrade is to copy the new mtmcode.js over the old one.
Version 2.2.5 was released today, and the new site was launched as well. The new version is a small bugfix to take care of synchronization problems when the menu was loading. The tracking code in the content documents would start the update of the menu before the code was fully loaded, producing error messages. It was fixed by introducing a new script variable called MTMLoaded which is set when the code is finished loading. The tracking code has been changed to check for this variable before updating the menu. You'll therefore have to change the tracking code to take advantage of the new version.
As always the downloads have been updated. I have also created new example sites with more complex menus. This will hopefully make it easier for people to try out the menu for themselves.
Also, as you can so clearly see, there's a whole new web site here. I've updated all documents to incorporate the fact that I've got my own domain. There's no huge content changes yet though, but I've got great plans for the future. So stay tuned for an even better menu site!
I released version 2.2.4 today. This version is partly a bugfix version and partly a transitional version. The bug it fixes is related to submenus not being opened when MTMSubsAutoClose was set to true. If you used the back/forward-button going to a document found in a submenu beyond the first level, the submenu would not be opened like it should. Version 2.2.4 fixes this.
This release is also a transitional version, hopefully making it easier to go over to version 2.3 when I release that. I have moved the code base into a JavaScript file called "mtmcode.js". This file is linked into code.html, and code.html therefore now only contains the user options, the definition of the icon list, and the menu code itself.
I've also removed some redundancy in the tracking code and I've re-written some pages found here on the web site. The part "Other information" found on the front page has gotten the largest modification. Hopefully it now reflects my views in a more comprehensible way (I wasn't really satisfied with the previous version).
Version 2.2.3 was released today. It's a small bugfix-release. Previous 2.2.x-versions had a problem with the tracking code, prohibiting the menu from working if your links had a target name of a frame that didn't exist. One is of course allowed to have such target names since they're supposed to open a new browser window. With the bugfix the menu works as it should again. Fetch the updated code in the download section.
I've also written a bit about what I'm planning on working on in the coming year, there's a lot of features and ideas I'd like to see implemented in the menu system. The short "essay" is found under notes from the author, a part of the site that I plan on updating at irregular intervals with things I care to write about.
I released version 2.2.2 today. It's a bugfix release which takes care of 3 bugs:
MTMDisplayMenu() from the onload event in code.html and instead call a poll function with a timeout setting. The new function is called MTMStartMenu() and the new option MTMTimeOut controls the timeout period in tenths of a second (1/10).
MTMDisplayMenu() currently doesn't take any parameters. The reference to the menu has simply been removed. The installation guide is updated with the new code.
MTMTrackExpand().
MTMTrackExpand() had a logical error since it would in some cases track items not matching the URL of the current content page. A check for "targetPath.lastIndexOf(thisMenu.items[i].url) != -1" has been added fixing the bug.
I've also added two new sections to the site: "Contributions" & "Sites in use". The first is meant for code contributed by others to do various tasks regarding the menu. I know that Jeff Williams has a menu that uses Microsoft's Remote Scripting to pull submenus from the remote server to keep menu size down, his code will probably be up there shortly. "Sites in use" is, naturally, meant to be links to sites where the menu is in use so people can see that it's actually being used. A form for contributing URLs is also found so it's easy to send URLs to me.
I've added a notice to the readme file found in the downloadable files. The notices specifically adresses users that are upgrading from earlier versions of the script. Here's an HTMLified version of the notice for those curious about what I've written:
I've released a bugfix of version 2.2.0 today, so the version number has been increased to 2.2.1. Oleg Ovanesya sent me an e-mail to point out an error in the function MTMCloseSubs(). The word 'myMenu' on line 396 has been changed to 'thisMenu'. The code on-site has been changed to reflect this bugfix, so both files in the download area are now correct.
Better late than never... version 2.2.0 is out! :)
Lots of stuff has changed this time around. Submenus can have URLs now, and the menu also works nicely with Netscape 3. I've re-written most of the code to make it short, simple and as fast as I can get it. Quite a lot of new options to give better handling of fonts & CSS. Here's a walk-through of the changes.
Submenus can have URLs. It used to be that items without a URL was a submenu, now you instead have to specifically attach a submenu to an item for it to actually be a submenu. There's a new option that determines behaviour of submenus. It's called "MTMEmulateWE", and has two values: true or false. The option mostly affects submenus with URLs, submenus without URLs will behave as before.
When set to true the menu will emulate the behaviour of Windows Explorer. This means that all submenus have +/- signs, and if the submenu has a URL it's only the +/- sign that expands/collapses the submenu. The folder image and the link text only shows the URL.
When MTMEmulateWE is set to false the menu will use MTMSubsGetPlus to determine whether a submenu will have a +/- sign. A collapsed submenu will expand & the URL will be shown in its target frame when clicked on. The expanded submenu will collapse if the user clicks the +/- sign (if it's present) or the open folder image. The item's text will show the URL in the target frame.
The menu has gotten color & font setup to make it more configurable for those who does not want to use a linked style sheet. Of course the option to use a linked style sheet is still around. Some of the color options have been removed, and instead there's one option defining the text used for all menu items. Other color options added is "MTMAhoverColor" which defines the color used when the mouse is over a menu item (only supported by IE4/5) and colors for when a submenu is expanded or collapsed (one color for each).
In addition there is options available to define the font used for all menu items and the root text ("Site contents:" on this site), as well as setting the font size for users with CSS-enabled browsers (Netscape 4.x & IE4/5) and for those with non-CSS browsers (Netscape 3). This should make sure all visitors get a menu that looks roughly the same.
The problem with external sites giving errors has been fixed. It proved to be a slightly difficult bug to fix. I ended up choosing a solution where one needs to update the tiny JavaScript that's in the head of all documents. The new script (found in "Tracking code") specifically enables tracking, which was the part of the script that caused the problem.
Since the script now has better font/CSS support you can set most options you need in the script instead of using a linked style sheet. One of the reasons for doing this is the known bug with IE4 where it locks up when a linked style sheet is used.
I've also become aware that the auto-closing of submenus didn't happen when the back/forward buttons were used and a submenu got expanded. This has also been fixed.
The scrolling has been re-written, a few options have been removed (MTMainFrame, the various linkColor options) and the code has gotten a decent brush-up. If you're upgrading from a previous version you should therefore go through all options to make sure they are set properly. I've also added a few pages to the web site, one with a list of sites running the menu and one for contributions. The latter isn't up yet, but there will be some neat stuff around. I've also removed the commented code file from the ZIP, it will be replaced with a detailed explanation of the code on-site (I'll be rewriting "How it works").
No updates to the script, instead an update to the web-site. I've finished the first version of the page talking about why one should use my menu. It's more of a general essay about menu systems, not trying to be a promotion page for the menu system. It's fairly long, hopefully it's worthwhile reading.
I've added a known bug to the bug page. If you link external pages in your main frame the script will flag errors when it's updated. I'll fix the bug as soon as I have the time.
There's also some comments added to the wish-list source, a page that'll be updated as soon as I have the time. That's all for now.
Version 2.1.1 is released! It's a quick bug-fix making Internet Explorer 5 scroll like it's supposed to. Microsoft has chosen to alter the parenthood of elements in version 5 which in turn meant that the calculation of an element's position in the document stopped working. This in turn made it so that all elements were calculated to be close to the top of the menu, and therefore the scrolling never kicked in. The script now identifies IE5 and makes sure things are calculated correctly.
There's also now two .zip-files available for download in the download area. One is the regular file, the other is a file where the code.html and commented-code.html files have Windows/MS-DOS line breaks so that people doing their file editing on the Windows platform won't have files without proper line breaks. I do my editing in emacs running under RedHat Linux, so I get line breaks anyway. :)
Apart from that there's also another feature on the wish list. I've got requests that sub-menus should have URLs connected to them so if the user clicks on the sub-menu a document will be shown in the main frame just like if a regular item was clicked. First thoughts say this will be an easy feat to add so stay tuned for version 2.2 which should be around Real Soon Now(tm). *grin*
Version 2.1 is released! At last I had a free week-end to get the wanted features in. There's quite a list of changes to this version and in my opinion it's wortwhile changes.
The option "MTMSubsAutoClose" has been added. It's a true/false variable which determines whether the user is only able to have one sub-menu open at a time. Set it to 'true' and an open sub-menu will be closed when the user opens another sub-menu. If it's set to 'false' sub-menus open/close depending on what the user does.
Don't really know what to call it, but I've added a powerful system for determining which icon each item gets. Previously it was one icon for absolute URLs (starting with "http://"), one default icon, and the possibility of specifying it for each item. The latter has been kept and has priority, so if you specify the item's icon it gets that icon. If no icon is specified the menu now has a list of icons which it will check against and give the item an icon accordingly. Items can have icons depending on a URLs file extention, protocol (e.g. "http://") or any text in the URL. This means you can easily give all items with a URL that point to one directory the same icon by only adding the necessary line to the icon list. For more information about the icon system read checking the icon list in the Installation Guide.
I've made it possible to specify the root icon by an option. The variable is called "MTMRootIcon" and the value is the name of the icon file. Like the other icons the location of the file is relative to the directory of menu images.
Because of the icon system change I've grabbed some screenshots from my system and added them as icons. Therefore, the directory 'menu-images' in the downloadable .zip-file now contains quite a lot more images. One image worth mentioning is the "menu_link_default.gif" which is the default icon used for resources without an icon specified or a match in the icon list. Change the image if you want a different default icon.
I've removed all comments from the file code.html to reduce file size. The .zip-file now contains a file "commented-code.html" which is about 10kB larger than "code.html" because of all the comments. If you want to know how everything works "commented-code.html" is your friend.
The menu now has its own mailing list. I've created a list on eGroups.com with the cute address tree_menu@egroups.com. My hope is that those who use the menu will join to receive announcements of new versions, report bugs, suggest features, discuss the code, basically anything that's got something to do with the menu. For information about how to subscribe there's a link called "Mailing list" on the menu.
Since I created the mailing list I've also updated the web-site slightly. I've moved some of the menu items a bit, and of course added the mailing list link. Apart from that nothing much has happened. I'm working on writing my philosophy paper which will feature some thoughts about the menu and my work. There's also some features I'd like to incorporate in the menu, and I'm slowly coming up with thought on how to implement them.
Updated version is released! Version number is now 2.0.4, in other words it's a bug-fix.
I did an update to the scrolling feature making it not scroll unless it actually has to. By "actually has to" I mean that the item a user selects (link or sub-menu) is so far down (or off screen) that it should be brough into focus. At the same time I also found and fixed a bug regarding scrolling of sub-menus. There's also a slight speed increase since I removed a couple of writes to the document.
I also found and fixed a bug relating to the automatic opening and closing of submenus (which is a feature of the tracking mechanism). The script refused to open closed submenus. This in turn made the scrolling look for an element on the page that didn't exist, and the result was error messages. Things work like they should now.
The site has gotten a couple more documents. I've created a download-page where I'll put a .zip-file containing a couple of example sites people can use. There's also a page explaining why I believe my menu is better than others, and also some of the philosophy behind my work. The installation guide's part one has also gotten a brush-up so it should be easier to understand.
A quick bug fix released. Version number is now 2.0.3.
The bug was only present in Microsoft Internet Explorer 4.x. Due to the way the script handles relative URLs it also tried to handle absolute URLs the same way. Therefore links that started with "http://" would end up being appended to an already existing local URL with a resulting "404 - File Not Found". The script now correctly identifies absolute URLs and will not append them to anything.
I've gotten the idea behind the upcoming update to the scrolling worked out, and have done a few tests so I know how things worked with Netscape Navigator & Internet Explorer. As soon as I have time to sit down and breathe for a few minutes I will sort it all out, make sure it works and publish the update.
Untill then the only news is that I've updated the menu with a version number (current is 2.0.2) and a cute little information-thing. Nothing huge, and the copyright-thing is not there to scare people away. I've included it now since I felt it was a good way of letting people know I made the script, and where more information about it can be found. I of course encourage everyone strongly to retain the message so people visiting your site can find out where the menu came from if they're interested.
Oooops! I forgot to update the .zip-file that contains the whole site when I put the latest update in. Now the file is updated and contains the code published on 1999-02-16.
I've also started some planning on adding a feature of "undocking" the menu and getting it in a separate window instead of the frame. This would also make the bottom part of the main window (where the menu and the main frame is) be only the main frame, and thereby give more room for the documents. Exactly how this feature will be implemented is yet undecided, but I saw that another menu had this feature and found it to be neat.
The docking/undocking feature will be put in after I have gotten the scrolling working as it should. I'm a bit more concerned about making current features work correctly, than I am about adding more features.
After some stress-testing of the two browsers that get the menu I've changed the way the browser writes output. Instead of doing a lot of writes to the document it only writes once for each table row. I am not sure how much faster the menu gets re-drawn (it doesn't affect loading by a huge amount), but I was able to spot a speed-increase on my P166.
I've also planned an update to the scrolling feature, but it'll have to wait three or four days. When I put that in the menu won't always scroll since at times it slightly distracting that it always scrolls for you.
Time for a little update. I've re-written the code, fixed some bugs and I've changed the name of all the variables to make sure they won't collide with other functions variables, or reserved ones. But most of all I've done two important things:
I found out a neat way to fix the problem with relative URLs in Microsoft Internet Explorer, and by doing so I was able to get the tracking working for that browser too. So now IE users also have a tracking-system that works.
I got a nice e-mail from a user asking me if the script could scroll down when you had long menus with scrollbars. It's a very neat idea, and I thought a bit about it, figuring how to actually implement it. After some fiddling around today I solved the problem and now both IE and Netscape users will see that the menu automagically scrolls down to the selected item (both sub-menus and links).
I've fixed the bug with apostrophes/single quotes in sub-menu names. The script now has a little function that takes care of those, so you can use them just as much as you like. Due to the fixing of this bug I've changed the name of the sub-menus with links to Mike Hall's page and my own pages. Now they both use the single quotes to show that it's possible.
I found a fix for the Netscape 3.04 error, and also did some minor updates to the pages. The problem with single-quotes/apostrophes in sub-menu names will be fixed as soon as I can put together a function that escapes them so the onMouseOver-text gets right.
Apart from that the main change is that the "mail morten!" link has changed to "Comments?" and it's now a link to a page with a form instead of being a mailto: link. Hope this encourages response from visitors.
The site's back up. I've re-written the script a bit and changed a bit how the site works. This so that non-JavaScript users also get useful content.
I've also added some options to the script so it's easier to set up correctly, and I've also trimmed away quite a lot of code so it's slimmer.
I pulled the whole site down since I found that the script locked up my Netscape Navigator when I tried to make content available to non-JavaScript using visitors. A few minutes later I found a way to fix the problem and will spend the week-end updating the script and the pages so it again works like it should.