Browse Source

Merge pull request #17 from PeterMorganGH/master

Added Regular Expression check for user.blog value
pull/24/head
Jeffery Russell 5 years ago
committed by GitHub
parent
commit
30e0f88dc5
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 76 additions and 72 deletions
  1. +22
    -19
      public/FriendsGraph.html
  2. +2
    -2
      public/OrgRepoGraph.html
  3. +19
    -16
      public/TimeLineGraph.html
  4. +5
    -0
      public/js/profileGen.js
  5. +28
    -35
      public/style.css

+ 22
- 19
public/FriendsGraph.html View File

@ -53,36 +53,39 @@
<div class="col-lg-3 col-md-4 col-12"></div>
<div class="col-lg-9 col-md-8 col-12">
<div class="d-flex align-items-baseline justify-content-between my-4">
<div class="d-flex align-items-center">
<svg class="mr-3" width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M18 0C8.064 0 0 8.064 0 18C0 27.936 8.064 36 18 36C27.936 36 36 27.936 36 18C36 8.064 27.936 0 18 0ZM18 5.4C20.988 5.4 23.4 7.812 23.4 10.8C23.4 13.788 20.988 16.2 18 16.2C15.012 16.2 12.6 13.788 12.6 10.8C12.6 7.812 15.012 5.4 18 5.4ZM18 30.96C15.8613 30.96 13.7559 30.4308 11.8715 29.4194C9.98707 28.4081 8.3822 26.9462 7.2 25.164C7.254 21.582 14.4 19.62 18 19.62C21.582 19.62 28.746 21.582 28.8 25.164C27.6178 26.9462 26.0129 28.4081 24.1285 29.4194C22.2441 30.4308 20.1387 30.96 18 30.96Z" fill="white"/>
</svg>
<h1 class="text-white font-weight-bold">Interactive friend chart</h1>
</div>
<div>
<a id="TimelineLink" class="text-light" href="#">View repo timeline</a>
</div>
<div class="d-flex align-items-center">
<svg class="mr-3" width="36" height="36" viewBox="0 0 36 36" fill="none"
xmlns="http://www.w3.org/2000/svg">
<path
d="M18 0C8.064 0 0 8.064 0 18C0 27.936 8.064 36 18 36C27.936 36 36 27.936 36 18C36 8.064 27.936 0 18 0ZM18 5.4C20.988 5.4 23.4 7.812 23.4 10.8C23.4 13.788 20.988 16.2 18 16.2C15.012 16.2 12.6 13.788 12.6 10.8C12.6 7.812 15.012 5.4 18 5.4ZM18 30.96C15.8613 30.96 13.7559 30.4308 11.8715 29.4194C9.98707 28.4081 8.3822 26.9462 7.2 25.164C7.254 21.582 14.4 19.62 18 19.62C21.582 19.62 28.746 21.582 28.8 25.164C27.6178 26.9462 26.0129 28.4081 24.1285 29.4194C22.2441 30.4308 20.1387 30.96 18 30.96Z"
fill="white" />
</svg>
<h1 class="text-white font-weight-bold">Interactive friend chart</h1>
</div>
<div>
<a id="TimelineLink" class="text-light" href="#">View repo timeline</a>
</div>
</div>
</div>
</div>
<div class="row pb-4">
<div class="col-lg-3 col-md-4 col-12">
<div id="profileGen"></div>
</div>
<div class="col-lg-9 col-md-8 col-12">
<div class="card shadow text-white bg-dark border-white">
<div class="row pb-4">
<div class="col-lg-3 col-md-4 col-12">
<div id="profileGen"></div>
</div>
<div class="col-lg-9 col-md-8 col-12">
<div class="card shadow text-white bg-dark border-white">
<h2 id="graphLoading"></h2>
<div id="myGraph" class="w-100"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
<script>
$(function () {
$('[data-toggle="tooltip"]').tooltip();
$('[data-toggle="tooltip"]').tooltip();
});
function createGraphs(username)

+ 2
- 2
public/OrgRepoGraph.html View File

@ -58,12 +58,12 @@
<div class="row">
<div class="col">
<div class="d-flex align-items-baseline justify-content-between my-4">
<div class="d-flex align-items-center">
<div class="d-flex align-items-center">
<svg class="mr-3" width="37" height="31" viewBox="0 0 37 31" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 31V11C0 10.5093 0.19491 10.0388 0.541852 9.69185C0.888795 9.34491 1.35935 9.15 1.85 9.15H9.25V2C9.25 0.895432 10.1454 0 11.25 0H25.75C26.8546 0 27.75 0.89543 27.75 2V9.15H35.15C35.6407 9.15 36.1112 9.34491 36.4581 9.69185C36.8051 10.0388 37 10.5093 37 11V31H22.2V21.75H14.8V31H0ZM14.8 3.5V8.8H22.2V3.5H14.8ZM3.7 27.3H11.1V21.75H3.7V27.3ZM3.7 18.05H11.1V12.5H3.7V18.05ZM25.9 27.3H33.3V21.75H25.9V27.3ZM25.9 18.05H33.3V12.5H25.9V18.05ZM14.8 18.05H22.2V12.5H14.8V18.05Z" fill="white"/>
</svg>
<h1 class="text-white font-weight-bold">Organization chart</h1>
</div>
</div>
</div>
</div>
</div>

+ 19
- 16
public/TimeLineGraph.html View File

