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
/* | |
Ember Mixin to fullscreen a component element's. | |
Ensures that an Esc key down will cancel fullscreen. | |
*/ | |
import Em from 'ember'; | |
export default Em.Mixin.create(Em.Evented, { | |
fullscreen: 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
// Save as routes/application.js | |
import Ember from 'ember'; | |
import ApplicationRouteMixin from 'simple-auth/mixins/application-route-mixin'; | |
export default Ember.Route.extend(ApplicationRouteMixin, { | |
beforeModel: function(transition) { | |
this._super(transition); |
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
// save to app/models | |
import DS from "ember-data"; | |
export default DS.Model.extend({ | |
myProperty: DS.attr('object'); | |
}); |
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
// <rant> to actual rant | |
// (requires modern browsers) | |
var rants = document.getElementsByTagName('rant'); | |
for (i=0;i<rants.length;i++) { | |
var rant = new SpeechSynthesisUtterance(rants[i].innerHTML); | |
window.speechSynthesis.speak(rant); | |
} |
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 EmberApp = require('ember-cli/lib/broccoli/ember-app'); | |
var app = new EmberApp({ | |
// Custom settings for broccoli-assets-rev | |
// See http://www.ember-cli.com/#asset-compilation | |
fingerprint: { | |
enabled: 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
// (Rename to connection-status and add to /initializers) | |
export default { | |
name: 'connectionStatus', | |
initialize: function(container, app) { | |
app.inject('route', 'connectionStatus', 'service:connectionStatus'); | |
app.inject('controller', 'connectionStatus', 'service:connectionStatus'); | |
} | |
}; |
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
import Ember from 'ember'; | |
import DS from 'ember-data'; | |
export default DS.RESTAdapter.extend({ | |
headers: { | |
"x-api-key": "[Your OpenWeatherMap API Key]" | |
}, | |
findQuery: function(store, type, query) { |
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
import Ember from 'ember'; | |
export default Ember.ObjectController.extend({ | |
currentPathDidChange: function() { | |
this.set('path.content', this.get('currentPath')); | |
}.observes('currentPath') | |
}); |
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
// (Rename to current-user.js and place in /initializers) | |
// Ember now complains that you can't type inject a controller into a controller | |
// so use an Ember.ObjectProxy for currentUser instead. | |
// | |
// Ember.ObjectProxy allows you to set a content value, and will delegate | |
// all getters and setters to its content. | |
import DS from "ember-data"; | |
import CurrentUser from "../models/current-user"; |
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
App.ApplicationController = Ember.ObjectController.extent | |
starRatingValue: Ember.computed(-> | |
"3" | |
) |
NewerOlder