Skip to content

Commit

Permalink
Lab 9 submitted
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Davis committed Mar 14, 2013
1 parent 3506c2d commit 5be17b7
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions status_dom/profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,36 @@
<head>
<title>Fecesbook</title>
<script type=text/javascript>
function update()
function init()
{
d = new Date();
curr_date = d.getDate();
curr_month = d.getMonth() + 1;
curr_year = d.getFullYear();
curr_hour = d.getHours();
curr_min = d.getMinutes();
}
function store(){
status = document.getElementById("msg").value;
localStorage[new Date().getTime()] = status;
reload();
}
function reload(){
update = (curr_date + "/" + curr_month + "/" + curr_year + " " + curr_hour + ":" + curr_min + " - " + status);
newnode=document.createElement("LI");
textnode=document.createTextNode(update);
newnode.appendChild(textnode);
list=document.getElementById("status")
list.insertBefore(newnode,list.childNodes[0]);
list = document.getElementById("update")
for(key in localStorage)
{
update = update + "<li>" + localStorage[key] + "</li>\n";

}
list.innerHTML = update;


}
</script>
</head>

<body>
<body onload="init()">
<h1>Fecebook</h1>
<div id="nav">
<ul>
Expand All @@ -40,13 +48,13 @@ <h1>Fecebook</h1>
</div>
<h2 id="fullname">Barney Gumble</h2>
<p><img src="https://s3.amazonaws.com/tufts-cs-mchow-images/barneymug.gif" alt="profile" /></p>
<h3>What are you thinking about? <input type="text" id="msg" name="msg" size="30" onchange="update()" /></h3>
<h3>What are you thinking about? <input type="text" id="msg" name="msg" size="30" onchange="store()" /></h3>
<h3>Updates</h3>
<ul id="status">
</ul>
<div id="yesterday">
<h3>Updates from yesterday:</h3>
<ul>
<ul id="update">
<li>Alice is now connected to Bob</li>
<li>Tom recommends Jerry</li>
<li>Harry just returned from a trip from Curaco</li>
Expand Down

0 comments on commit 5be17b7

Please sign in to comment.