Update system packages -- will migrate system forward to CentOS 5.8. (Optional?)
$ sudo yum update
Install the EPEL Repo:
function cloneFromView(obj) { | |
if (null == obj || "object" != typeof obj) return obj; | |
var copy = Ember.View.create({ | |
templateName: obj.templateName | |
}); | |
for (var attr in obj) { | |
if (obj.hasOwnProperty(attr)) copy[attr] = obj[attr]; | |
} | |
return copy; | |
} |
window.App = Ember.Application.create() | |
App.Focusable = Ember.Mixin.create | |
# Don't let events spoil your Kool-Aid! | |
# Let's get these out of the way by turning them | |
# into a magical property: | |
focused: false | |
focusIn: (event) -> @set 'focused', true | |
focusOut: (event) -> @set 'focused', false |
// vim: set ft=javascript sw=4 : | |
window.App = Ember.Application.create({ | |
ApplicationController: Ember.Controller.extend(), | |
ApplicationView: Ember.View.extend({ | |
templateName: 'application', | |
click: function(event) { | |
console.log('appView saw a click'); |
/*jshint asi:true globalstrict:true*/ | |
'use strict'; | |
let { Cc, Ci } = require('chrome') | |
let ioService = Cc['@mozilla.org/network/io-service;1']. | |
getService(Ci.nsIIOService) | |
let resourceHandler = ioService.getProtocolHandler('resource'). | |
QueryInterface(Ci.nsIResProtocolHandler) |
/*** Template Markup | |
{{#tree my_tree}} | |
The _id of this node is {{_id}}. | |
{{/tree}} | |
***/ | |
/*** Template variable ***/ |
Ember.Route.reopen({ | |
enter: function(router) { | |
this._super(router); | |
if(this.get('isLeafRoute')) { | |
var path = this.absoluteRoute(router); | |
mixpanel.track('page viewed', {'page name' : document.title, 'url' : path}); | |
_gaq.push(['_trackPageview', path]); | |
} | |
} | |
}); |
App.PostRoute = Ember.Route.extend({ | |
serialize: function(router, post) { | |
// what should the state be serialized as | |
return { post_id: post.get('id') }; | |
}, | |
setupControllers: function(router, post) { | |
// which content should be used | |
this.set('controller.content', post); | |
}, |
App.Router.map(function(match) { | |
match("/posts/:post_id").to("post"); | |
}); | |
App.PostRoute = Ember.Route.extend({ | |
// default implementation | |
deserialize: function(router, params) { | |
return App.Post.find(params.post_id); | |
}, |
Many existing JSON APIs are not consistent between types. As JSON endpoints grew organically and were built by different engineers at different times, the style in which records are represented can vary wildly.
Historically, we have asked adapter authors to rely on the fact that the type of record is
provided to all adapter hooks (either by passing a type
argument, or by passing a record