This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data: { | |
data: dependencies: { | |
data: phoenix-build: '~1.0', | |
data: grunt-bg-shell: '*', | |
data: grunt-cli: '0.1.6', | |
data: jake: '*', | |
data: thorax-inspector: '0.2.4', | |
data: grunt: '~0.4', | |
data: express: '~3' | |
data: }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var async = require('async'), | |
_ = require('underscore'); | |
var obj = { | |
key: 'value' | |
}; | |
async.series(_.map(obj, function(value, key) { | |
return function(next) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function() { | |
var Application = window.Application = new Thorax.ViewController({ | |
template: "{{layout}}" | |
}); | |
Backbone.history.start(); | |
Application.render(); | |
$('body').append(Application.el); | |
var Todos = Thorax.Collections.Todos = Thorax.Collection.extend({}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function() { | |
var Application = window.Application = new Thorax.ViewController({ | |
template: "{{layout}}" | |
}); | |
Backbone.history.start(); | |
Application.render(); | |
$('body').append(Application.el); | |
var Todos = Application.Collections.Todos = Thorax.Collection.extend({}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var root = this, | |
Backbone = root.Backbone, | |
Handlebars = root.Handlebars, | |
Thorax = root.Thorax, | |
_ = root._, | |
$ = root.$, | |
paramMatcher = /:(\w+)/g, | |
callMethodAttributeName = 'data-call-method'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function() { | |
var Application = window.Application = new Thorax.Application(); | |
Application.start(); | |
$('body').append(Application.el); | |
var Todos = Application.collection('todos', {}); | |
var Cats = Application.collection('cats', {}); | |
Cats.instance = new Cats([ | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var root = this, | |
Backbone = root.Backbone, | |
Handlebars = root.Handlebars, | |
_ = root._, | |
$ = root.$, | |
Thorax; | |
//support zepto.forEach on jQuery |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var root = this, | |
Backbone = root.Backbone, | |
Handlebars = root.Handlebars, | |
Thorax = root.Thorax, | |
_ = root._, | |
$ = root.$, | |
_fetch = Backbone.Collection.prototype.fetch, | |
_reset = Backbone.Collection.prototype.reset, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# TODO: | |
# - fix module loading problem when creating new modules (can't visit route on freshly created module) | |
# - persist location between editor and application window | |
# - needs to work on reload | |
# - needs to work on editor close | |
prefix = '/admin' | |
savedEditor = localStorage?.getItem 'thorax-admin-editor' | |
window.Application = Application = new Thorax.Application editor: savedEditor or 'browser' | |
socket = io.connect window.location.protocol + '//' + window.location.host |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function(server, secureServer, argv) { | |
if (argv.admin) { | |
var path = require('path'), | |
_ = require('underscore'), | |
fs = require('fs'), | |
exec = require('child_process').exec, | |
pathPrefix = '/admin', | |
io = require('socket.io'), | |
mkdirp = require('mkdirp'); |