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
// Place in project root where jboss and ATG folder are | |
// `npm install grunt-contrib-copy` | |
// `npm install grunt-contrib-watch` | |
// grunt | |
module.exports = function(grunt) { | |
grunt.loadNpmTasks('grunt-contrib-copy'); | |
grunt.loadNpmTasks('grunt-contrib-watch'); | |
grunt.initConfig({ |
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
// Place in project root where jboss and ATG folder are | |
// `npm install grunt-contrib-copy` | |
// `npm install grunt-contrib-watch` | |
// grunt | |
module.exports = function(grunt) { | |
grunt.loadNpmTasks('grunt-contrib-copy'); | |
grunt.loadNpmTasks('grunt-contrib-watch'); | |
grunt.initConfig({ |
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
{ | |
"application": { | |
"name": "Application", | |
"module": "base" | |
}, | |
"modules": { | |
"base": { | |
"scripts": [ | |
{"src": "bower_components/underscore/underscore.js", "global": true}, | |
{"src": "bower_components/jquery/jquery.js", "global": true}, |
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
Handlebars.registerHelper('special', function(arg, options) { | |
if (condition(arg)) { | |
return options.fn(this); | |
} else { | |
return options.inverse(this); | |
} | |
}); | |
{{#special arg}} |
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
## Old View Style | |
//js | |
Thorax.View.extend({ | |
name: 'view-name' | |
}); | |
Thorax.Views['view-name'] |
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
class AuthenticatedController < ApplicationController | |
before_filter :authenticate_person!, :is_admin | |
private | |
def is_admin | |
@is_admin = current_person.is_admin | |
end | |
end |
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
define([ | |
'collections/todos', | |
'views/todos' | |
], function(TodosCollection, TodosView) { | |
new (Backbone.Router.extend({ | |
routes: { | |
'': 'index' | |
}, | |
index: function() { | |
var collection = new TodosCollection(); |
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
//Colin working on issue #159 | |
it('should render div tag even if div tag is the last element before the closing collection helper', function(){ | |
var dummyCollection = new Thorax.Collection([{key: 'value'}]) | |
var view = new Thorax.View({ | |
dummyCollection: dummyCollection, | |
template: Handlebars.compile('{{#collection dummyCollection}}<div> </div>{{/collection}}') | |
expect(view.$('div').length).to.equal('1') // or get an array of the html and to.not.be.empty on it, maybe, or convert the innerHTML to a string and check if it contains the '/' character - would try these strategies next to try to get false |
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
Application.View.extend({ | |
name: "some-view", | |
events: { | |
"submit form": function(event) { | |
event.stopPropagation(); | |
$('error-messages-selector').empty(); | |
this.serialize(function(attr) { | |
}); | |
}, |
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: { | |
data: subdomain: 'eastridge-tweb-r', | |
data: dependencies: { | |
data: thorax-inspector: '0.2.4', | |
data: grunt: '~0.4', | |
data: grunt-cli: '0.1.6', | |
data: grunt-bg-shell: '*', | |
data: express: '~3', | |
data: jake: '*', |
NewerOlder