From dd5da3b1e84c83de00749fc6989e6607228e6ab0 Mon Sep 17 00:00:00 2001 From: Jacob Levine Date: Tue, 12 Feb 2019 20:34:05 -0600 Subject: [PATCH] fix typos --- website/public/team/index.html | 18 ++++--- website/public/team/scripts.js | 88 ++++++++++++++++++---------------- 2 files changed, 55 insertions(+), 51 deletions(-) diff --git a/website/public/team/index.html b/website/public/team/index.html index 99a63791..f082f9bb 100644 --- a/website/public/team/index.html +++ b/website/public/team/index.html @@ -3,16 +3,14 @@ - - <meta charset="utf-8"> - <title>titanscout - - - - - - - + titanscout + + + + + + + diff --git a/website/public/team/scripts.js b/website/public/team/scripts.js index 26ab23af..46617800 100644 --- a/website/public/team/scripts.js +++ b/website/public/team/scripts.js @@ -4,7 +4,7 @@ function openNav() { document.getElementById("main").style.marginLeft = "250px"; document.body.style.backgroundColor = "rgba(0,0,0,0.4)"; 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.body.style.backgroundColor = "white"; 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.auth().onAuthStateChanged(function(user) { - if (user != null) { - if (user.displayName != null) { - document.getElementById('status').innerHTML = "You are signed in as: " + user.displayName; - document.getElementById('newDN').innerHTML = user.displayName; - } else if (user.email != null) { - document.getElementById('status').innerHTML = "You are signed in as: " + user.email; - } else if (user.phoneNumber != null) { - document.getElementById('status').innerHTML = "You are signed in as: " + user.phoneNumber; - } else { - 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 +=""+i+""+list.i+"" + if (user != null) { + if (user.displayName != null) { + document.getElementById('status').innerHTML = "You are signed in as: " + user.displayName; + document.getElementById('newDN').innerHTML = user.displayName; + } else if (user.email != null) { + document.getElementById('status').innerHTML = "You are signed in as: " + user.email; + } else if (user.phoneNumber != null) { + document.getElementById('status').innerHTML = "You are signed in as: " + user.phoneNumber; + } else { + document.getElementById('status').innerHTML = "You are signed in."; } - }else { - document.getElementById(teammem).innerHTML = "You are not part of any teams" + 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 += "" + i + "" + list.i + "" + } + } else { + document.getElementById(teammem).innerHTML = "You are not part of any teams" + } + }) }); } + function cnt(tn) { - firebase.firestore().collection("UserAssociations").doc(user.id).set({tn : 'captain'} , { merge: true }).then( - teamAssoc=firebase.firestore().collections('UserAssociations').doc(user.uid); - teamAssoc.get().then(function(doc){ - if(doc.exists)}{ - list=doc.data() - teamNums=Object.keys(list) + firebase.firestore().collection("UserAssociations").doc(user.id).set({ + tn: 'captain' + }, { + merge: true + }).then( + 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 +=""+i+""+list.i+"" + for i in teamNums() { + document.getElementById(teammem).innerHTML += "" + i + "" + list.i + "" } - }else { + } else { document.getElementById(teammem).innerHTML = "You are not part of any teams" } }) ) } + function signout() { var user = firebase.auth().currentUser; firebase.auth().signOut().then( - window.location.href = '../'); + window.location.href = '../'); } function deleteAccount() { try { firebase.auth().currentUser.delete().then( - window.location.href = '../'); + window.location.href = '../'); } catch (error) { if (error.code == 'auth/requires-recent-login') { alert("Please sign in again to delete your account.")