@@ -46,11 +46,21 @@
Head over to the 'Generate graphs' page and enter
- the username of a GitHub user. The space on that
- page will then populate with the requested GitHub
- user and all the related user, visualizing the
+ the username of a GitHub user. The space on that
+ page will then populate with the requested GitHub
+ user and all the related user, visualizing the
connections between them.
+
+ If you'd like to see how everything works, follow
+ the link to GitHub, where you can view all the work
+ that went into making this functional.
+
+
+ If you're interested in knowing more about this
+ project, additional information can be found on
+ the About page.
+
diff --git a/public/js/profileTimeLine.js b/public/js/profileTimeLine.js
index 477e516..ab48659 100644
--- a/public/js/profileTimeLine.js
+++ b/public/js/profileTimeLine.js
@@ -1,36 +1,132 @@
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 addOrgs(userName, groupID)
+function timeLineClickEvent(properties)
{
- return new Promise(function(resolve, reject)
+ if(properties.item !== null && typeof repositoryData[properties.item].name !== 'undefined')
{
+ var item = repositoryData[properties.item];
- })
-}
+ var html = "
\n" +
+ " \n" +
+ "
\n";
+
+ html += "
" + item.description + "
";
+
+ console.log(item.license);
+ if(item.license === null)
+ {
+ item.license = new Object();
+ item.license.name = 'none';
+ }
+ html += "
";
+
+ html +="
\n" +
+ "
";
+
+ $("#repositoryInformation").html(html);
+ }
+}
function createProfileTimeLine(username, containerName)
{
var container = document.getElementById(containerName);
- var prom = [addRepositories(username, 1), addOrgs(username, 1)];
+ var prom = [addRepositories(username, 1)];
var groups = new vis.DataSet([
- {id: 0, content: 'Organizations', value: 1},
{id: 1, content: 'Repositories', value: 2}
]);
+ console.log("up up duper");
Promise.all(prom).then(function()
{
// note that months are zero-based in the JavaScript Date object
@@ -53,5 +149,6 @@ function createProfileTimeLine(username, containerName)
timeline.setOptions(options);
timeline.setGroups(groups);
timeline.setItems(items);
+ timeline.on('click', timeLineClickEvent);
});
}
\ No newline at end of file
diff --git a/public/style.css b/public/style.css
index f640648..34d156e 100644
--- a/public/style.css
+++ b/public/style.css
@@ -71,6 +71,7 @@
}
.home-content {
padding: 20px;
+ width: 100%;
max-height: 40px;
}
.side-img {
@@ -85,7 +86,6 @@
display: block;
position: relative;
width: 50%;
- max-width: 500px;
}
.text-title {
background-color: rgb(208, 208, 208);
@@ -109,6 +109,13 @@ body {
.side-img {
display: none;
}
+ .side-txt {
+ position: absolute;
+ top: 10px;
+ left: 50%;
+ transform: translate(-50%, 0%);
+ width: 100%;
+ }
#navigation {
position: absolute;
top: 50px;