Permalink
Browse files

magic things

  • Loading branch information...
rashfael committed Jan 20, 2013
1 parent d48895c commit df5abd2e02cd36a6eaf1798812a8ff47e50f8912
View
@@ -11,62 +11,62 @@ require 'lib/iosync'
# The application object
module.exports = class Application extends Chaplin.Application
# Set your application name here so the document title is set to
# “Controller title – Site title” (see Layout#adjustTitle)
title: 'Shack Karma'
serverUrl: 'http://localhost:9000/'
# Set your application name here so the document title is set to
# “Controller title – Site title” (see Layout#adjustTitle)
title: 'Shack Karma'
serverUrl: 'http://localhost:9000/'
initialize: ->
super
initialize: ->
super
# Initialize core components
@initDispatcher()
@initLayout()
@initMediator()
#@initRouter()
@router = new Router()
@initSocket ->
auth = new AuthenticationController()
# Initialize core components
@initDispatcher()
@initLayout()
@initMediator()
#@initRouter()
@router = new Router()
@initSocket ->
auth = new AuthenticationController()
mediator.subscribe '!auth:success', =>
@initControllers()
# register routes late
routes @router.match
@router.startHistory()
#mediator.publish '!router:route', ''
mediator.subscribe '!auth:success', =>
@initControllers()
# register routes late
routes @router.match
@router.startHistory()
#mediator.publish '!router:route', ''
Object.freeze? this
Object.freeze? this
# Override standard layout initializer
# ------------------------------------
initLayout: ->
# Use an application-specific Layout class. Currently this adds
# no features to the standard Chaplin Layout, it’s an empty placeholder.
@layout = new Layout {@title}
# Override standard layout initializer
# ------------------------------------
initLayout: ->
# Use an application-specific Layout class. Currently this adds
# no features to the standard Chaplin Layout, it’s an empty placeholder.
@layout = new Layout {@title}
# Instantiate common controllers
# ------------------------------
initControllers: ->
# These controllers are active during the whole application runtime.
# You don’t need to instantiate all controllers here, only special
# controllers which do not to respond to routes. They may govern models
# and views which are needed the whole time, for example header, footer
# or navigation views.
# e.g. new NavigationController()
# new SessionController()
new HeaderController()
# Instantiate common controllers
# ------------------------------
initControllers: ->
# These controllers are active during the whole application runtime.
# You don’t need to instantiate all controllers here, only special
# controllers which do not to respond to routes. They may govern models
# and views which are needed the whole time, for example header, footer
# or navigation views.
# e.g. new NavigationController()
# new SessionController()
new HeaderController()
new FooterController()
# Create additional mediator properties
# -------------------------------------
initMediator: ->
# Create a user property
Chaplin.mediator.user = null
# Add additional application-specific properties and methods
# Seal the mediator
# Chaplin.mediator.seal()
# Create additional mediator properties
# -------------------------------------
initMediator: ->
# Create a user property
Chaplin.mediator.user = null
# Add additional application-specific properties and methods
# Seal the mediator
# Chaplin.mediator.seal()
initSocket: (cb) =>
socket = io.connect @serverUrl
Backbone.socket = socket
socket.on 'connect', cb
initSocket: (cb) =>
socket = io.connect @serverUrl
Backbone.socket = socket
socket.on 'connect', cb
@@ -1,5 +1,6 @@
thead
tr
th Name
th Karma Points
th Description
tbody
@@ -6,6 +6,7 @@ include mixins/form_helpers
form.form-horizontal
fieldset
mixin textfield({name:'name', label:'Name'})
mixin textfield({name:'karma', label:'Karma Points'})
mixin textarea({name:'description', label:'Description'})
.form-actions
button.btn.btn-primary Save
@@ -1,3 +1,4 @@
.page-header
h1= 'Deed ' + name
h4= 'Karma Points: ' + karma
p= description
@@ -1,2 +1,3 @@
td= name
td= karma
td= description
View
@@ -5,5 +5,6 @@ Schema = mongoose.Schema
schema = new Schema
name: String
description: String
karma: Number
module.exports = mongoose.model 'Deed', schema, 'deeds'

0 comments on commit df5abd2

Please sign in to comment.