Permalink
Browse files

Initial commit

  • Loading branch information...
0 parents commit d5bf586308e7ec5c29d10a3520239393059660bf @edubkendo committed Jun 14, 2012
Showing with 62,656 additions and 0 deletions.
  1. +41 −0 .gitignore
  2. 0 .npmignore
  3. +9 −0 .slugignore
  4. +37 −0 Cakefile
  5. +1 −0 Procfile
  6. +37 −0 README.md
  7. +80 −0 Watchfile
  8. +9 −0 app/client/config/application.coffee
  9. +2 −0 app/client/controllers/applicationController.coffee
  10. 0 app/client/stylesheets/application.styl
  11. +15 −0 app/controllers/applicationController.coffee
  12. +1 −0 app/helpers/applicationHelper.coffee
  13. +44 −0 app/views/layouts/application.coffee
  14. +15 −0 app/views/shared/_flash.coffee
  15. +4 −0 app/views/shared/_footer.coffee
  16. +1 −0 app/views/shared/_header.coffee
  17. +36 −0 app/views/shared/_meta.coffee
  18. +11 −0 app/views/shared/_navigation.coffee
  19. 0 app/views/shared/_sidebar.coffee
  20. +1 −0 app/views/welcome.coffee
  21. +20 −0 config/application.coffee
  22. +66 −0 config/assets.coffee
  23. +21 −0 config/credentials.coffee
  24. +36 −0 config/databases.coffee
  25. 0 config/environments/development.coffee
  26. 0 config/environments/production.coffee
  27. 0 config/environments/test.coffee
  28. +29 −0 config/locales/en.coffee
  29. +3 −0 config/routes.coffee
  30. +5 −0 config/session.coffee
  31. +35 −0 db/seeds.coffee
  32. +68 −0 package.json
  33. +27 −0 public/404.html
  34. +27 −0 public/500.html
  35. +5 −0 public/crossdomain.xml
  36. BIN public/favicon.png
  37. +19 −0 public/humans.txt
  38. +824 −0 public/images/glyphicons-halflings-white.png
  39. +824 −0 public/images/glyphicons-halflings.png
  40. 0 public/robots.txt
  41. BIN public/swfs/WebSocketMain.swf
  42. BIN public/swfs/WebSocketMainInsecure.swf
  43. +2 −0 server.js
  44. +13 −0 test/client.coffee
  45. +4 −0 test/mocha.opts
  46. +22 −0 test/server.coffee
  47. +412 −0 vendor/javascripts/accounting.js
  48. +692 −0 vendor/javascripts/async.js
  49. +90 −0 vendor/javascripts/bootstrap/bootstrap-alert.js
  50. +96 −0 vendor/javascripts/bootstrap/bootstrap-button.js
  51. +169 −0 vendor/javascripts/bootstrap/bootstrap-carousel.js
  52. +157 −0 vendor/javascripts/bootstrap/bootstrap-collapse.js
  53. +100 −0 vendor/javascripts/bootstrap/bootstrap-dropdown.js
  54. +218 −0 vendor/javascripts/bootstrap/bootstrap-modal.js
  55. +98 −0 vendor/javascripts/bootstrap/bootstrap-popover.js
  56. +151 −0 vendor/javascripts/bootstrap/bootstrap-scrollspy.js
  57. +135 −0 vendor/javascripts/bootstrap/bootstrap-tab.js
  58. +275 −0 vendor/javascripts/bootstrap/bootstrap-tooltip.js
  59. +61 −0 vendor/javascripts/bootstrap/bootstrap-transition.js
  60. +285 −0 vendor/javascripts/bootstrap/bootstrap-typeahead.js
  61. +3,403 −0 vendor/javascripts/chai.js
  62. +411 −0 vendor/javascripts/coffeekup.js
  63. +118 −0 vendor/javascripts/design.io.js
  64. +17,384 −0 vendor/javascripts/ember.js
  65. +75 −0 vendor/javascripts/factory.js
  66. +489 −0 vendor/javascripts/faker.js
  67. +921 −0 vendor/javascripts/geolib.js
  68. +77 −0 vendor/javascripts/history.adapter.jquery.js
  69. +1,943 −0 vendor/javascripts/history.js
  70. +3 −0 vendor/javascripts/html5.js
  71. +570 −0 vendor/javascripts/inflection.js
  72. +4,226 −0 vendor/javascripts/mocha.js
  73. +918 −0 vendor/javascripts/moment.js
  74. +28 −0 vendor/javascripts/prettify.js
  75. +3,469 −0 vendor/javascripts/sinon.js
  76. +3,789 −0 vendor/javascripts/socket.io.js
  77. +10,811 −0 vendor/javascripts/tower.js
  78. +1,104 −0 vendor/javascripts/underscore.js
  79. +570 −0 vendor/javascripts/underscore.string.js
  80. +1,466 −0 vendor/javascripts/uri.js
  81. +865 −0 vendor/javascripts/validator.js
  82. +33 −0 vendor/stylesheets/bootstrap/accordion.less
  83. +58 −0 vendor/stylesheets/bootstrap/alerts.less
  84. +62 −0 vendor/stylesheets/bootstrap/bootstrap.less
  85. +24 −0 vendor/stylesheets/bootstrap/breadcrumbs.less
  86. +191 −0 vendor/stylesheets/bootstrap/button-groups.less
  87. +191 −0 vendor/stylesheets/bootstrap/buttons.less
  88. +121 −0 vendor/stylesheets/bootstrap/carousel.less
  89. +29 −0 vendor/stylesheets/bootstrap/close.less
  90. +57 −0 vendor/stylesheets/bootstrap/code.less
  91. +20 −0 vendor/stylesheets/bootstrap/component-animations.less
  92. +143 −0 vendor/stylesheets/bootstrap/dropdowns.less
  93. +583 −0 vendor/stylesheets/bootstrap/forms.less
  94. +5 −0 vendor/stylesheets/bootstrap/grid.less
  95. +22 −0 vendor/stylesheets/bootstrap/hero-unit.less
  96. +55 −0 vendor/stylesheets/bootstrap/labels-badges.less
  97. +17 −0 vendor/stylesheets/bootstrap/layouts.less
  98. +646 −0 vendor/stylesheets/bootstrap/mixins.less
  99. +90 −0 vendor/stylesheets/bootstrap/modals.less
  100. +358 −0 vendor/stylesheets/bootstrap/navbar.less
  101. +363 −0 vendor/stylesheets/bootstrap/navs.less
  102. +36 −0 vendor/stylesheets/bootstrap/pager.less
  103. +56 −0 vendor/stylesheets/bootstrap/pagination.less
  104. +49 −0 vendor/stylesheets/bootstrap/popovers.less
  105. +117 −0 vendor/stylesheets/bootstrap/progress-bars.less
  106. +131 −0 vendor/stylesheets/bootstrap/reset.less
  107. +48 −0 vendor/stylesheets/bootstrap/responsive.less
  108. +29 −0 vendor/stylesheets/bootstrap/scaffolding.less
  109. +191 −0 vendor/stylesheets/bootstrap/sprites.less
  110. +176 −0 vendor/stylesheets/bootstrap/tables.less
  111. +47 −0 vendor/stylesheets/bootstrap/thumbnails.less
  112. +35 −0 vendor/stylesheets/bootstrap/tooltip.less
  113. +232 −0 vendor/stylesheets/bootstrap/type.less
  114. +23 −0 vendor/stylesheets/bootstrap/utilities.less
  115. +206 −0 vendor/stylesheets/bootstrap/variables.less
  116. +27 −0 vendor/stylesheets/bootstrap/wells.less
  117. +182 −0 vendor/stylesheets/mocha.css
  118. +30 −0 vendor/stylesheets/prettify.css
