Skip to content

Commit 00836a8

Browse files
2 parents b979f9f + 9804a6a commit 00836a8

6 files changed

Lines changed: 55 additions & 21 deletions

File tree

public/GraphGenerator.html

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,26 @@ <h1 class="m-title">Interactive Organization Chart</h1>
121121
</body>
122122
</html>
123123
<script>
124-
function fetchUserInput() {
124+
$('#txtOrgname').keydown(function(event)
125+
{
126+
if(event.keyCode == 13)
127+
{
128+
event.preventDefault();
129+
toOrgRepos();
130+
}
131+
});
132+
133+
$('#txtUsername').keydown(function(event)
134+
{
135+
if(event.keyCode == 13)
136+
{
137+
event.preventDefault();
138+
toFriends();
139+
}
140+
});
141+
142+
function fetchUserInput()
143+
{
125144
const inputedName = $("#txtUsername").val();
126145

127146
if(inputedName === "")
Lines changed: 1 addition & 0 deletions
Loading

public/js/createOrgInfo.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,20 @@
11
function createOrgInfo(orgName, container) {
22
queryAPIByOrg("", orgName, (orgData) => {
33
console.log("called");
4-
var html =
5-
"<div class=\"card\" style=\"w-100;\"> \
4+
var html = "<div class=\"card\" style=\"w-100;\"><div class='row m-0'><div class='col-2 col-centered p-auto'>"+
5+
"<img src='" + orgData.avatar_url + "' width='100%'/>" +
6+
"</div><div class='col-10'>\
67
<div class=\"card-body\"> \
7-
<div class=\"card-header\"><h3 class=\"card-title\">"+orgData.name+"</h3></div> " +
8+
<center><b><h3 class=\"card-title\">"+orgData.name+"</h3><b><center> " +
89
(orgData.description != null ? "<div class=\"card-text\"><p>"+orgData.description+"</p></div>" : "") + " \
910
</div> \
1011
<ul class=\"list-group list-group-flush\">"+
1112
(orgData.location !=null ? "<li class=\"list-group-item\">Location: "+orgData.location+"</li>" : "") + " \
1213
</ul> \
13-
</div>"
14+
</div></div></div>";
1415

1516
$("#" + container).html(html);
1617

17-
setTimeout(function() {
18-
$('#dataTable').DataTable();
19-
}, 1500);
20-
2118
}, function(error) {
2219
alert("Organization Does Not Exist");
2320
window.location.href = "./GraphGenerator.html";

public/js/createOrgRepoGraph.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ function alreadyInGraph(userID)
5252
*/
5353
function edgeInGraph(id1, id2)
5454
{
55-
console.log("edge check");
5655
for(var i = 0;i < edges.length; i++)
5756
{
5857
if(edges[i].from === id1 && edges[i].to === id2)
@@ -260,8 +259,6 @@ function updateProgress()
260259
$("#graphLoading").html("<div class=\"progress\">\n" +
261260
" <div class=\"progress-bar progress-bar-striped progress-bar-animated\" role=\"progressbar\" style=\"width: " + percent + "%\" aria-valuenow=\"" + percent + "\" aria-valuemin=\"0\" aria-valuemax=\"100\"></div>\n" +
262261
"</div>");
263-
264-
console.log();
265262
}
266263

267264
/**

public/js/createOrgTable.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ function createOrgTable(orgName, tableContainer)
5353

5454
$("#" + tableContainer).html(html);
5555

56-
$(document).ready(function() {
56+
setTimeout(function() {
5757
$('#dataTable').DataTable();
58-
} );
58+
}, 1500);
5959
}).catch(function(error)
6060
{
6161
//console.log("Unable to create table");

public/js/profileGen.js

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,45 @@ function profileGen(username, container)
1212
"<div class=\"card\" style=\"w-100; background-color:rgb(255,255,255);\"> \
1313
<img class=\"card-img-top\" src=\""+user.avatar_url+"\"></img> \
1414
<div class=\"row mx-0\" style=\"background-color:rgb(255,255,255);\"> \
15-
<div class=\"col-8\"> \
15+
<div class=\"col-7 p-0\"> \
1616
<div class=\"card-body\" style=\"background-color:rgb(255,255,255);\">"+
1717
(user.name != null ? "<h5 class=\"card-title\">"+user.name+"</h5>" : "") +" \
1818
<h6 class=\"card-subtitle\">"+user.login+"</h5> \
1919
</div> \
2020
</div> \
21-
<div class=\"col-4\"> \
21+
<div class=\"col-2 p-0\"> \
2222
<button type=\"button\" class=\"btn btn-link pt-3\"> \
23-
<a href=\""+makeUrl(user.login)+"\"> \
23+
<a href=\""+graphUrl(user.login)+"\"> \
2424
<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\"> \
2525
<path d=\"M5 9.2h3V19H5zM10.6 5h2.8v14h-2.8zm5.6 8H19v6h-2.8z\"/> \
2626
<path fill=\"none\" d=\"M0 0h24v24H0z\"/> \
2727
</svg> \
2828
</a> \
2929
</button> \
3030
</div> \
31+
<div class=\"col-2 p-0\"> \
32+
<button type=\"button\" class=\"btn btn-link pt-3\"> \
33+
<a href=\""+timelineUrl(user.login)+"\"> \
34+
<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\"> \
35+
<defs> \
36+
<path id=\"a\" d=\"M0 0h24v24H0z\"/> \
37+
</defs> \
38+
<clipPath> \
39+
<use xlink:href=\"#a\" overflow=\"visible\"/> \
40+
</clipPath> \
41+
<defs> \
42+
<path id=\"b\" d=\"M0 0h24v24H0z\"/></defs><clipPath><use xlink:href=\"#b\" overflow=\"visible\"/> \
43+
</clipPath> \
44+
<path d=\"M23 8c0 1.1-.9 2-2 2-.18 0-.35-.02-.51-.07l-3.56 3.55c.05.16.07.34.07.52 0 1.1-.9 2-2 2s-2-.9-2-2c0-.18.02-.36.07-.52l-2.55-2.55c-.16.05-.34.07-.52.07s-.36-.02-.52-.07l-4.55 4.56c.05.16.07.33.07.51 0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2c.18 0 .35.02.51.07l4.56-4.55C8.02 9.36 8 9.18 8 9c0-1.1.9-2 2-2s2 .9 2 2c0 .18-.02.36-.07.52l2.55 2.55c.16-.05.34-.07.52-.07s.36.02.52.07l3.55-3.56C19.02 8.35 19 8.18 19 8c0-1.1.9-2 2-2s2 .9 2 2z\"/> \
45+
</svg> \
46+
</a> \
47+
</button> \
48+
</div> \
3149
</div> \
32-
<div class=\"card border-secondary mb-3 mx-auto text-left\" style=\"width:90%; \"> \
33-
<div class=\"card-body\" style=\"background-color:rgb(255,255,255);\"> \
50+
<div class=\"card-body py-1\" style=\"background-color:rgb(255,255,255);\"> \
3451
<p class=\"card-text\"><a href=\""+user.html_url+"\" class=\"card-link\">"+user.html_url+"</a></p> \ " +
3552
(user.blog != null ? "<p class=\"card-text \"><a href="+user.blog+" class=\"card-link\">"+user.blog+"</a></p>" : "")+" \
3653
</div> \
37-
</div> \
3854
<ul class=\"list-group list-group-flush\"> \
3955
<li class=\"list-group-item\">Followers: "+user.followers+"</li> \
4056
<li class=\"list-group-item\">Following: "+user.following+"</li> \
@@ -98,6 +114,10 @@ function queryUrl(url, successCallBack, errorCallBack) {
98114
});
99115
}
100116

101-
function makeUrl(user) {
117+
function graphUrl(user) {
102118
return "/FriendsGraph.html?name="+user;
119+
}
120+
121+
function timelineUrl(user) {
122+
return "/TimeLineGraph.html?name="+user;
103123
}

0 commit comments

Comments
 (0)