forked from DhananjayPurohit/ISO-12-E1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
syllabus.html
110 lines (98 loc) · 4.39 KB
/
syllabus.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>Syllabus</title>
<script
src="https://code.jquery.com/jquery-2.2.4.min.js"
integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44="
crossorigin="anonymous"></script>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<!-- Compiled and minified CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
<link href="https://fonts.googleapis.com/css?family=Raleway|Roboto&display=swap" rel="stylesheet">
<!-- Compiled and minified JavaScript -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
<style media="screen">
.tabs .tab a{
font-family: Roboto;
font-weight: 500;
color:#18a2a3;
} /*Black color to the text*/
.tabs .tab a:hover {
background-color:#fff;
color:#000;
} /*Text color on hover*/
.tabs .tab a.active {
background-color:#fff;
color:#000;
} /*Background and text color when a tab is active*/
.tabs .indicator {
background-color:#18a2a3;
} /*C*/
iframe{
width: 560px;
height: 315px;
}
</style>
</head>
<body>
<nav class="nav-extended" style="background-color:#1AB0B1;opacity:0.9">
<div class="nav-wrapper" style="height:100px;">
<a href="#" class="brand-logo" style="margin:20px;font-size:50px;font-family:Roboto">Syllabus Content</a>
<a href="#" data-target="mobile-demo" class="sidenav-trigger"><i class="material-icons">menu</i></a>
<ul id="nav-mobile" class="right hide-on-med-and-down">
<li><a href="login.html" style="font-size:30px;font-family:Roboto">Login</a></li>
</ul>
</div>
</nav>
<ul class="sidenav" id="mobile-demo">
<li><a href="login.html">Login</a></li>
</ul>
<div class="" style="background-color:#1AB0B1">
<img src='homeimage.jpeg' height="300px" style="margin-left:100px">
</div>
<div class="container" style="margin-top:-100px;">
<div class="row" id="cont" >
<div class="col s12" >
<ul class="tabs" id="subject_tabs" style="border-radius:3px;">
</ul>
</div>
</div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
$('.sidenav').sidenav();
});
$(document).ready(function(){
$('.tabs').tabs();
});
var x = eval(document.cookie.slice(9));
for(var i=0; i<=x.length-1; i++){
$("#subject_tabs").append('<li class="tab col s'+Math.floor(12/x.length).toString()+'"><a href="'+x[i]+'" >'+x[i]+'</a></li>');
$("#cont").append('<div class="col s12"><div style="background:white;position:absolute;width:1259px;z-index:10"><ul id="'+x[i][0]+'" class="collapsible"></ul></div>');
fetch("http://127.0.0.1:5000/get_content?sub="+x[i])
.then((response) => response.json())
.then(resp => add_content(resp));
}
function add_content(resp){
console.log("done")
for(var j=2; j<=resp.split("'topic':").length-1; j++){
topic_ = resp.split("'topic':")[j+1].split(",")[0].replace("'", "");
console.log(resp.split("'topic':")[j].split(",")[2].replace("'", "")[17], resp.split("'topic':")[j].split(",")[5].replace("'", ""));
if(resp.split("'topic':")[j].split(",")[2].replace("'", "")[17]=='F'){
$("#D").append('<li><div class="collapsible-header">'+topic_+'</div><div class="collapsible-body"><span>'+resp.split("'topic':")[j].split(",")[5].replace("'", "").substring(12,resp.split("'topic':")[j].split(",")[5].replace("'", "").length)+'</span></div></li>');
}
else{
$("#D").append('<li><div class="collapsible-header">'+topic_+'</div><div class="collapsible-body center"><iframe src=https://www.youtube.com/embed/"'+resp.split("'topic':")[j].split(",")[5].replace("'", "").substring(39,resp.split("'topic':")[j].split(",")[5].replace("'", "").length)+'"></iframe></div></li>');
}
}
}
document.addEventListener('DOMContentLoaded', function() {
var elems = document.querySelectorAll('.collapsible');
var instances = M.Collapsible.init(elems);
});
</script>
</body>
</html>