This file contains hidden or 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
| export default Ember.Route.extend({ | |
| model: function() { | |
| return Ember.RSVP.hash({ | |
| messages: this.store.findAll('chat-message'), | |
| }); | |
| }, | |
| }); |
This file contains hidden or 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.Component.extend({ | |
| scrollToBottom: function() { | |
| console.log('DID INSERT ELEMENT NOW'); | |
| }.on('didInsertElement'), | |
| }); |
This file contains hidden or 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.Component.extend({ | |
| tagName: 'div', | |
| classNames: ['image-wrap'], | |
| classNameBindings: ['isPortrait:portrait:landscape', 'isLoaded:loaded'], | |
| attributeBindings: ['width', 'height'], | |
| isLoaded: false, | |
| isPortrait: false, |
This file contains hidden or 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
| _startHeartBeats() { | |
| var _this = this; | |
| var interval = setInterval(function() { | |
| Ember.run.schedule('backgroundSocket', _this, function() { | |
| _this._send(heartBeatMessage); | |
| }); | |
| }, 5000); | |
| }, |
This file contains hidden or 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 User from 'online-mobile/models/user'; | |
| export default Ember.Service.extend({ | |
| store: Ember.inject.service('store'), | |
| // websocket status. | |
| isConnected: false, |
This file contains hidden or 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.Route.extend({ | |
| actions: { | |
| loading(transition, originRoute) { | |
| console.log('XXXXX Loading! XXXXX'); | |
| }, | |
| }, | |
| }); |
This file contains hidden or 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
| // The other user we are chatting with. | |
| otherUser: function() { | |
| console.log('HELLO WORLD'); | |
| return this.get('store').peekRecord('user', 'other'); | |
| }.property(), | |
This file contains hidden or 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
| export default Component.extend({ | |
| tagName: 'time', | |
| tick: function() { | |
| this.nextTick = run.later(this, function() { | |
| this.notifyPropertyChange('timeago'); | |
| this.tick(); | |
| }, 1000); | |
| }.on('init'), |
This file contains hidden or 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'; | |
| const { Service, inject, run } = Ember; | |
| const TWO_HOURS = 2 * 60 * 60 * 1000; | |
| const TWO_DAYS = 2 * 24 * 60 * 60 * 1000; | |
| /** | |
| * Ticking clock service. | |
| * We use this service to sync all our momentjs udpates every second |