Browse Source

FriendsGraph cleanup

pull/11/head
Bryce Murphy 5 years ago
parent
commit
3448b08eb4
1 changed files with 40 additions and 47 deletions
  1. +40
    -47
      public/FriendsGraph.html

+ 40
- 47
public/FriendsGraph.html View File

@ -50,57 +50,50 @@
</ul> </ul>
</div> </div>
</div> </div>
<div class="main container">
<div class="main container">
<div class="row align-center" id="searchBarTop">
<nav class="navbar navbar-light bg-light justify-content-between">
<a class="navbar-brand">Create Graph</a>
<form class="form-inline">
<input class="form-control mr-sm-2" id='txtUsername' type="search" placeholder="GitHub Username" aria-label="Search">
<button class="btn btn-outline-success my-2 my-sm-0" onclick='fetchUserInput()' type='button'>Look Up</button>
</form>
</nav>
</div>
<div class="row">
<div class="col-md-8 col-12">
<h2 id="graphLabel"></h2>
<div id="myGraph" class="w-100"></div>
<pre id="eventSpan"></pre>
</div>
<div class="col-md-4 col-12 w-100">
<div id="profileGen"></div>
<div class="row">
<div class="col-md-8 col-12">
<h2 id="graphLabel"></h2>
<div id="myGraph" class="w-100"></div>
<pre id="eventSpan"></pre>
</div>
<div class="col-md-4 col-12 w-100">
<div id="profileGen"></div>
</div>
</div> </div>
</div>
</body>
<script>
<script>
document.addEventListener("keydown", event => {
if (event.key === "Enter") {
fetchUserInput();
}
})
function fetchUserInput()
{
const inputedName = $("#txtUsername").val();
createGraphs(inputedName);
}
function createGraphs(username)
{
options.width = $("#myGraph").width() + "px";
options.height = "700px";
createFriendsGraph(username, "myGraph", "graphLabel");
profileGen(username, "profileGen");
$("#searchBarTop").html("");
}
document.addEventListener("keydown", event => {
if (event.key === "Enter") {
fetchUserInput();
}
})
function fetchUserInput()
{
const inputedName = $("#txtUsername").val();
createGraphs(inputedName);
}
function createGraphs(username)
{
options.width = $("#myGraph").width() + "px";
options.height = "700px";
createFriendsGraph(username, "myGraph", "graphLabel");
profileGen(username, "profileGen");
$("#searchBarTop").html("");
}
if(findGetParameter("name") !== null)
{
createGraphs(findGetParameter("name"))
}
</script>
</div>
if(findGetParameter("name") !== null)
{
createGraphs(findGetParameter("name"))
}
</script>
</body>
</html> </html>

Loading…
Cancel
Save