-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
36 lines (31 loc) · 1.05 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
const searchKey = document.querySelector(".search");
let git = new GIT();
let ui = new UI;
searchKey.addEventListener("keyup",onKeyPress);
function onKeyPress()
{
const keyValue = searchKey.value;
if(keyValue != "")
{ ui.clearAlert();
document.getElementById("spin").style.display="inline-block";
document.querySelector(".userinfo").innerHTML="";
let data =git.getData(keyValue)
.then((user)=>{
if(user.userProfile.message === 'Not Found') {
// Show alert
document.getElementById("spin").style.display="none";
ui.alertDisplay('User not found', 'alert alert-danger mt-5');
ui.clearInfo();
} else
{
document.getElementById("spin").style.display="none";
// Show profilesp
ui.displayUser(user);
//ui.displayRepo(user);
ui.displayRepo(user);
}
});
}else{
ui.clearInfo();
}
}