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
Cx.Router.map () -> | |
@route 'tradeIndex', {path: '/'} | |
@route 'tradePair', {path: '/trade/:urlSlug'} | |
Cx.TradePairRoute = Ember.Route.extend | |
model: (params) -> | |
@store.find('tradePair', {urlSlug: params.urlSlug}) |
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
balance: (-> | |
@store.find('balance', {currency: @get('id')}).then (data) -> | |
return data.get('firstObject') | |
).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
Cx.OwnOrdersComponent = Ember.Component.extend | |
orders: (-> | |
store = @get('targetObject.store') | |
store.find 'order', | |
user: @get('user').get('id') | |
tradePair: @get('pair').get('id') | |
complete: false | |
cancelled: false | |
).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
Cx.ChartBoxComponent = Ember.Component.extend | |
init: -> | |
groupingUnits = [ | |
['minute',[5, 10, 15, 30]] | |
['hour',[1, 2, 3, 4, 6, 8, 12]] | |
['day',[1,2,3]] | |
['week',[1,2]] | |
['month',[1, 3, 6]] | |
['year',null] | |
] |
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
Cx.TestRoute = Ember.Route.extend | |
setupController: (c, m) -> | |
@chart_itemsChannel = pusher.subscribe("chartItems-#{pair.get 'id'}") | |
@chart_itemsChannel.bind 'chartItem#update', (chart_item) => | |
console.log chart_item | |
store = @get('store') | |
store.push 'chartItem', chart_item | |
@set('store', store) | |
... |
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
Cx.RecentTradesComponent = Ember.Component.extend | |
ctrl: Ember.ArrayController.create | |
sortProperties: ['created_at'] | |
sortAscending: false | |
sortedTrades: (-> | |
proxy = Ember.ArrayProxy.create() | |
@ctrl.set('content', @get('trades')) | |
proxy.set('content', @ctrl.get('arrangedContent')) | |
proxy | |
).property('trades') |
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
@h.setupPusher = (store, model, key) -> | |
manyHash = (d) -> | |
h = {} | |
h[model.pluralize()] = [d] | |
return h | |
c = pusher.subscribe(key) | |
c.bind "#{model}#new", (o) -> | |
Ember.run.later -> | |
return if store.getById(model, o.id) |
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
Cx.User = DS.Model.extend | |
email: DS.attr('string') | |
nickname: DS.attr('string') | |
createdAt: DS.attr('date') | |
notifications: DS.hasMany('notification', {async: true}) | |
Cx.Notification = DS.Model.extend | |
user: DS.belongsTo('user') | |
title: DS.attr('string') | |
body: DS.attr('string') |
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
Cx.ApplicationRoute = Ember.Route.extend | |
model: -> | |
Ember.RSVP.hash( | |
messages: @store.findAll 'message' | |
currencies: @store.findAll 'currency' | |
tradePairs: @store.findAll 'tradePair' | |
).then (m) -> m | |
setupController: (c, m) -> | |
@controllerFor('tradePairs').set 'model', m.tradePairs | |
@controllerFor('currencies').set 'model', m.currencies |
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
DEPOSITS/WITHDRAWALS: | |
{ "_id" : "8EoGDgYM9SQ6YMu8x", "address" : "114sdunbXqgZxUsGXaeMePixxsg4zDc6yW", "amount" : -20000000, "category" : "send", "comment" : null, "confirmations" : 0, "currId" : "MAN2xrJTheM6P35Jx", "time" : 1378941452, "txid" : "eb0af36a8272cb6d9da63af3b4699691932cc258b0ba45351c7addd8aba5a228", "userId" : "uBptorh4528e3opwi" } | |
{ "_id" : "AptKP5K2Ny2RZpjMH", "address" : "1gVKFXTg1gW7vjddcDnYGR1WeQZ1Lixm6", "amount" : 1585831, "category" : "receive", "comment" : null, "confirmations" : 3, "currId" : "MAN2xrJTheM6P35Jx", "time" : 1378698366, "txid" : "f347cf29a24dc22d2e67db5d8e61e60bf60931d5cbfe00e783b309bf85990c7f", "userId" : "uBptorh4528e3opwi", "walletId" : "e969LfFGaygx46CSQ" } | |
{ "_id" : "LyZ8fbvR2XekGhGtF", "address" : "1gVKFXTg1gW7vjddcDnYGR1WeQZ1Lixm6", "amount" : 5137155, "category" : "receive", "comment" : null, "confirmations" : 3, "currId" : "MAN2xrJTheM6P35Jx", "time" : 1378701686, "txid" : "68a3fa632d98e2b5f2de9a35272065906bb4073592d24a3bd8999d502f36fac2", "userId" : "uBptorh452 |