@@ -0,0 +1,41 @@
+## MAC OS
+.DS_Store
+*.gem
+## TEXTMATE
+*.tmproj
+tmtags
+
+## EMACS
+*~
+\#*
+.\#*
+
+## VIM
+*.swp
+
+## PROJECT::GENERAL
+coverage
+rdoc
+pkg
+*.log
+
+## PROJECT::SPECIFIC
+
+.project
+*~
+*.diff
+*.patch
+*.psd
+cdn/jquery-mobile/git
+.DS_Store
+cache/
+combined/
+combine/
+
+node_modules
+public/assets/*.css
+public/assets/*.js
+public/javascripts/
+public/stylesheets/
+npm-debug.log
+tmp/
No changes.
@@ -0,0 +1,9 @@
+*.psd
+*.pdf
+test
+spec
+./docs
+README.markdown
+Watchfile
+.gitignore
+wiki
@@ -0,0 +1,37 @@
+require 'tower'
+knox = require 'knox'
+
+task 'assets:upload', ->
+ invoke 'assets:upload:s3'
+
+task 'assets:upload:s3', ->
+ invoke 'environment'
+
+ client = knox.createClient Tower.config.credentials.s3
+
+ Tower.Application.Assets.upload (from, to, headers, callback) ->
+ client.putFile from, to, headers, callback
+
+task 'assets:bundle', ->
+ invoke 'environment'
+ Tower.Application.Assets.bundle()
+
+task 'assets:stats', 'Table displaying uncompressed, minified, and gzipped asset sizes', ->
+ invoke 'environment'
+ Tower.Application.Assets.stats()
+
+task 'db:seed', ->
+ require('tower').Application.instance().initialize =>
+ require './db/seeds'
+
+task 'environment', ->
+ Tower.env = 'production'
+ Tower.Application.instance().initialize()
+
+task 'routes', ->
+ invoke 'environment'
+
+ result = []
+ routes = Tower.Route.all()
+
+ result
@@ -0,0 +1 @@
+web: node server.js -e production
@@ -0,0 +1,37 @@
+# SampleApp
+
+## Install
+
+First [setup the Tower.js development environment](http://towerjs.org/guides/development#environment), then run:
+
+```
+git clone git@github.com:undefined/sampleApp.git
+cd sampleApp
+npm install
+node server
+```
+
+## Test
+
+Run tests:
+
+```
+npm test
+```
+
+Read up on [testing Tower.js apps](http://towerjs.org/guides/testing).
+
+## Deploy
+
+Read [How to deploy Tower Apps to Heroku](http://towerjs.org/guides/deployment#heroku).
+
+## Documentation
+
+- [Tower.js](http://towerjs.org/guides)
+- [MongoDB](http://www.mongodb.org/display/DOCS/Advanced+Queries)
+- [Node.js](http://nodejs.org/docs/v0.6.11/api/fs.html)
+- [Mocha](https://github.com/visionmedia/mocha)
+- [CoffeeScript](http://coffeescript.org/)
+- [Stylus](http://learnboost.github.com/stylus/)
+
+If all else fails, see the [Rails Guides](http://guides.rubyonrails.org/), should be fairly close.
@@ -0,0 +1,80 @@
+require('design.io').extension('watchfile')
+
+async = require('async')
+File = require('pathfinder').File
+mint = require('mint')
+
+require("design.io-stylesheets") /(app\/client|lib\/stylesheets|vendor\/stylesheets)/
+ compress: false
+ debug: false
+ ignore: /(public|node_modules)/
+ paths: ["./app/client/stylesheets", "./vendor/stylesheets/bootstrap"]
+ outputPath: (path) ->
+ "public/stylesheets/#{path}".replace(/\.(sass|scss|stylus|styl|less|css)/, ".css")
+
+require("design.io-javascripts")
+ compress: false
+ debug: false
+ ignore: /(public|node_modules|server|app\/views|config)/
+ outputPath: (path) ->
+ "public/javascripts/#{path}".replace(/\.(js|coffee)/, ".js")
+
+# client config
+require("design.io-javascripts") /(config\/locales\/.*|config\/routes|app\/client\/config\/.*)\.(js|coffee)$/
+ compress: false
+ debug: false
+ ignore: /(public|node_modules)/
+ outputPath: (path) ->
+ "public/javascripts/#{path}".replace(/\.(js|coffee)/, ".js")
+
+watch /app\/views.*\.coffee$/
+ update: (path, callback) ->
+ try
+ nodes = path.replace("app/views/", "").split("/")
+ name = {}
+
+ data = File.read(path)
+ id = nodes.join("/")
+ selector = id
+ name = ""
+
+ @broadcast body: data, id: id, selector: selector, path: "/#{name}"
+
+ files = File.files("app/views")
+ result = []
+
+ for file in files
+ continue unless file.match(/\.coffee$/)
+ result.push [file.replace(/\.coffee$/, ""), File.read(file) + "\n\n"]
+
+ template = "Tower.View.cache =\n"
+
+ iterator = (item, next) =>
+ template += " '#{item[0]}': ->\n"
+ lines = item[1].split(/\n/)
+ for line, i in lines
+ lines[i] = " #{line}"
+ template += lines.join("\n")
+ template += "\n"
+ next()
+
+ async.forEachSeries result, iterator, (error) =>
+ mint.coffee template, bare: true, (error, string) =>
+ if error
+ console.log error
+ return callback(error)
+ else
+ File.write "public/javascripts/app/views/templates.js", string
+ callback()
+
+ catch error
+ callback(error)
+
+ client:
+ update: (data) ->
+ Tower.View.cache[data.id] = data
+
+ #if data.reload
+ # window.location = data.path
+ #else
+ # Tower.get data.path
@@ -0,0 +1,9 @@
+class App extends Tower.Application
+ @configure ->
+ @use Tower.Middleware.Agent
+ @use Tower.Middleware.Location
+ @use Tower.Middleware.Router
+
+ bootstrap: (data) ->
+
+window.App = (new App).initialize()
@@ -0,0 +1,2 @@
+class App.ApplicationController extends Tower.Controller
+
No changes.
@@ -0,0 +1,15 @@
+class App.ApplicationController extends Tower.Controller
+ @layout "application"
+
+ @beforeAction "bootstrap"#, only: "welcome"
+
+ welcome: ->
+ @render "welcome", locals: {@bootstrapData}
+
+ # Example of how you might bootstrap a one-page application.
+ bootstrap: (callback) ->
+ data = @bootstrapData = {}
+
+ # for every model you add, you can add it to the bootstrap dataset by using this async helper.
+ _.series [
+ ], callback
@@ -0,0 +1 @@
+App.ApplicationHelper = {}
@@ -0,0 +1,44 @@
+doctype 5
+html ->
+ head ->
+ partial "shared/meta"
+
+ body role: "application", ->
+ #if browserIs "ie"
+ # javascriptTag "http://html5shiv.googlecode.com/svn/trunk/html5.js"
+
+ if hasContentFor "templates"
+ yields "templates"
+
+ nav id: "navigation", class: "navbar", role: "navigation", ->
+ div class: "navbar-inner", ->
+ div class: "container", ->
+ partial "shared/navigation"
+
+ header id: "header", class: "header", role: "banner", ->
+ div class: "container", ->
+ partial "shared/header"
+
+ section id: "flash", role: "banner", ->
+ div class: "container", ->
+ partial "shared/flash"
+
+ section id: "content", role: "main", ->
+ div class: "container", ->
+ yields "body"
+ aside id: "sidebar", role: "complementary", ->
+ if hasContentFor "sidebar"
+ yields "sidebar"
+
+ footer id: "footer", class: "footer", role: "contentinfo", ->
+ div class: "container", ->
+ partial "shared/footer"
+
+ if hasContentFor "popups"
+ aside id: "popups", ->
+ yields "popups"
+
+ if hasContentFor "bottom"
+ yields "bottom"
+
+ script "App.bootstrap(#{JSON.stringify(@bootstrapData, null, [])})" if @bootstrapData
@@ -0,0 +1,15 @@
+if @flash.error
+ div class: "alert alert-error", ->
+ a class: "close", data: {dismiss: "alert"}, href: "#", -> "x"
+ h1 "Error!"
+ h4 @flash.error
+if @flash.success
+ div class: "alert alert-success", ->
+ a class: "close", data: {dismiss: "alert"}, href: "#", -> "x"
+ h1 "Success!"
+ h4 @flash.success
+if @flash.info
+ div class: "alert alert-info", ->
+ a class: "close", data: {dismiss: "alert"}, href: "#", -> "x"
+ h1 "Important!"
+ h4 @flash.info
@@ -0,0 +1,4 @@
+cite class: "copyright", ->
+ span "©"
+ linkTo t("author"), t("email")
+ span "#{t("year")}."
@@ -0,0 +1 @@
+h1 id: "title", -> t("title")
@@ -0,0 +1,36 @@
+meta charset: "utf-8"
+
+if hasContentFor "title"
+ title @title
+else
+ title t("title")
+
+meta name: "description", content: t("description")
+meta name: "keywords", content: t("keywords")
+meta name: "robots", content: t("robots")
+meta name: "author", content: t("author")
+
+csrfMetaTag()
+
+appleViewportMetaTag width: "device-width", max: 1, scalable: false
+
+stylesheets "lib", "vendor", "application", "development"
+
+link href: "/favicon.png", rel: "icon shortcut-icon favicon"
+
+#if browserIs("firefox")
+# stylesheets "font"
+
+#if contentFor "headStyleSheets"
+# yield "headStyleSheets"
+
+javascriptTag "https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"
+
+#if contentFor "headJavaScripts"
+# yield "headJavaScripts"
+
+contentFor "bottom", ->
+ javascripts "vendor"
+ if Tower.env == "development"
+ javascripts "development"
+ javascripts "lib", "application"
@@ -0,0 +1,11 @@
+linkTo t("title"), "/", class: "brand"
+
+div class: "nav-collapse", ->
+ ul class: "nav", ->
+ ul class: "nav pull-right", ->
+ li class: "dropdown", ->
+ linkTo t("links.docs"), "#", class: "dropdown-toggle", "data-toggle": "dropdown", ->
+ b class: "caret"
+ ul class: "dropdown-menu", ->
+ li ->
+ linkTo "Tower.js", "http://towerjs.org"
No changes.
@@ -0,0 +1 @@
+h1 "Welcome to Tower.js"
@@ -0,0 +1,20 @@
+class App extends Tower.Application
+ @configure ->
+ @use "favicon", Tower.publicPath + "/favicon.png"
+ @use "static", Tower.publicPath, maxAge: Tower.publicCacheDuration
+ @use "profiler" if Tower.env != "production"
+ @use "logger"
+ @use "query"
+ @use "cookieParser", Tower.config.session.key
+ @use "session", secret: Tower.config.session.secret, cookie: {domain: Tower.config.session.cookie.domain}
+ @use "bodyParser", uploadDir: "./public/uploads"
+ #@use "csrf"
+ @use "methodOverride", "_method"
+ @use Tower.Middleware.Agent
+ @use Tower.Middleware.Location
+ #if Tower.httpCredentials && Tower.branch != "development"
+ # @use "basicAuth", Tower.httpCredentials.username, Tower.httpCredentials.password
+
+ @use Tower.Middleware.Router
+
+module.exports = global.App = new App
Oops, something went wrong.

0 comments on commit d5bf586

Please sign in to comment.