Skip to content

Commit

Permalink
Adding index page so people can enter their email addresses to be not…
Browse files Browse the repository at this point in the history
…ified when Writeboard launches.
  • Loading branch information
gtramontina committed Aug 1, 2011
1 parent 86883e5 commit 038913d
Show file tree
Hide file tree
Showing 8 changed files with 117 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/controllers/room.coffee
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = (app, nowjs) ->

app.get '/:roomId', (req, res) ->
app.get '/alpha/:roomId', (req, res) ->
res.render 'writeboard', { title: 'Writeboard!', roomId: req.params.roomId }

everyone = nowjs.initialize app, socketio: 'log level': 2
Expand Down
11 changes: 10 additions & 1 deletion lib/controllers/writeboard.coffee
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module.exports = (app, nowjs) ->

app.get '/', (req, res) -> res.redirect "/#{Date.now()}"
app.get '/', (req, res) -> res.render 'index', layout: false

app.get '/alpha/', (req, res) -> res.redirect "/alpha/#{Date.now()}"

app.get '/about', (req, res) ->
parameters =
Expand All @@ -9,3 +11,10 @@ module.exports = (app, nowjs) ->
else layout: true, locals: title: 'Writeboard - About it!'
res.render 'about', parameters

CouchClient = require 'couch-client'
DEV_COUCH_URL = '/writeboard'
interested = CouchClient(process.env.IRIS_COUCH_URL or DEV_COUCH_URL)
app.post '/interested', (req, res) ->
interested.save email: req.body.email, (error, doc) ->
if error then res.send false, 500 else res.send true, 200

Binary file added lib/public/images/index.marker.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lib/public/images/index.texture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lib/public/stylesheets/GTramontina.ttf
Binary file not shown.
50 changes: 50 additions & 0 deletions lib/public/stylesheets/index.styl
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
@import 'nib'

@font-face
font-family 'GTramontina'
src url('GTramontina.ttf')

body
background-image url('../images/index.texture.png')
font-family 'GTramontina'
font-size 1.8em

a
text-decoration none
color blue

#info
background-image url('../images/grid.gif')
background-color white
display block
margin-left auto
margin-right auto
width 600px
border rgba(0, 0, 0, 0.8) solid 1px
padding 15px
box-shadow 0 0 10px rgba(0, 0, 0, 0.9)

h1
text-align center

form
text-align right
input
font-family "lucida grande", sans-serif
font-size 11px
border rgba(0, 0, 0, 0.5) solid 1px

#submit
download-button(green)

#footer
text-align right
font-family "lucida grande", sans-serif
font-size 11px

#marker
position absolute
top 470px
background-image url('../images/index.marker.png')
width 333px
height 130px
54 changes: 54 additions & 0 deletions lib/views/index.jade
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
!!! 5
html
head
title Writeboard.me
link(rel='stylesheet', href='/stylesheets/index.css')
script(src='/javascripts/lib/google.analytics.js')
script(src='http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js')

body
a(href='http://github.com/gtramontina/Writeboard')
img(style='position: absolute; top: 0; right: 0; border: 0;', src='https://a248.e.akamai.net/assets.github.com/img/30f550e0d38ceb6ef5b81500c64d970b7fb0f028/687474703a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6f72616e67655f6666373630302e706e67', alt='Fork me on GitHub')

#info
#marker

h1 Writeboard.me
span
p
| Access the
a(href='/alpha/') alpha version
| and give it a try! Share the room URL with your friends/co-workers and let the huddle begin.
p
| Please feel free to suggest features, improvements or file bugs
a(href='https://github.com/gtramontina/Writeboard/issues') here
| .
p
| Writeboard.me is an open-source project, so if you are a developer willing to contribute,
a(href='http://github.com/gtramontina/Writeboard') fork it on GitHub
| !
p
| To be informed when Writeboard.me is born, enter your email below and we'll let you know.

form(method='POST', id='interested', onsubmit='return submitForm()')
input(name='email', placeholder='e-mail')
#submit(onclick='submitForm()') ✓ Keep me Posted

script
function submitForm() {
var form = document.forms.interested;
if (!(/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i).test(form.email.value)) {
alert('Invalid email format.');
return false;
}
$.post('/interested', {email: form.email.value}, function(success) {
if (success) {
$('#interested').text("Thanks! We'll keep you posted!");
}
})
}

span#footer
p
| Brought to you by
a(href='http://twitter.com/gtramontina')@gtramontina
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"now" : ">=0.7.0",
"jade" : ">=0.11.0",
"stylus" : ">=0.13.0",
"nib" : ">=0.0.7"
"nib" : ">=0.0.7",
"couch-client" : ">=0.0.4"
},
"devDependencies" : {
"jessie" : ">=0.3.7",
Expand Down

0 comments on commit 038913d

Please sign in to comment.