Skip to content

Instantly share code, notes, and snippets.

Avatar

Dion Almaer dalmaer

View GitHub Profile
View lumbar.packages.json
"packages": {
"web": {
"platforms": [ "web" ],
"combine": false
},
"native-hello-world": {
"platforms": [ "android", "iphone", "ipad" ],
"modules": [ "base", "hello-world" ],
"combine": true
}
View lumbar.helloworld.routes.json
"hello-world": {
"routes": {
"": "index",
"hello": "index"
},
"scripts": [
"js/views/hello-world",
"js/routers/hello-world.js"
],
"styles": [
View lumbar.base.json
"base": {
"scripts": [
{"src": "js/lib/zepto.js", "global": true},
{"src": "js/lib/underscore.js", "global": true},
{"src": "js/lib/backbone.js", "global": true},
{"src": "js/lib/handlebars.js", "global": true},
{"src": "js/lib/thorax.js", "global": true},
{"src": "js/lib/script.js", "global": true},
{"src": "js/lib/lumbar-loader.js", "platform": "web"},
{"src": "js/lib/lumbar-loader-standard.js", "platform": "web"},
View thorax.automodel.sample.js
Application.Router.create(module, {
index: function() {
var view = this.view('address-form');
view.setModel(addressModel);
this.setView(view);
}
});
View phoenix.sample.formserialiser.js
Phoenix.View.extend({
name: "address-form",
events: {
"submit form": "_handleSubmit"
},
_handleSubmit: function(event) {
this.serialize(event, function(attributes) {
attributes["last-name"] === "Beastridge";
attributes.address.street === "123 Chestnut";
});
View thorax.formserialiser.html
<label for="{{cid}}-last-name"/>
<input name="last-name" id="{{cid}}-last-name" value="Beastridge"/>
<label for="{{cid}}-last-name"/>
<input name="address[street]" value="123 Chestnut" id="{{cid}}-address[street]"/>
View helloworld.thorax.router.js
Application.Router.create(module, {
index: function() {
var view = this.view('hello-world/index');
this.setView(view);
}
});
View helloworld.thorax.index.js
Application.View.extend({
name: 'hello-world/index'
});
View expect.sample.js
describe('test suite', function () {
it('should expose a function', function () {
expect(add).to.be.a('function');
});
it('should do math', function () {
expect(add(1, 3)).to.equal(4);
});
});