var events = []; var repositoryData; function addEvent(group, date, content) { var dateFormat = new Date(date); var dd = new Date(dateFormat.getFullYear(), dateFormat.getMonth(), dateFormat.getDay()); events.push({id: events.length, group: group, start: dd, content: content}); } // {id: 0, group: 0, start: new Date(2013,7,1), end: new Date(2017,5,15), content: 'High School'}, function addRepositories(userName, groupID) { return new Promise(function(resolve, reject) { queryAPIByUser(API_REPOSITORIES, userName, function(data) { repositoryData = data; for(var i = 0; i < data.length; i++) { data[i].id = events.length; addEvent(groupID, data[i]['created_at'], data[i]['name']) } resolve(); }, function(error) { console.log(error); reject(error); }) }) } function timeLineClickEvent(properties) { if(properties.item !== null && typeof repositoryData[properties.item].name !== 'undefined') { var item = repositoryData[properties.item]; if (item.license === null) { item.license = new Object(); item.license.name = 'None'; } var html = `
${item.description ? item.description : 'No description'}
Homepage: ${item.license.name}
` : ''}Repository URL: ${item.html_url}
Languages: ${item.language}
License: ${item.license.name}
Fork Count: ${item.forks}
Open Issues: ${item.open_issues_count}
Watchers: ${item.watchers}