forked from tyfal/Paradigm-X
-
Notifications
You must be signed in to change notification settings - Fork 0
/
firebaseConfig.js
44 lines (34 loc) · 1.11 KB
/
firebaseConfig.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
37
38
39
40
41
42
43
44
var firebaseConfig = {
apiKey: "AIzaSyBrzK7dJ0bZgystmNqv2xaOj7IwJF05sGQ",
authDomain: "hooperpedia.firebaseapp.com",
databaseURL: "https://hooperpedia.firebaseio.com",
projectId: "hooperpedia",
storageBucket: "",
messagingSenderId: "797528490036",
appId: "1:797528490036:web:231863142248d6f5"
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
var database = firebase.database();
function saveFavorite(playerName, team){
database.ref().push({
playerName1: playerName,
});
}
$(document).on("click", ".save-player", function(){
var playerName = $(this).attr("data-Playername");
saveFavorite(playerName);
});
var playersRef = firebase.database().ref();
database.ref().on("child_added", function (data) {
const favName = data.val().playerName1;
// $("#favArea").text(data.val().playerName1);
fromHome=false;
getPlayer(seasonArray, favName);
console.log(data.val().playerName1)
}, function (errorObject) {
console.error(errorObject)
});
var table = $("#stats-body");
table.addClass('inActiv');
table.empty();