sprigot.js
// TODO: Don't use sprigot ctor opts here. Ask for explicit opts in params.
Don't use sprigot ctor opts here. Ask for explicit opts in params.
Don ' t use sprigot ctor opts here . Ask for explicit opts in params .
function load() {
    var rootId = getRootIdFromOpts(opts);
    Historian.init(graph.treeNav, rootId);
    legacyStore.getSprigTree(rootId, opts.format, loadTree.bind(this));
    function loadTree(error, tree) {
      if (error) {
        opts.loadDone(error, null);
      }
      if (tree) {
        tree = D3SprigBridge.sanitizeTreeForD3(tree);
        d3.select('title').text('Sprigot - ' + tree.title);          
        var targetId = opts.initialTargetSprigId;
        var matcher = function matchAny() { return true; };
        if (targetId) {
          matcher = function isTarget(sprig) { return (targetId === sprig.id); };
        }
        graph.loadNodeTreeToGraph(tree, matcher, function onGraphLoaded() {
          if (targetId === 'findunread') {
            respondToFindUnreadCmd();
          }
          opts.loadDone();
        }
        .bind(this));
      }
      else {
        opts.loadDone('Sprig tree not found.');
      }
    }
  }
function load ( ) { var rootId = getRootIdFromOpts ( opts ) ; Historian . init ( graph . treeNav , rootId ) ; legacyStore . getSprigTree ( rootId , opts . format , loadTree . bind ( this ) ) ; function loadTree ( error , tree ) { if ( error ) { opts . loadDone ( error , null ) ; } if ( tree ) { tree = D3SprigBridge . sanitizeTreeForD3 ( tree ) ; d3 . select ( 'title' ) . text ( 'Sprigot - ' + tree . title ) ; var targetId = opts . initialTargetSprigId ; var matcher = function matchAny ( ) { return true ; } ; if ( targetId ) { matcher = function isTarget ( sprig ) { return ( targetId === sprig . id ) ; } ; } graph . loadNodeTreeToGraph ( tree , matcher , function onGraphLoaded ( ) { if ( targetId === 'findunread' ) { respondToFindUnreadCmd ( ) ; } opts . loadDone ( ) ; } . bind ( this ) ) ; } else { opts . loadDone ( 'Sprig tree not found.' ) ; } } }
TODO: Don't use sprigot ctor opts here.
TODO : Don ' t use sprigot ctor opts here .