Skip to content

Commit

Permalink
newest
Browse files Browse the repository at this point in the history
  • Loading branch information
arvidkahl committed Mar 2, 2012
1 parent dcdfd99 commit 6399d12
Show file tree
Hide file tree
Showing 50 changed files with 8,096 additions and 21 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
.nodester.appconfig
node_modules/*
*.DS_Store
1 change: 1 addition & 0 deletions .nodemonignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.concept.MD
24 changes: 24 additions & 0 deletions CONCEPT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# spark

## modules

* express
* everyauth
* coffee-script
* less
* jade

## db structure
- image
- _id
- url
- name
- owner
- groups-get [public, owner-only, ]
- groups-write
- stories
- username
- title
- tags
- text

17 changes: 17 additions & 0 deletions auth.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
everyauth = module.exports = require 'everyauth'
everyauth.debug = true
everyauth.everymodule.moduleErrback (err) ->
console.log err
everyauth.twitter
.consumerKey('umY6lNpuhh4B6I1BshJMLA')
.consumerSecret('I4qEqVHgZM0LEVY61sE9w1tFW5lTATCxOy7CwaO0NA')
.findOrCreateUser((session, token, secret, user) ->
promise = @.Promise().fulfill user
).redirectPath '/'

#everyauth = module.exports = require 'everyauth'
#
#everyauth.twitter.consumerKey 'umY6lNpuhh4B6I1BshJMLA'
#everyauth.twitter.consumerSecret 'I4qEqVHgZM0LEVY61sE9w1tFW5lTATCxOy7CwaO0NA'
#everyauth.twitter.findOrCreateUser ( sess, accessToken, accessSecret, twitUser, reqres) ->
# console.log twitUser.screen_name
38 changes: 33 additions & 5 deletions main.coffee
Original file line number Diff line number Diff line change
@@ -1,26 +1,49 @@
# Requires and Variables
exp = require 'express'
app = exp.createServer()


less = require 'less'
fs = require 'fs'
md = require('node-markdown').Markdown
auth = require 'auth'
#auth.helpExpress app

# App Configuration
app.configure () ->
app.set 'view engine', 'jade'
app.set 'views', __dirname + '/views'
app.use exp.static __dirname + '/public'
app.use exp.methodOverride()
app.set 'view engine', 'jade'
app.set 'views', __dirname + '/views'
app.use exp.errorHandler { dumpExceptions: true, showStack: true }
app.use exp.compiler { src: __dirname + '/public', dest: __dirname + '/public', enable: ['less'] }
app.use exp.methodOverride()
app.use exp.bodyParser()
app.use exp.cookieParser()
app.use exp.session {secret: 'nawollenwirdochmalsehn'}
app.use exp.static __dirname + '/public'
#app.use '/public/less' exp.static(__dirname + '/public/less')

app.use auth.middleware()

#exp.compiler.compilers.less.compile = (str, fn) =>
# less.render str, { compress : true }, fn

# Articler Class
Articler = require('./articler').Articler
article = new Articler 'http://arvidkahl.iriscouch.com', 5984

app.get '/', (req, res) ->
if (req.session.auth)
console.log "You are authed."
#console.log req.session.auth.twitter
user = req.session.auth.twitter.user
else
console.log "You are not authed."
article.findAll (err, docs) ->
console.log "GET /"
res.render 'index', {
locals: {
title: 'Sparks'
articles: docs
user: user
}
}

Expand All @@ -38,6 +61,11 @@ app.post '/new', (req, res) ->
}, (err, docs) ->
res.redirect('/')

app.get '/concept', (req, res) ->
fs.readFile 'CONCEPT.md', 'ascii', (err, data) ->
throw err if err
res.end md data

# Run App
app.listen 14904
console.log 'Server running at http://localhost:14904/'
25 changes: 25 additions & 0 deletions public/concept.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# spark

modules
=======

* express
* everyauth
* coffee-script
* less
* jade


db structure
============

- image
- _id
- url
- name
- stories
- username
- title
- tags
- text

Empty file added public/css/test.css
Empty file.
Binary file added public/img/glyphicons-halflings-white.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 public/img/glyphicons-halflings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions public/less/accordion.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// ACCORDION
// ---------


// Parent container
.accordion {
margin-bottom: @baseLineHeight;
}

// Group == heading + body
.accordion-group {
margin-bottom: 2px;
border: 1px solid #e5e5e5;
.border-radius(4px);
}
.accordion-heading {
border-bottom: 0;
}
.accordion-heading .accordion-toggle {
display: block;
padding: 8px 15px;
}

// Inner needs the styles because you can't animate properly with any styles on the element
.accordion-inner {
padding: 9px 15px;
border-top: 1px solid #e5e5e5;
}
70 changes: 70 additions & 0 deletions public/less/alerts.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
// ALERT STYLES
// ------------

// Base alert styles
.alert {
padding: 8px 35px 8px 14px;
margin-bottom: @baseLineHeight;
text-shadow: 0 1px 0 rgba(255,255,255,.5);
background-color: @warningBackground;
border: 1px solid @warningBorder;
.border-radius(4px);
}
.alert,
.alert-heading {
color: @warningText;
}

// Adjust close link position
.alert .close {
position: relative;
top: -2px;
right: -21px;
line-height: 18px;
}

// Alternate styles
// ----------------

.alert-success {
background-color: @successBackground;
border-color: @successBorder;
}
.alert-success,
.alert-success .alert-heading {
color: @successText;
}
.alert-danger,
.alert-error {
background-color: @errorBackground;
border-color: @errorBorder;
}
.alert-danger,
.alert-error,
.alert-danger .alert-heading,
.alert-error .alert-heading {
color: @errorText;
}
.alert-info {
background-color: @infoBackground;
border-color: @infoBorder;
}
.alert-info,
.alert-info .alert-heading {
color: @infoText;
}


// Block alerts
// ------------------------
.alert-block {
padding-top: 14px;
padding-bottom: 14px;
}
.alert-block > p,
.alert-block > ul {
margin-bottom: 0;
}
.alert-block p + p {
margin-top: 5px;
}
Loading

0 comments on commit 6399d12

Please sign in to comment.