Skip to content

Commit

Permalink
Merge remote branch 'origin/spike_v1'
Browse files Browse the repository at this point in the history
  • Loading branch information
matterker committed Mar 22, 2011
2 parents e7be582 + a2b5237 commit 1c13193
Show file tree
Hide file tree
Showing 6 changed files with 114 additions and 9 deletions.
1 change: 0 additions & 1 deletion README

This file was deleted.

8 changes: 0 additions & 8 deletions index.html

This file was deleted.

37 changes: 37 additions & 0 deletions server.js
@@ -0,0 +1,37 @@
var
path = require('path'),
http = require('http'),
paperboy = require('paperboy'),
PORT = 80,
WEBROOT = path.join(path.dirname(__filename), 'web');

http.createServer(function(req, res) {
var ip = req.connection.remoteAddress;

paperboy
.deliver(WEBROOT, req, res)
.addHeader('Expires', 300)
.before(function() {
console.log('Received Request');
})
.after(function(statCode) {
log(statCode, req.url, ip);
})
.error(function(statCode, msg) {
res.writeHead(statCode, {'Content-Type': 'text/plain'});
res.end("Error " + statCode)
log(statCode, req.url, ip, msg)
})
.otherwise(function(err) {
res.writeHead(404, {'Content-Type': 'text/plain'});
res.end("Error 404: File not found");
log(404, req.url, ip, err);
});
}).listen(PORT);

function log(statCode, url, ip, err) {
var logStr = statCode + ' _ ' + url + ' - ' + ip;
if (err)
logStr += ' - ' + err;
console.log(logStr);
}
41 changes: 41 additions & 0 deletions web/css/main.css
@@ -0,0 +1,41 @@
body {
color: #888;
font-family: 'Ubuntu', arial, serif;
text-align: center;
}

h1, h3 {
text-shadow: 2px 2px 2px #CCC;
color: #555;
}

h3 {
font-style: italic;
}

p {
margin-top: 100px;
}

table.grid {
border: 2px solid #555;
border-collapse: collapse;
margin-left: auto;
margin-right: auto;
}

table.grid td {
border: 1px solid #CCC;
height: 100px;
width: 150px;
}

.block {
height: 100%;
padding: 5px;
text-align: center;
}

.filled {
background-color: #D3E3D5;
}
27 changes: 27 additions & 0 deletions web/index.html
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bacobahnen</title>
<meta charset="utf-8" />
<link href='http://fonts.googleapis.com/css?family=Ubuntu' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="css/main.css" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js" charset="utf-8"></script>
<script src="js/main.js" charset="utf-8"></script>
</head>
<body>
<h1>Bacobahnen</h1>
<h3><u>The</u> Digital Whiteboard</h3>
<table id="board" class="grid center">
<tbody>
<tr><td></td><td></td><td></td><td></td><td></td></tr>
<tr><td></td><td></td><td></td><td></td><td></td></tr>
<tr><td></td><td></td><td></td><td></td><td></td></tr>
<tr><td></td><td></td><td></td><td></td><td></td></tr>
<tr><td></td><td></td><td></td><td></td><td></td></tr>
</tbody>
</table>
<p><a rel="license" href="http://creativecommons.org/licenses/by/3.0/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by/3.0/88x31.png" /></a><br /><span xmlns:dct="http://purl.org/dc/terms/" property="dct:title">Bacobahnen</span> by <a xmlns:cc="http://creativecommons.org/ns#" href="https://github.com/benjaminplee/Bacobahnen" property="cc:attributionName" rel="cc:attributionURL">Benjamin Lee & Matt Erker</a> is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution 3.0 Unported License</a>.<br />Based on a work at <a xmlns:dct="http://purl.org/dc/terms/" href="https://github.com/benjaminplee/Bacobahnen" rel="dct:source">github.com</a>.</p>
<a href="https://github.com/benjaminplee/Bacobahnen"><img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" /></a>
</body>
</html>

9 changes: 9 additions & 0 deletions web/js/main.js
@@ -0,0 +1,9 @@
$(function() {

$('#board td').append("<div class='block' contentEditable='true'></div>")

$('.block').keyup( function() {
$(this).toggleClass('filled', !!$(this).text().trim())
})

})

0 comments on commit 1c13193

Please sign in to comment.