Permalink
Browse files

loads of goodies :)

  • Loading branch information...
kristianmandrup committed Jun 29, 2012
1 parent 7b47c55 commit a43f5ab1f36b9f3e58835d00d29f72f8103a96df
Showing 301 changed files with 45,131 additions and 901 deletions.
View
@@ -0,0 +1,146 @@
+# ** Cakefile Template ** is a Template for a common Cakefile that you may use in a coffeescript nodejs project.
+#
+# It comes baked in with 4 tasks:
+#
+# * build - compiles your src directory to your lib directory
+# * watch - watches any changes in your src directory and automatically compiles to the lib directory
+# * test - runs mocha test framework, you can edit this task to use your favorite test framework
+# * docs - generates annotated documentation using docco
+fs = require 'fs'
+{print} = require 'util'
+{spawn, exec} = require 'child_process'
+
+# ANSI Terminal Colors
+bold = "BOLD"
+green = "GREEN"
+reset = "RESET"
+red = "RED"
+
+# Internal Functions
+#
+# ## *walk*
+#
+# **given** string as dir which represents a directory in relation to local directory
+# **and** callback as done in the form of (err, results)
+# **then** recurse through directory returning an array of files
+walk = (dir, done) ->
+ results = []
+ fs.readdir dir, (err, list) ->
+ return done(err, []) if err
+ pending = list.length
+ return done(null, results) unless pending
+ for name in list
+ file = "#{dir}/#{name}"
+ try
+ stat = fs.statSync file
+ catch err
+ stat = null
+ if stat?.isDirectory()
+ walk file, (err, res) ->
+ results.push name for name in res
+ done(null, results) unless --pending
+ else
+ results.push file
+ done(null, results) unless --pending
+
+# ## *log*
+#
+# **given** string as a message
+# **and** string as a color
+# **and** optional string as an explaination
+# **then** builds a statement and logs to console.
+log = (message, color, explanation) -> console.log color + message + reset + ' ' + (explanation or '')
+
+# ## *launch*
+#
+# **given** string as a cmd
+# **and** optional array and option flags
+# **and** optional callback
+# **then** spawn cmd with options
+# **and** pipe to process stdout and stderr respectively
+# **and** on child process exit emit callback if set and status is 0
+launch = (cmd, options=[], callback) ->
+ app = spawn cmd, options
+ app.stdout.pipe(process.stdout)
+ app.stderr.pipe(process.stderr)
+ app.on 'exit', (status) -> callback?() if status is 0
+
+# ## *build*
+#
+# **given** optional boolean as watch
+# **and** optional function as callback
+# **then** invoke launch passing coffee command
+# **and** defaulted options to compile src to lib
+build = (watch, callback) ->
+ if typeof watch is 'function'
+ callback = watch
+ watch = false
+
+ options = ['-c', '-b', '-o', 'lib', 'src']
+ options.unshift '-w' if watch
+ launch 'coffee', options, callback
+
+# ## *mocha*
+#
+# **given** optional array of option flags
+# **and** optional function as callback
+# **then** invoke launch passing mocha command
+mocha = (options, callback) ->
+ if typeof options is 'function'
+ callback = options
+ options = []
+
+ launch 'mocha', options, callback
+
+# ## *docco*
+#
+# **given** optional function as callback
+# **then** invoke launch passing docco command
+docco = (callback) ->
+ walk 'src', (err, files) -> launch 'docco', files, callback
+
+# Cakefile Tasks
+#
+# ## *docs*
+#
+# Generate Annotated Documentation
+#
+# <small>Usage</small>
+#
+# ```
+# cake docs
+# ```
+task 'docs', 'generate documentation', -> docco()
+
+# ## *build*
+#
+# Builds Source
+#
+# <small>Usage</small>
+#
+# ```
+# cake build
+# ```
+task 'build', 'compile source', -> build -> log ":)", green
+
+# ## *watch*
+#
+# Builds your source whenever it changes
+#
+# <small>Usage</small>
+#
+# ```
+# cake watch
+# ```
+task 'watch', 'compile and watch', -> build true, -> log ":-)", green
+
+# ## *test*
+#
+# Runs your test suite.
+#
+# <small>Usage</small>
+#
+# ```
+# cake test
+# ```
+task 'test', 'run tests', -> build -> mocha -> log ":)", green
View
@@ -7,6 +7,6 @@ group :development do
gem "compass"
gem "guard"
gem "guard-coffeescript"
- gem "guard-compass", :git => 'git@github.com:bradphelan/guard-compass.git'
+ gem "guard-compass"
gem "growl"
end
View
@@ -1,11 +1,3 @@
-GIT
- remote: git@github.com:bradphelan/guard-compass.git
- revision: f8be06158e3e3713da26a8a99bc250023b1e049f
- specs:
- guard-compass (0.0.6)
- compass (>= 0.10.5)
- guard (>= 0.2.1)
-
GEM
remote: http://rubygems.org/
specs:
@@ -31,6 +23,9 @@ GEM
guard-coffeescript (1.0.0)
coffee-script (>= 2.2.0)
guard (>= 1.1.0)
+ guard-compass (0.0.6)
+ compass (>= 0.10.5)
+ guard (>= 0.2.1)
listen (0.4.5)
rb-fchange (~> 0.0.5)
rb-fsevent (~> 0.9.1)
@@ -71,6 +66,6 @@ DEPENDENCIES
growl
guard
guard-coffeescript
- guard-compass!
+ guard-compass
sinatra
sinatra-reloader
View
@@ -1,10 +1,25 @@
require 'guard/guard'
-guard 'coffeescript' do
- watch %r{^app/.+\.coffee$}
- watch %r{^app.coffee$}
+# app
+guard 'coffeescript', :output => 'app', :bare => true do
+ watch %r{^src/app/(.+\.coffee)$}
end
+# lib
+guard 'coffeescript', :output => 'lib', :bare => true do
+ watch %r{^src/lib/(.+\.coffee)$}
+end
+
+# test
+guard 'coffeescript', :output => 'test', :bare => true do
+ watch %r{^test/coffee/app/(.+\.coffee)$}
+end
+
+guard 'coffeescript', :output => 'test', :bare => true do
+ watch %r{^test/coffee/config\.coffee$}
+end
+
+
config = File.expand_path "../resources/sass/config.rb", __FILE__
path = File.expand_path "../..", config
View
@@ -1,85 +1,40 @@
-Ext.application({
- name: "FriendlyRent",
-
- requires: [
- 'FriendlyRent.view.Navigation'
- ],
-
- // models: ["Note"],
- // stores: ["Notes"],
- // controllers: ["Notes"],
- views: ["Main", "BottomBar", "TopBar", "Map", "Navigation"],
- // "NotesList", "NoteEditor", "Navigation",
-
+//(function() {
+
+ Ext.application({
+ name: 'FriendlyRent',
+ requires: ["Ext.MessageBox"],
+ models: [],
+ stores: [],
+ controllers: [],
+ views: ["registration.landlord.why_us.Page"],
icon: {
- '57': 'resources/icons/Icon.png',
- '72': 'resources/icons/Icon~ipad.png',
- '114': 'resources/icons/Icon@2x.png',
- '144': 'resources/icons/Icon~ipad@2x.png'
+ '57': 'resources/icons/Icon.png',
+ '72': 'resources/icons/Icon~ipad.png',
+ '114': 'resources/icons/Icon@2x.png',
+ '144': 'resources/icons/Icon~ipad@2x.png'
},
-
isIconPrecomposed: true,
-
startupImage: {
- '320x460': 'resources/startup/320x460.jpg',
- '640x920': 'resources/startup/640x920.png',
- '768x1004': 'resources/startup/768x1004.png',
- '748x1024': 'resources/startup/748x1024.png',
- '1536x2008': 'resources/startup/1536x2008.png',
- '1496x2048': 'resources/startup/1496x2048.png'
+ '320x460': 'resources/startup/320x460.jpg',
+ '640x920': 'resources/startup/640x920.png',
+ '768x1004': 'resources/startup/768x1004.png',
+ '748x1024': 'resources/startup/748x1024.png',
+ '1536x2008': 'resources/startup/1536x2008.png',
+ '1496x2048': 'resources/startup/1496x2048.png'
},
-
launch: function() {
- console.log('launch');
- this.launched = true;
- this.mainLaunch();
- // Ext.fly('appLoadingIndicator').destroy();
- // Ext.Viewport.add(Ext.create('FriendlyRent.view.Main'));
-
+ var page;
+ console.log("launch");
+ page = Ext.create("FriendlyRent.view.registration.landlord.why_us.Page");
+ return Ext.Viewport.add(page);
},
-
- mainLaunch: function() {
- console.log('mainLaunch');
- // if (!device || !this.launched) { return; }
-
- I18n.defaultLocale = "da";
- I18n.locale = "da";
-
- console.log('Launched!');
-
- // Destroy the #appLoadingIndicator element
- Ext.fly('appLoadingIndicator').destroy();
-
- // // Initialize the main view
- // var notesListView = {
- // xtype: "noteslistview"
- // };
- // var noteEditorView = {
- // xtype: "noteeditorview"
- // };
-
- var navigation = Ext.create('FriendlyRent.view.Navigation');
-
- // Ext.Viewport.add([notesListView, noteEditorView]);
-
- Ext.Viewport.add(navigation);
-
- navigation.push({
- xtype: 'main'
- });
-
- // Ext.Viewport.add(Ext.create('FriendlyRent.view.Main'));
- },
-
onUpdated: function() {
- Ext.Msg.confirm(
- "Application Update",
- "This application has just successfully been updated to the latest version. Reload now?",
- function(buttonId) {
- if (buttonId === 'yes') {
- window.location.reload();
- }
- }
- );
+ return Ext.Msg.confirm("Application Update", "This application has just successfully been updated to the latest version. Reload now?", function(buttonId) {
+ if (buttonId === 'yes') {
+ return window.location.reload();
+ }
+ });
}
-});
+ });
+
+//}).call(this);
View
@@ -35,11 +35,40 @@
{
"path": "sdk/sencha-touch.js"
},
+ {
+ "path": "lib/jquery/jquery-1.7.2.js"
+ },
+ {
+ "path": "lib/jquery/jquery.rest.js"
+ },
+ {
+ "path": "lib/i18n/i18n.js"
+ },
+ // Sencha plugins
+ {
+ "path": "lib/plugins/NavBar.js"
+ },
+
+ // {
+ // "path": "lib/deftjs/deft.js" // or deft-debug.js
+ // },
+ // {
+ // "path": "lib/sencha-io/sencha-io.js"
+ // },
+ // {
+ // "path": "lib/jasmine/jasmine.js"
+ // },
+ // {
+ // "path": "lib/jasmine/jasmine-html.js"
+ // },
+ // {
+ // "path": "lib/jasmine/jasmine.console_reporter.js"
+ // },
{
"path": "app.js",
"bundle": true, /* Indicates that all class dependencies are concatenated into this file when build */
"update": "delta"
- }
+ }
],
/**
@@ -56,6 +85,9 @@
* }
*/
"css": [
+ {
+ "path": "lib/jasmine/jasmine.css"
+ },
{
"path": "resources/css/app.css",
"update": "delta"
Oops, something went wrong.

0 comments on commit a43f5ab

Please sign in to comment.