Permalink
Browse files

added the first release of the presentation

  • Loading branch information...
1 parent d0c8efb commit bbd19685c5fba3606f3d2ecbb21af7a581d568a1 @jettro committed Apr 28, 2011
View
@@ -0,0 +1 @@
+/.idea/
View
27 app.js
@@ -0,0 +1,27 @@
+var pub = __dirname + '/public';
+
+var Slide = require('./slide');
+var express = require('express')
+ , app = express.createServer()
+ , slide = new Slide();
+
+app.configure(function() {
+ app.set('view engine', 'jade');
+ app.set('views', __dirname + '/views');
+ app.set('view options', { layout: 'layout' });
+ app.use(express.methodOverride());
+ app.use(express.static(pub));
+// app.use(express.logger());
+ app.use(express.bodyParser());
+});
+
+app.get('/', function(req, res) {
+ res.render('index', {locals: {slides:slide.allSlides()}});
+});
+app.get('/slide/:id', slide.index);
+app.post('/slide/:id', slide.command);
+
+app.listen(8008);
+console.log('Express server started on port %s', app.address().port);
+
+
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -0,0 +1,3 @@
+$(document).ready(function() {
+ $("#command").focus();
+});
View
@@ -0,0 +1,58 @@
+html, body {
+ height: 100%;
+ padding: 0;
+ margin: 0;
+}
+
+blockquote {
+ font-size: 24pt;
+ font-style: italic;
+ vertical-align: middle;
+ padding: 100px;
+ quotes: "\201C" "\201D";
+}
+
+blockquote:before {
+ content: open-quote;
+ font-weight: bold;
+}
+
+blockquote:after {
+ content: close-quote;
+ font-weight: bold;
+}
+
+#fullscreen {
+ min-height: 100%;
+}
+
+#title {
+ text-align: center;
+ font-size: 36pt;
+ padding: 20px;
+
+}
+
+#body {
+ text-align: center;
+ overflow: hidden;
+ padding-bottom: 40px;
+ vertical-align: middle;
+}
+
+#footer {
+ position: relative;
+ margin-top: -40px; /* negative value of footer height */
+ height: 40px;
+ clear: both;
+ text-align: center;
+}
+
+#commandline {
+ float: left;
+}
+
+#counter {
+ float: right;
+ padding-right: 20px;
+}
View
@@ -0,0 +1,38 @@
+var slides = [];
+function Slide() {
+ slides.push("Creating a presentation with Node.js",
+ "Goal",
+ "Requirements");
+}
+
+Slide.prototype.index = function(req,res) {
+ renderSlide(req,res,req.params.id);
+};
+
+Slide.prototype.command = function(req,res) {
+ var id = req.params.id;
+ var command = req.body.command;
+ if (command == 'next' || command == 'n' || command == '') {
+ if (id < slides.length) id++;
+ } else if (command == 'previous' || command == 'p' || command == 'prev') {
+ if (id > 1) id--;
+ } else if (!isNaN(command)) {
+ var commandNum = parseInt(command);
+ if(commandNum > 0 && commandNum <= slides.length) id = commandNum;
+ }
+
+ console.log("Command: %s", command);
+ res.redirect('/slide/'+id);
+};
+
+Slide.prototype.allSlides = function() {
+ console.log("Num slides: %s",slides.length);
+ return slides;
+};
+
+function renderSlide(req,res,numSlide) {
+ res.render('slide/num'+numSlide, {locals: {numSlide:req.params.id,totalSlide:slides.length,titleSlide:slides[numSlide-1]}});
+}
+
+
+module.exports = Slide;
View
@@ -0,0 +1,5 @@
+p available slides
+ul
+ - each slide,index in slides
+ li
+ a(href='/slide/' + (index + 1)) #{slide}
View
@@ -0,0 +1,19 @@
+!!! 5
+html(lang="en")
+ head
+ title Nodejs presenter
+ link(href="/style/main.css", media="screen", rel="stylesheet", type="text/css")
+ script(src='/js/jquery-1.5.2.min.js')
+ script(src='/js/local.js')
+ body
+ div#fullscreen
+ - if(typeof(titleSlide) != "undefined")
+ div#title #{titleSlide}
+ div#body!= body
+ div#footer
+ - if(typeof(numSlide) != "undefined")
+ div#counter
+ slide #{numSlide} from #{totalSlide}
+ div#commandline
+ form(action="/slide/"+numSlide,method="POST")
+ input(type="text", size="100", name="command", id="command")
View
@@ -0,0 +1,3 @@
+img(src='/images/logo.jpg')
+div.heading author
+div Jettro Coenradie
View
@@ -0,0 +1 @@
+blockquote Show you how easy it is to create a presentation as a nerd
View
@@ -0,0 +1 @@
+p slide number 3

0 comments on commit bbd1968

Please sign in to comment.