Browse Source

Merge branch 'master' of https://github.com/jrtechs/github-graphs

pull/11/head
CetaceanNation 5 years ago
parent
commit
00836a8b13
6 changed files with 55 additions and 21 deletions
  1. +20
    -1
      public/GraphGenerator.html
  2. +1
    -0
      public/ico/outline-timeline-24px.svg
  3. +5
    -8
      public/js/createOrgInfo.js
  4. +0
    -3
      public/js/createOrgRepoGraph.js
  5. +2
    -2
      public/js/createOrgTable.js
  6. +27
    -7
      public/js/profileGen.js

+ 20
- 1
public/GraphGenerator.html View File

@ -121,7 +121,26 @@
</body> </body>
</html> </html>
<script> <script>
function fetchUserInput() {
$('#txtOrgname').keydown(function(event)
{
if(event.keyCode == 13)
{
event.preventDefault();
toOrgRepos();
}
});
$('#txtUsername').keydown(function(event)
{
if(event.keyCode == 13)
{
event.preventDefault();
toFriends();
}
});
function fetchUserInput()
{
const inputedName = $("#txtUsername").val(); const inputedName = $("#txtUsername").val();
if(inputedName === "") if(inputedName === "")

+ 1
- 0
public/ico/outline-timeline-24px.svg View File

@ -0,0 +1 @@
<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"><defs><path id="a" d="M0 0h24v24H0z"/></defs><clipPath><use xlink:href="#a" overflow="visible"/></clipPath><defs><path id="b" d="M0 0h24v24H0z"/></defs><clipPath><use xlink:href="#b" overflow="visible"/></clipPath><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"/></svg>

+ 5
- 8
public/js/createOrgInfo.js View File

@ -1,23 +1,20 @@
function createOrgInfo(orgName, container) { function createOrgInfo(orgName, container) {
queryAPIByOrg("", orgName, (orgData) => { queryAPIByOrg("", orgName, (orgData) => {
console.log("called"); console.log("called");
var html =
"<div class=\"card\" style=\"w-100;\"> \
var html = "<div class=\"card\" style=\"w-100;\"><div class='row m-0'><div class='col-2 col-centered p-auto'>"+
"<img src='" + orgData.avatar_url + "' width='100%'/>" +
"</div><div class='col-10'>\
<div class=\"card-body\"> \ <div class=\"card-body\"> \
<div class=\"card-header\"><h3 class=\"card-title\">"+orgData.name+"</h3></div> " +
<center><b><h3 class=\"card-title\">"+orgData.name+"</h3><b><center> " +
(orgData.description != null ? "<div class=\"card-text\"><p>"+orgData.description+"</p></div>" : "") + " \ (orgData.description != null ? "<div class=\"card-text\"><p>"+orgData.description+"</p></div>" : "") + " \
</div> \ </div> \
<ul class=\"list-group list-group-flush\">"+ <ul class=\"list-group list-group-flush\">"+
(orgData.location !=null ? "<li class=\"list-group-item\">Location: "+orgData.location+"</li>" : "") + " \ (orgData.location !=null ? "<li class=\"list-group-item\">Location: "+orgData.location+"</li>" : "") + " \
</ul> \ </ul> \
</div>"
</div></div></div>";
$("#" + container).html(html); $("#" + container).html(html);
setTimeout(function() {
$('#dataTable').DataTable();
}, 1500);
}, function(error) { }, function(error) {
alert("Organization Does Not Exist"); alert("Organization Does Not Exist");
window.location.href = "./GraphGenerator.html"; window.location.href = "./GraphGenerator.html";

+ 0
- 3
public/js/createOrgRepoGraph.js View File

@ -52,7 +52,6 @@ function alreadyInGraph(userID)
*/ */
function edgeInGraph(id1, id2) function edgeInGraph(id1, id2)
{ {
console.log("edge check");
for(var i = 0;i < edges.length; i++) for(var i = 0;i < edges.length; i++)
{ {
if(edges[i].from === id1 && edges[i].to === id2) if(edges[i].from === id1 && edges[i].to === id2)
@ -260,8 +259,6 @@ function updateProgress()
$("#graphLoading").html("<div class=\"progress\">\n" + $("#graphLoading").html("<div class=\"progress\">\n" +
" <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" + " <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" +
"</div>"); "</div>");
console.log();
} }
/** /**

+ 2
- 2
public/js/createOrgTable.js View File

@ -53,9 +53,9 @@ function createOrgTable(orgName, tableContainer)
$("#" + tableContainer).html(html); $("#" + tableContainer).html(html);
$(document).ready(function() {
setTimeout(function() {
$('#dataTable').DataTable(); $('#dataTable').DataTable();
} );
}, 1500);
}).catch(function(error) }).catch(function(error)
{ {
//console.log("Unable to create table"); //console.log("Unable to create table");

+ 27
- 7
public/js/profileGen.js View File

@ -12,15 +12,15 @@ function profileGen(username, container)
"<div class=\"card\" style=\"w-100; background-color:rgb(255,255,255);\"> \ "<div class=\"card\" style=\"w-100; background-color:rgb(255,255,255);\"> \
<img class=\"card-img-top\" src=\""+user.avatar_url+"\"></img> \ <img class=\"card-img-top\" src=\""+user.avatar_url+"\"></img> \
<div class=\"row mx-0\" style=\"background-color:rgb(255,255,255);\"> \ <div class=\"row mx-0\" style=\"background-color:rgb(255,255,255);\"> \
<div class=\"col-8\"> \
<div class=\"col-7 p-0\"> \
<div class=\"card-body\" style=\"background-color:rgb(255,255,255);\">"+ <div class=\"card-body\" style=\"background-color:rgb(255,255,255);\">"+
(user.name != null ? "<h5 class=\"card-title\">"+user.name+"</h5>" : "") +" \ (user.name != null ? "<h5 class=\"card-title\">"+user.name+"</h5>" : "") +" \
<h6 class=\"card-subtitle\">"+user.login+"</h5> \ <h6 class=\"card-subtitle\">"+user.login+"</h5> \
</div> \ </div> \
</div> \ </div> \
<div class=\"col-4\"> \
<div class=\"col-2 p-0\"> \
<button type=\"button\" class=\"btn btn-link pt-3\"> \ <button type=\"button\" class=\"btn btn-link pt-3\"> \
<a href=\""+makeUrl(user.login)+"\"> \
<a href=\""+graphUrl(user.login)+"\"> \
<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\"> \ <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\"> \
<path d=\"M5 9.2h3V19H5zM10.6 5h2.8v14h-2.8zm5.6 8H19v6h-2.8z\"/> \ <path d=\"M5 9.2h3V19H5zM10.6 5h2.8v14h-2.8zm5.6 8H19v6h-2.8z\"/> \
<path fill=\"none\" d=\"M0 0h24v24H0z\"/> \ <path fill=\"none\" d=\"M0 0h24v24H0z\"/> \
@ -28,13 +28,29 @@ function profileGen(username, container)
</a> \ </a> \
</button> \ </button> \
</div> \ </div> \
<div class=\"col-2 p-0\"> \
<button type=\"button\" class=\"btn btn-link pt-3\"> \
<a href=\""+timelineUrl(user.login)+"\"> \
<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\"> \
<defs> \
<path id=\"a\" d=\"M0 0h24v24H0z\"/> \
</defs> \
<clipPath> \
<use xlink:href=\"#a\" overflow=\"visible\"/> \
</clipPath> \
<defs> \
<path id=\"b\" d=\"M0 0h24v24H0z\"/></defs><clipPath><use xlink:href=\"#b\" overflow=\"visible\"/> \
</clipPath> \
<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\"/> \
</svg> \
</a> \
</button> \
</div> \
</div> \ </div> \
<div class=\"card border-secondary mb-3 mx-auto text-left\" style=\"width:90%; \"> \
<div class=\"card-body\" style=\"background-color:rgb(255,255,255);\"> \
<div class=\"card-body py-1\" style=\"background-color:rgb(255,255,255);\"> \
<p class=\"card-text\"><a href=\""+user.html_url+"\" class=\"card-link\">"+user.html_url+"</a></p> \ " + <p class=\"card-text\"><a href=\""+user.html_url+"\" class=\"card-link\">"+user.html_url+"</a></p> \ " +
(user.blog != null ? "<p class=\"card-text \"><a href="+user.blog+" class=\"card-link\">"+user.blog+"</a></p>" : "")+" \ (user.blog != null ? "<p class=\"card-text \"><a href="+user.blog+" class=\"card-link\">"+user.blog+"</a></p>" : "")+" \
</div> \ </div> \
</div> \
<ul class=\"list-group list-group-flush\"> \ <ul class=\"list-group list-group-flush\"> \
<li class=\"list-group-item\">Followers: "+user.followers+"</li> \ <li class=\"list-group-item\">Followers: "+user.followers+"</li> \
<li class=\"list-group-item\">Following: "+user.following+"</li> \ <li class=\"list-group-item\">Following: "+user.following+"</li> \
@ -98,6 +114,10 @@ function queryUrl(url, successCallBack, errorCallBack) {
}); });
} }
function makeUrl(user) {
function graphUrl(user) {
return "/FriendsGraph.html?name="+user; return "/FriendsGraph.html?name="+user;
}
function timelineUrl(user) {
return "/TimeLineGraph.html?name="+user;
} }

Loading…
Cancel
Save