<commit_before>'use strict';
/* Global var Declarations */
var schools = [];
var projects = [];

/* Stuff to handle things on the page, manipulate the DOM, etc.  */
$('#portfolio').on('click', showProjects);
function showProjects(){
  $('.content section').hide();
  $('.projects').show();
}
$('#education').on('click', showEducation);
function showEducation(){
  $('.content section').hide();
  $('.education').show();
}
$('#home').on('click', showAll);
function showAll() {
  $('.content section').show();
  $('.template').hide();
}

$('.hamburger').on('click', showNav);
function showNav(){
  $('nav section').toggle(400);
}
rawProjectTemp = $('#project-template').html();
actualProjectTemp= Handlebars.compile(rawProjectTemp)

 /* Stuff to handle the data, and append to page  */
function School(schoolObj) {
  this.name = schoolObj.name;
  this.startDate = schoolObj.startDate;
  this.endDate = schoolObj.endDate;
  this.award = schoolObj.award;
}

function Project(projectObj){
  this.name = projectObj.title;
  this.url = projectObj.url;
  this.about = projectObj.about;
}

School.prototype.toHTML = function(){
  var $newSchool = $('.template.education').clone();
  $newSchool.removeClass('template');
  $newSchool.attr('data-education', '')
  $newSchool.find('h2.name').text(this.name);
  $newSchool.find('p.startDate').text(this.startDate);
  $newSchool.find('p.endDate').text(this.endDate);
  $newSchool.find('p.award').text(this.award);
  return $newSchool;
}


Project.prototype.toHTML = function(){
  var $newEntry = $('.template.projects ').clone();
  $newEntry.removeClass('template');
  $newEntry.attr('data-projects', '');
  $newEntry.find('h2').text(this.name);
  $newEntry.find('.url').attr('href', this.url);
  $newEntry.find('.description').text(this.about);
  return $newEntry;
}
projectObjects.forEach(function(project){
  projects.push(new Project(project));
});

schoolObjects.forEach(function(school){
  schools.push(new School(school));
});

schools.forEach(function(school){
  $('.content').append(school.toHTML());
});

projects.forEach(function(project){
  $('.content').append(project.toHTML());
});

/*

rawData.forEach(function(articleObject) {
  articles.push(new Article(articleObject));
});

articles.forEach(function(article){
  $('#articles').append(article.toHtml());
});
*/
<commit_msg>got handlebars working for projects.<commit_after>'use strict';
/* Global var Declarations */
var schools = [];
var projects = [];

/* Stuff to handle things on the page, manipulate the DOM, etc.  */
$('#portfolio').on('click', showProjects);
function showProjects(){
  $('.content section').hide();
  $('.projects').show();
}
$('#education').on('click', showEducation);
function showEducation(){
  $('.content section').hide();
  $('.education').show();
}
$('#home').on('click', showAll);
function showAll() {
  $('.content section').show();
  $('.template').hide();
}

$('.hamburger').on('click', showNav);
function showNav(){
  $('nav section').toggle(400);
}
var rawProjectTemp = $('#project-template').html();
var actualProjectTemp = Handlebars.compile(rawProjectTemp);

 /* Stuff to handle the data, and append to page  */
function School(schoolObj) {
  this.name = schoolObj.name;
  this.startDate = schoolObj.startDate;
  this.endDate = schoolObj.endDate;
  this.award = schoolObj.award;
}

function Project(projectObj){
  this.name = projectObj.title;
  this.url = projectObj.url;
  this.about = projectObj.about;
}

School.prototype.toHTML = function(){
  var $newSchool = $('.template.education').clone();
  $newSchool.removeClass('template');
  $newSchool.attr('data-education', '')
  $newSchool.find('h2.name').text(this.name);
  $newSchool.find('p.startDate').text(this.startDate);
  $newSchool.find('p.endDate').text(this.endDate);
  $newSchool.find('p.award').text(this.award);
  return $newSchool;
}


// Project.prototype.toHTML = function(){
//   var $newEntry = $('.template.projects ').clone();
//   $newEntry.removeClass('template');
//   $newEntry.attr('data-projects', '');
//   $newEntry.find('h2').text(this.name);
//   $newEntry.find('.url').attr('href', this.url);
//   $newEntry.find('.description').text(this.about);
//   return $newEntry;
//}
// projectObjects.forEach(function(project){
//   projects.push(new Project(project));
// });
//
// schoolObjects.forEach(function(school){
//   schools.push(new School(school));
// });

// schools.forEach(function(school){
//   $('.content').append(school.toHTML());
// });

// $('.content').append(actualProjectTemp(projectObjects[0]));

projectObjects.forEach(function(project){
  $('.content').append(actualProjectTemp(project));
});

/*

rawData.forEach(function(articleObject) {
  articles.push(new Article(articleObject));
});

articles.forEach(function(article){
  $('#articles').append(article.toHtml());
});
*/

{'fraction_non_alphanumeric': 0.21588552467855662, 'fraction_numerical': 0.0022812111157196184, 'mean_word_length': 5.21520618556701, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2377715', 'n_tokens_mistral': 1572, 'n_tokens_neox': 1530, 'n_words': 247}