DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG� RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://issues.apache.org/bugzilla/show_bug.cgi?id=35227>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND� INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=35227 Summary: [Patch] sitetree js fails for some older browsers Product: Lenya Version: 1.2.3 Platform: Other OS/Version: other Status: NEW Severity: normal Priority: P2 Component: Site Management AssignedTo: [email protected] ReportedBy: [EMAIL PROTECTED] --- [EMAIL PROTECTED] wrote: >> The site navigation tree (accessed by clicking on the "Site" tab in >> authoring mode) doesn't work in certain versions of Lenya and for >> certain versions of Netscape. --- [EMAIL PROTECTED] wrote: >> during the development of 1.2.3, the sitetree js was rewritten to be >> AJAX-based for better performance. it seems you are seeing problems >> related to that rewrite. >> >> i am curious why nn 7 would fail when ie 6 works given that nn 7 has >> the more modern js implementation. can you try to figure out more >> details about the nn 7 situation? it seemed to me you were not running >> against the same lenya in your tests. Again, I have confirmed that this bug exists in Lenya 1.2.3 and 1.2.4-dev. It is only an issue for Netscape 7.0 and 7.1. However, I have found the problem and would like to propose a solution. First, a quick description of how the navigation tree on the "Site" tab works (for those who aren't familiar with it but want to understand the resolution). Basically, JavaScript is used to retrieve the navtree's data as XML and then model it using a custom JavaScript data structure -- a tree that is capable of rendering itself as a pretty menu on the page. [ on a side note, the XML is retrieved synchronously so I guess you could call it SJAX. ;) ] While the JavaScript tree is being built, a few conditional checks are done on the XML source. Specifically, tag names of the various nodes are tested. For example: if( children[i].tagName == 'nav:label' ) This line checks to make sure the XML tag is "<nav:label>". However, this is where the problem lies for some versions of Netscape (due to how the DOM elements interface is implemented). The .tagName property does NOT include the namespace prefix in NN 7.0/7.1. Continuing the example above, this means that 'label' is returned instead of 'nav:label'. This fails the test of course (in several locations in navtree.js), causing the whole thing to barf. I have been able to fix this problem on my own Lenya 1.2.3 installation by adding the following little "helper" function to navtree.js: function getTagName(element) { var tagName = element.tagName; var prefix = element.prefix; if(tagName.indexOf(prefix + ':') == -1) { tagName = prefix + ':' + tagName; } return tagName; } By using this function, you're ensuring that the prefix is always included. The usage example from above becomes: if( getTagName(children[i]) == 'nav:label' ) It's unfortunate that you have to include something like this just for one browser's DOM implementation, but that's life in JavaScript-land. If the Lenya developers think this is an acceptable solution, I would hope that they included it Lenya 1.2.4. Can someone follow-up on this and put it in Lenya's bugtracker? clint -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
