forked from devleague/gee-mail
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
99 lines (75 loc) · 2.73 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<html>
<head>
<title>DevLeague GeeMail Challenge</title>
<script src="js/mail-generator.js"></script>
<link href="css/style.css" rel="stylesheet" media="screen">
<script>
window.onload = function(){
// ALL OF YOUR JAVASCRIPT CODE SHOULD GO HERE.
// We have to use window.onload so your JavaScript doesn't execute until the page has loaded and all HTML has been downloaded to your browser
//current Date info
document.getElementById("today").innerHTML = Date();
//inbox count
document.addEventListener("click", function(){
document.getElementById("menu").innerHTML="You Got Mail Homie!";
});
//event handler for body message
document.addEventListener("click", function(){
var bodyElement = document.getElementById("row1");
bodyElement.innerHTML = body;
element.appendChild(bodyElement);
});
//recurring function (need work on this)
window.setInterval(getNewMessage(), 500);
function getNewMessage(){
var now = new Date();
return generateMessage(now);
}
//accessing prepopulated data stored in window.geemails variable
var element = document.getElementById('main');
for (var i = 0; i < window.geemails.length; i++){
var currentMessage = window.geemails[i];
var sender = currentMessage.sender;
var subject = currentMessage.subject;
var date = currentMessage.date;
var body = currentMessage.body;
//visual list of mail message
var senderElement = document.createElement('row1');
senderElement.innerHTML = sender;
element.appendChild(senderElement);
var subjectElement = document.createElement('row1');
subjectElement.innerHTML = subject;
senderElement.appendChild(subjectElement);
var dateElement = document.createElement('row1');
dateElement.innerHTML = date;
subjectElement.appendChild(dateElement);
//body content after clicking on message
var bodyElement = document.getElementById('row2');
bodyElement.innerHTML = body;
row2.appendChild(bodyElement);
}
};
</script>
</head>
<body>
<header>
<h1>GeeMail</h1>
<h3>Powered By { }</h3>
<p id="today"></p>
</header>
<div id="menu">
<table>
<tr><td><strong>Inbox {1}</strong></td></tr>
</table>
</div>
<div id="main">
<p id="row1"></p>
<p id="row2"></p>
</div>
<div>
<table>
<tr><td><h5><img src="devleague logo.jpeg"></h5></td></tr>
</table>
</div>
</body>
</html>