fix typos

This commit is contained in:
Jacob Levine 2019-02-12 20:34:05 -06:00
parent 45a4387c68
commit dd5da3b1e8
2 changed files with 55 additions and 51 deletions

View File

@ -3,16 +3,14 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title> <title>titanscout</title>
<meta charset="utf-8"> <script src="https://www.gstatic.com/firebasejs/5.7.2/firebase.js"></script>
<title>titanscout</title> <script src="https://cdn.firebase.com/libs/firebaseui/3.5.1/firebaseui.js"></script>
<script src="https://www.gstatic.com/firebasejs/5.7.2/firebase.js"></script> <script src="https://www.gstatic.com/firebasejs/5.8.0/firebase-firestore.js"></script>
<script src="https://cdn.firebase.com/libs/firebaseui/3.5.1/firebaseui.js"></script> <link type="text/css" rel="stylesheet" href="https://cdn.firebase.com/libs/firebaseui/3.5.1/firebaseui.css" />
<script src="https://www.gstatic.com/firebasejs/5.8.0/firebase-firestore.js"></script> <link rel="stylesheet" href="../style.css" type="text/css" />
<link type="text/css" rel="stylesheet" href="https://cdn.firebase.com/libs/firebaseui/3.5.1/firebaseui.css" /> <link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
<link rel="stylesheet" href="../style.css" type="text/css" /> <script type="text/javascript" src="scripts.js"></script>
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
<script type="text/javascript" src="scripts.js"></script>
</head> </head>
<body> <body>

View File

@ -4,7 +4,7 @@ function openNav() {
document.getElementById("main").style.marginLeft = "250px"; document.getElementById("main").style.marginLeft = "250px";
document.body.style.backgroundColor = "rgba(0,0,0,0.4)"; document.body.style.backgroundColor = "rgba(0,0,0,0.4)";
for (var i = 0; i < document.getElementsByClassName("btn").length; i++) { for (var i = 0; i < document.getElementsByClassName("btn").length; i++) {
document.getElementsByClassName("btn")[i].style.backgroundColor="rgba(0,0,0,.2)" document.getElementsByClassName("btn")[i].style.backgroundColor = "rgba(0,0,0,.2)"
} }
} }
@ -14,7 +14,7 @@ function closeNav() {
document.getElementById("main").style.marginLeft = "0"; document.getElementById("main").style.marginLeft = "0";
document.body.style.backgroundColor = "white"; document.body.style.backgroundColor = "white";
for (var i = 0; i < document.getElementsByClassName("btn").length; i++) { for (var i = 0; i < document.getElementsByClassName("btn").length; i++) {
document.getElementsByClassName("btn")[i].style.backgroundColor="buttonface" document.getElementsByClassName("btn")[i].style.backgroundColor = "buttonface"
} }
} }
@ -30,65 +30,71 @@ window.onload = function() {
}; };
firebase.initializeApp(config); firebase.initializeApp(config);
firebase.auth().onAuthStateChanged(function(user) { firebase.auth().onAuthStateChanged(function(user) {
if (user != null) { if (user != null) {
if (user.displayName != null) { if (user.displayName != null) {
document.getElementById('status').innerHTML = "You are signed in as: " + user.displayName; document.getElementById('status').innerHTML = "You are signed in as: " + user.displayName;
document.getElementById('newDN').innerHTML = user.displayName; document.getElementById('newDN').innerHTML = user.displayName;
} else if (user.email != null) { } else if (user.email != null) {
document.getElementById('status').innerHTML = "You are signed in as: " + user.email; document.getElementById('status').innerHTML = "You are signed in as: " + user.email;
} else if (user.phoneNumber != null) { } else if (user.phoneNumber != null) {
document.getElementById('status').innerHTML = "You are signed in as: " + user.phoneNumber; document.getElementById('status').innerHTML = "You are signed in as: " + user.phoneNumber;
} else { } else {
document.getElementById('status').innerHTML = "You are signed in."; document.getElementById('status').innerHTML = "You are signed in.";
}
if (user.email != null) {
document.getElementById('newEM').innerHTML = user.email;
}
} else {
window.location.replace('../');
}
teamAssoc=firebase.firestore().collections('UserAssociations').doc(user.uid);
teamAssoc.get().then(function(doc){
if(doc.exists)}{
list=doc.data()
teamNums=Object.keys(list)
document.getElementById(teammem).innerHTML = ""
for i in teamNums(){
document.getElementById(teammem).innerHTML +="<tr><td>"+i+"</td><td>"+list.i+"</td></tr>"
} }
}else { if (user.email != null) {
document.getElementById(teammem).innerHTML = "<tr><td>You are not part of any teams</td></tr>" document.getElementById('newEM').innerHTML = user.email;
}
} else {
window.location.replace('../');
} }
}) teamAssoc = firebase.firestore().collections('UserAssociations').doc(user.uid);
teamAssoc.get().then(function(doc) {
if (doc.exists)
} {
list = doc.data()
teamNums = Object.keys(list)
document.getElementById(teammem).innerHTML = ""
for i in teamNums() {
document.getElementById(teammem).innerHTML += "<tr><td>" + i + "</td><td>" + list.i + "</td></tr>"
}
} else {
document.getElementById(teammem).innerHTML = "<tr><td>You are not part of any teams</td></tr>"
}
})
}); });
} }
function cnt(tn) { function cnt(tn) {
firebase.firestore().collection("UserAssociations").doc(user.id).set({tn : 'captain'} , { merge: true }).then( firebase.firestore().collection("UserAssociations").doc(user.id).set({
teamAssoc=firebase.firestore().collections('UserAssociations').doc(user.uid); tn: 'captain'
teamAssoc.get().then(function(doc){ }, {
if(doc.exists)}{ merge: true
list=doc.data() }).then(
teamNums=Object.keys(list) teamAssoc = firebase.firestore().collections('UserAssociations').doc(user.uid) teamAssoc.get().then(function(doc) {
if (doc.exists) {
list = doc.data()
teamNums = Object.keys(list)
document.getElementById(teammem).innerHTML = "" document.getElementById(teammem).innerHTML = ""
for i in teamNums(){ for i in teamNums() {
document.getElementById(teammem).innerHTML +="<tr><td>"+i+"</td><td>"+list.i+"</td></tr>" document.getElementById(teammem).innerHTML += "<tr><td>" + i + "</td><td>" + list.i + "</td></tr>"
} }
}else { } else {
document.getElementById(teammem).innerHTML = "<tr><td>You are not part of any teams</td></tr>" document.getElementById(teammem).innerHTML = "<tr><td>You are not part of any teams</td></tr>"
} }
}) })
) )
} }
function signout() { function signout() {
var user = firebase.auth().currentUser; var user = firebase.auth().currentUser;
firebase.auth().signOut().then( firebase.auth().signOut().then(
window.location.href = '../'); window.location.href = '../');
} }
function deleteAccount() { function deleteAccount() {
try { try {
firebase.auth().currentUser.delete().then( firebase.auth().currentUser.delete().then(
window.location.href = '../'); window.location.href = '../');
} catch (error) { } catch (error) {
if (error.code == 'auth/requires-recent-login') { if (error.code == 'auth/requires-recent-login') {
alert("Please sign in again to delete your account.") alert("Please sign in again to delete your account.")