forked from devleague/gee-mail
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
79 lines (69 loc) · 2.14 KB
/
index.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
<html>
<head>
<title>GeeMail</title>
<script src="js/mail-generator.js"></script>
<link href="css/style.css" rel="stylesheet" media="screen">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"/>
<link href='https://fonts.googleapis.com/css?family=Lato:400,300,100,700,900' rel='stylesheet' type='text/css'>
<script>
window.onload = function() {
var inbox = 0;
var table = document.getElementById("mails-table");
window.geemails.forEach(function(mail) {
addOneMail(mail);
});
function addOneMail(mail) {
var row = table.insertRow(1);
var cell1 = row.insertCell(0);
var cell2 = row.insertCell(1);
var cell3 = row.insertCell(2);
cell1.innerHTML = mail.sender;
cell2.innerHTML = mail.subject;
cell3.innerHTML = mail.date;
var body = mail.body;
inbox++
console.log('inbox count', inbox)
document.getElementById("inbox").innerHTML ="Inbox: " + inbox;
row.onclick = function() {
var allSelected = document.getElementsByClassName("imSelected");
document.getElementById("body-header").innerHTML = "From: " + mail.sender + "<br>" + "Subject: " + mail.subject + "<br>" + "Date: " + mail.date;
document.getElementById("body-content").innerHTML = body;
row.className = "imSelected";
};
}
setInterval(function() {
addOneMail(getNewMessage());
}, 5000);
}
</script>
</head>
<body>
<div class="container" id="main">
<div class="row top">
<h1 class="col-sm-9 name">GeeMail</h1>
<div class="container col-sm-3 text-center">
<img src="http://www.freeiconspng.com/uploads/email-icon-23.png" alt="email icon" class="email-icon" id="email-icon">
<p id="inbox">Inbox</p>
</div>
</div>
<div class="mails container">
<div class="body-container">
<div id="body-header"></div>
<div id="body-content"></div>
</div>
<table class="col-sm-12 " id="mails-table">
<thead class="mails-head">
<tr>
<th scope="col">Sender</th>
<th scope="col">Subject</th>
<th scope="col">Date</th>
</tr>
</thead>
<tbody>
<tr id="mails" class="mail-row">
</tr>
</tbody>
</table>
</div>
</body>
</html>