Skip to content

Instantly share code, notes, and snippets.

// 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({
// 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({
{
"application": {
"name": "Application",
"module": "base"
},
"modules": {
"base": {
"scripts": [
{"src": "bower_components/underscore/underscore.js", "global": true},
{"src": "bower_components/jquery/jquery.js", "global": true},
Handlebars.registerHelper('special', function(arg, options) {
if (condition(arg)) {
return options.fn(this);
} else {
return options.inverse(this);
}
});
{{#special arg}}
## Old View Style
//js
Thorax.View.extend({
name: 'view-name'
});
Thorax.Views['view-name']
class AuthenticatedController < ApplicationController
before_filter :authenticate_person!, :is_admin
private
def is_admin
@is_admin = current_person.is_admin
end
end
define([
'collections/todos',
'views/todos'
], function(TodosCollection, TodosView) {
new (Backbone.Router.extend({
routes: {
'': 'index'
},
index: function() {
var collection = new TodosCollection();
//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
Application.View.extend({
name: "some-view",
events: {
"submit form": function(event) {
event.stopPropagation();
$('error-messages-selector').empty();
this.serialize(function(attr) {
});
},
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: '*',