Categories
Etc

Monday the 4th

Time flies when you’re about to have a baby.

  • Code complete is coming up for beta on Friday. I’m working furiously to get DnD manipulation of the tree back in before then. Just about done, just have to get the drop working and reporting back to the server.
  • Checked in a mod to the build system to include the svn revision in a config file that gets pulled in by Clearsilver to build the URL to our JavaScript and CSS files. This lets us set the Expires headers to far far in the fugure, which helps reduce the amount of stuff returning clients have to download. It was my first big foray into mucking with the SCons build system, and it took a while to figure out was going on. I never did find a good way to to debug things past using lots of print statements.
  • Wrote a handy little wrapper that provides onMouseEnter / onMouseLeave semantics for non-IE browsers.
    function connectMouseLeave(node, obj, func) {
      // summary: Hook up an event handler that fires
      //          when the mouse leaves the node.
      //          Ignores out events for children of the node
      if(dojo.isFunction(obj)) {
        func = obj;
        obj = null;
      }
      if(dojo.isIE) {
        // IE provides this natively
        return dojo.connect(node, "onmouseleave", obj, func);
      }
      var listener = dojo.hitch(obj, func);
      var f = makeOverOutHandler(listener);
      return dojo.connect(node, "onmouseout", f);
    }
    
    function connectMouseEnter(node, obj, func) {
      // summary: Hook up an event handler that fires
      //          when the mouse enters the node.
      //          Ignores over events for children of the node
      if(dojo.isFunction(obj)) {
        func = obj;
        obj = null;
      }
      if(dojo.isIE) {
        // IE provides this natively
        return dojo.connect(node, "onmouseenter", obj, func);
      }
      var listener = dojo.hitch(obj, func);
      var f = makeOverOutHandler(listener);
      return dojo.connect(node, "onmouseover", f);
    }
    
    function makeOverOutHandler(f) {
      // we're making the function here to avoid building
      // a closure that includes the dom node passed into
      // the connect functions
      return function(evt) {
        var n = evt.relatedTarget;
        var c = evt.currentTarget;
        // walk up the relatedTarget and see if it has 
        // the currentTarget as a parent
        // this relies on the fact that dojo normalizes the
        // event object to include the proper currentTarget
        // and relatedTarget for mouseover/out events
        while(n && n !== c) {
          n = n.parentNode;
        }
        // if the relatedTarget doesn't have the currentTarget
        // as a parent, we've stepped into or out of the
        // currentTarget, so call the event handler
        if(!n) f(evt);
      };
    }
  • Mandy had an ultrasound today and we found out the little guy has feet 9cm long! He’s still measuring a bit large… Big meeting with the doc tomorrow to figure out what we’re doing.
Advertisements