-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwork.html
87 lines (82 loc) · 2.96 KB
/
work.html
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<!DOCTYPE html>
<html>
<head>
<title>Work</title>
<link rel="stylesheet" type="text/css" href="working.css">
<link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="nav.css">
<link rel="stylesheet" type="text/css" href="convention.css">
<link rel="stylesheet" type="text/css" href="instructions.css">
</head>
<body>
<ul class="nav">
<li class="logo"><a href="index.html" style="padding: 0px;"><img src="./icons/logo_long.png"/></a></li>
<li><a style="display: block; width: 77px;" id="bcredits"></a></li>
<li><a href="" onclick="firebase.auth().signOut();" class="hov" >LOGOUT</a></li>
<li><a href="profile.html" class="hov">PROFILE</a></li>
<li><a href="work.html" class="hov active">WORK</a></li>
<li><a href="request.html" class="hov">REQUEST</a></li>
<li><a href="index.html" class="hov">ABOUT</a></li>
</ul>
<div>
<h1 style="height: 100%; width: 100%; margin-top: 100px; font-size: 50px;" align= "center";>Finding best work that suits you...</h1>
</div>
<script src="https://www.gstatic.com/firebasejs/4.6.2/firebase.js"></script>
<script>
// Initialize Firebase
var config = {
apiKey: "AIzaSyDeunaXdZRX8Kc960GDhzik2bpNKwN2lDY",
authDomain: "mangosub-kaist.firebaseapp.com",
databaseURL: "https://mangosub-kaist.firebaseio.com",
projectId: "mangosub-kaist",
storageBucket: "mangosub-kaist.appspot.com",
messagingSenderId: "753510490577"
};
firebase.initializeApp(config);
firebase.auth().onAuthStateChanged(function(user) {
if (user) {
// User is signed in.
var displayName = user.displayName;
var email = user.email;
var uid = user.uid;
var db = firebase.database().ref().child("users").child(uid);
db.child("credits").once("value").then(function(snapshot) {
var credits_val = snapshot.val();
document.getElementById("bcredits").innerHTML = "¢ " + String(credits_val);
});
var subDB = firebase.database().ref().child("subtitles");
var f_flag = true;
subDB.orderByChild("requested_time").once("value").then(function(snapshot){
snapshot.forEach(function(child){
var doneValue = child.child("done").val();
console.log(doneValue);
if (doneValue === 0) {
window.location = "generate_info.html";
f_flag = false;
return true;
}
else if (doneValue === 1){
window.location.href = "fix_info.html";
f_flag = false;
return true;
}
else if (doneValue === 2){
window.location.href = "verify_info.html";
f_flag = false;
return true;
}
});
});
if (!f_flag) {
alert("MangoSub: No video left for creating subtitles. Check back later.");
window.location.href = "index.html";
}
}
else {
// User is signed out.
window.location = "index.html";
}
});
</script>
</body>
</html>