… an interesting … “documentation”

Posted June 20th, 2011 in development by Michael

dojox.layout.ScrollPane is an interesting UI, scrolling an overflowed div based on mouse position, either vertical or horizontal.

Not only the behavior is interesting, but also the “lengthy and detailed” documentation:

Available since version 1.0, but still no documentation… :(

Dojo documentation :(

Posted May 16th, 2011 in development by Michael

I need to rant about this… the Dojo documentation is simply in very very bad shape… For example the superb description of the dojo.subscribe feature:

This is one of the major features, available since Dojo 0.9. And there is NO documentation available. And I’m even not going to talk about the fact that there are tons of broken links in the documentation or examples do not work on their own site… (if samples are available at all).

“Unbeatable JavaScript Tools” – I agree to this slogan 100%. Unbeaten in performance, bugs and documentation.

</rant>

Dojo 1.6 and open bugs

Posted April 21st, 2011 in javascript by Michael

Wow, I can hardly believe it… In Dojo 1.6.0 my very old bug has finally been fixed…. it supports scheme less URLs, after almost 2 years, wow!

Bug closed.

Dojo and fixing bugs

Posted August 27th, 2010 in development by Michael

After complaining about Dojo taking so long fixing bugs I found another quite interesting bug report this morning:

Dojo Bug 7844:

  • Filed almost 2 years (!!!) ago
  • Filed against Dojo 1.2
  • Not fixed with the latest 1.5 release, but moved to 1.6 now

Yes, fixing the dojo.back in IE8 is definitely harder than the 1/2 line fix for 8546, but in the end dojo.back is “supported” since Dojo 1.0, so I’d expect that Dojo is tested against new browsers and bugs are fixed in a timely manner…

Dojo 1.5 and open bugs…

Posted August 19th, 2010 in javascript by Michael

And the saga continues… I reported a Dojo bug about scheme-less URLs in March (filed against 1.4.2)… now the brand new 1.5 has been released and the (simple-to-fix bug)… was not fixed.

Why? Well, I don’t know. Maybe because they don’t care? The comment in bug 8546 is:

It’s been open for 18 months, and it was pointed out to me as a bug by a large user of Dojo and jQuery. They reported the issue to jQuery, and it was fixed in 2 weeks, and we’re going on 18 months.

Sorry dojo, speed-wise you already lost, no matter what you do!

Scheme-less URLs in xDomain Dojo

Posted March 22nd, 2010 in javascript by Michael

Sometimes I have the feeling that the only large Web site that uses scheme-less URLs is the one I work with during office hours… because not a lot of Web sites use this handy feature which allows to include resources independent of the protocol (i.e. <link type=”text/css” rel=”stylesheet” media=”all” href=”//www.domain.com/styles/main.css” /> – note the missing protocol). This works cross browser and is perfectly valid – and saves the hassle of security warnings in IE in case of secure Web sites.

Anyhow, when I used the jQuery library it turned out that these scheme-less URLs confused the .getScript function. The bug was easy to find and report and after some whining it got fixed. I mean, how hard is it? Fix the simple bug, add a test case to the unit tests (you do unit test, don’t you?), run the tests done.

Does not seem to be the case with Dojo, which experiences the same bug (already reported here and here). Not only that the bug is open since 14 month, this simple bug was reported in version 1.2.3 and won’t be fixed until version 2.0? Come on, you must be kidding! Signing up and submitting a comment or patch (1/2 line of code: || relpath.indexOf(‘//’) === 0 appended to the first if in the function _xdIsXDomainPath) is also not possible because the user sign-up leads to a 404 page. Uuups.

So I’ll end up with maintaining my local patch file, and hopefully I remember to apply the patch in case there is a future Dojo upgrade…

Display Dojo tooltips based on the title tag

Posted April 21st, 2009 in javascript by Michael

Recently I had to add nice tooltips to a larger Web application that is based on the Dojo framework. I thought “nothing easier that that”, as with jQuery I can do stuff like

jQuery('a').tooltip();

with some (optional) parameters and that’s it. Unfortunately I had to learn from the various sources and samples that this simple feature is not supported out of the box by Dojo. There is a way of creating tooltips on the fly but there does not seem to be a ready-to-use solution which uses the title tag of the elements and shows a tooltip based on that.

So here is the code I came up with to display Dojo tooltips based on the title tag:

dojo.addOnLoad(function() {
  //render each tooltip
  var i = 0;
  dojo.query(".withTooltip").forEach(function(node) {
      if(!node.title)
          return; // don't do anything if there is no title
      if(!node.id) // Dojo requires an ID for the element
      {
          node.id = "dojoToolTip-"+i;
          i++;
      }
      var tt = new dijit.Tooltip({label:node.title, connectId:[node.id]});
      node.title = ""; // remove the Browsers standard title tag
  });
});

The code selects all elements with the class “withTooltip” and creates a Tooltip dijit for each of the found elements. It is important to notice that an ID is being added in case there is none – dijit.Tooltip requires an id and does not seem to work with classes or just an element being specified.