Completion #3

I’ve been working on the JavaDoc API gadget over Christmas. I know, it’s as if I just don’t understand the concept of “holidays”. Anyway.

The UI now works perfectly in firefox and safari (at least as far as I can tell), in opera with just a single glitch and reasonably well in IE as long as you don’t resize the browser window. I have also fixed a few bugs, including some issues with inner classes, and implemented a feature several people have been asking for: pressing in the text field now takes you to the top item on the list.

A less visible improvement is that a lot less data now has to be transferred to the gadget when you start to write in the text field — the class index is down from 60K to 20K in browsers that support gzipped content (which these days turns out to be pretty much any of them).

The downside is that the code is now pretty atrocious. I quickly realized that having just one HTML document and one javascript file for all the different browsers was no good. Instead, I now generate different files for each of firefox, safari, opera and explorer. In fact the files are being generated using the most stone-age technique imaginable: cpp. Here’s an actual piece of code from the implementation:

function KeyEventMatches(e, r) {
#ifdef EXPLORER
var c = window.event.keyCode;
#else
var c = e.which;
#endif
return String.fromCharCode(c).match(r);
}

I know, absolutely terrible but it actually works pretty well and, most importantly, requires no resources at runtime.

Oh, and I’ve moved the gadget here:


Add to Google

The old location will disappear shortly.

I hope to clear up the last outstanding bugs, especially the thing with resizing in explorer, this week.

6 Responses to Completion #3

  1. Where did you move the gadget to?

  2. If you just click the “add to google” button it should add the new version to your google homepage.

    Otherwise the gadget definition is here and the page that contains the gadget is here

  3. I don’t see a button.

  4. You don’t see a button, right after where it says “I’ve moved the gadget here” that has a blue plus and says “add to Google”? Odd…

    Try this link instead.

  5. When I type Object I don’t get java.lang.Object as one of the possibilities!

  6. Hmm, apparently it doesn’t handle duplicates well. By the way, why would anyone make another class Object?!? Well, CORBA did and of course it should work.

    However, I’m sort of losing interest in this project so I probably won’t fix this problem any time soon. Sorry.

Leave a Reply

Your email address will not be published. Required fields are marked *


*