See code in crowbar_framework/public/javascripts/nodes.js