function MaterialsFilePicker(callback) {
  this.doneCallback = callback;
  this.selectedMaterials = {};
  this.treeElement = $('#file-picker-tree');
  
  var courseId = gon.course;
  var that = this;
  $.ajax({
    url: '/courses/' + courseId + '/materials.json',
    success: that.onWorkbinStructureReceived
  });
}

MaterialsFilePicker.prototype.onSelectionCompleted = function() {
  var selectedItems = [];
  for (var id in selectedMaterials) {
    var currentTuple = selectedMaterials[id];
    selectedItems.push(currentTuple);
  }
  
  this.doneCallback(selectedItems);
};

MaterialsFilePicker.prototype.onWorkbinStructureReceived = function(rootNode) {
  
}
@@ -654,10 +654,214 @@
 de) %7B%0A  
+var shouldIncludeFiles = true;%0A  var treeData = parseFileJsonForJqTree(rootNode, shouldIncludeFiles);%0A  %0A  treeElement.tree(%7B%0A    data: treeData,%0A    autoOpen: true,%0A    keyboardSupport: false    %0A  %7D);%0A%7D;
 %0A
-%7D

Add initialization callback for file picker.