code: function init(state) {
      var canvas = o('#loading canvas').get(0)
          , ctx = canvas.getContext('2d');
  
      loading = new LoadingIndicator;
      loading.ctx = ctx;
      loading.size(canvas.width);
  
      pollStats(1000);
      show(state)();
      o('li.inactive a').click(show('inactive'));
      o('li.complete a').click(show('complete'));
      o('li.active a').click(show('active'));
      o('li.failed a').click(show('failed'));
      o('li.delayed a').click(show('delayed'));
  
      o('#filter').change(function () {
          filter = $(this).val();
      });
  
      o('#sort').change(function () {
          sort = $(this).val();
          o('#jobs .job').remove();
      });
  
      onpopstate = function (e) {
          if (e.state) show(e.state.state)();
      };
  }
docs: Initialize UI.