@ -109,30 +109,33 @@
<div class="col-lg-3 col-md-4 col-12"></div>
<div class="col-lg-9 col-md-8 col-12">
<div class="d-flex align-items-baseline justify-content-between my-4">
<div class="d-flex align-items-center">
<svg class="mr-3" width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M18 0C8.064 0 0 8.064 0 18C0 27.936 8.064 36 18 36C27.936 36 36 27.936 36 18C36 8.064 27.936 0 18 0ZM18 5.4C20.988 5.4 23.4 7.812 23.4 10.8C23.4 13.788 20.988 16.2 18 16.2C15.012 16.2 12.6 13.788 12.6 10.8C12.6 7.812 15.012 5.4 18 5.4ZM18 30.96C15.8613 30.96 13.7559 30.4308 11.8715 29.4194C9.98707 28.4081 8.3822 26.9462 7.2 25.164C7.254 21.582 14.4 19.62 18 19.62C21.582 19.62 28.746 21.582 28.8 25.164C27.6178 26.9462 26.0129 28.4081 24.1285 29.4194C22.2441 30.4308 20.1387 30.96 18 30.96Z" fill="white"/>
</svg>
<h1 class="text-white font-weight-bold">Repo timeline</h1>
</div>
<div>
<a id="FriendsGraphLink" class="text-light" href="#">View friends graph</a>
</div>
<div class="d-flex align-items-center">
<svg class="mr-3" width="36" height="36" viewBox="0 0 36 36" fill="none"
xmlns="http://www.w3.org/2000/svg">
<path
d="M18 0C8.064 0 0 8.064 0 18C0 27.936 8.064 36 18 36C27.936 36 36 27.936 36 18C36 8.064 27.936 0 18 0ZM18 5.4C20.988 5.4 23.4 7.812 23.4 10.8C23.4 13.788 20.988 16.2 18 16.2C15.012 16.2 12.6 13.788 12.6 10.8C12.6 7.812 15.012 5.4 18 5.4ZM18 30.96C15.8613 30.96 13.7559 30.4308 11.8715 29.4194C9.98707 28.4081 8.3822 26.9462 7.2 25.164C7.254 21.582 14.4 19.62 18 19.62C21.582 19.62 28.746 21.582 28.8 25.164C27.6178 26.9462 26.0129 28.4081 24.1285 29.4194C22.2441 30.4308 20.1387 30.96 18 30.96Z"
fill="white" />
</svg>
<h1 class="text-white font-weight-bold">Repo timeline</h1>
</div>
<div>
<a id="FriendsGraphLink" class="text-light" href="#">View friends graph</a>
</div>
</div>
</div>
</div>
<div class="row pb-4">
<div class="col-lg-3 col-md-4 col-12">
<div id="profileGen"></div>
</div>
<div class="col-lg-9 col-md-8 col-12">
<div class="row pb-4">
<div class="col-lg-3 col-md-4 col-12">
<div id="profileGen"></div>
</div>
<div class="col-lg-9 col-md-8 col-12">
<div class="card shadow mb-5">
<h2 id="graphLoading" class="my-0"></h2>
<div id="myGraph" class="w-100"></div>
</div>
<div id="repositoryInformation" class="w-100"></div>
</div>
</div>
</div>
</div>
</div>
</div>

+ 5
- 0
public/js/profileGen.js View File

@ -8,6 +8,11 @@ function profileGen(username, container)
window.location.href = "./GraphGenerator.html";
}
parseOrgs(user.login).then( (orgsReturn) => {
if (user.blog) {
const rx = new RegExp("^(http|https)://", "i");
const match = rx.test(user.blog);
user.blog = match ? user.blog : `http://${user.blog}`;
}
let html = `
<div class="card shadow-sm" style="font-size: 16px;">
<div class="card-img-top" style="position: relative;">

+ 28
- 35
public/style.css View File

@ -11,10 +11,7 @@ body {
color: var(--dark-2);
}
/* Bootstrap overides
----------------------------------------------- */
/* Bootstrap overides */
.bg-dark {
background-color: var(--dark) !important;
}
@ -42,41 +39,10 @@ body {
margin: auto;
}
.main {
background: linear-gradient(180deg, var(--dark-2) 0%, var(--dark-2) 420px, var(--white) 420px);
}
@media screen and (min-width: 768px) {
.main {
background: linear-gradient(180deg, var(--dark-2) 0%, var(--dark-2) 360px, var(--white) 360px);
}
}
@media screen and (min-width: 992px) {
.main {
background: linear-gradient(180deg, var(--dark-2) 0%, var(--dark-2) 420px, var(--white) 420px);
}
.home-page .main::before {
display: block;
content: '';
position: absolute;
right: 0;
height: 90vh;
width: 50vw;
background-image: url(./img/home-image.png);
background-repeat: no-repeat;
}
}
@media screen and (min-width: 768px) {
.friends-graph-page #profileGen,
.timeline-graph-page #profileGen {
margin-top: -84px
}
}
.card .actions {
position: absolute;
right: 16px;
@ -114,3 +80,30 @@ body {
fill: var(--primary);
opacity: 1;
}
@media screen and (min-width: 768px) {
.main {
background: linear-gradient(180deg, var(--dark-2) 0%, var(--dark-2) 360px, var(--white) 360px);
}
.friends-graph-page #profileGen,
.timeline-graph-page #profileGen {
margin-top: -84px
}
}
@media screen and (min-width: 992px) {
.main {
background: linear-gradient(180deg, var(--dark-2) 0%, var(--dark-2) 420px, var(--white) 420px);
}
.home-page .main::before {
display: block;
content: '';
position: absolute;
right: 0;
height: 90vh;
width: 50vw;
background-image: url(./img/home-image.png);
background-repeat: no-repeat;
}
}

Loading…
Cancel
Save