diff options
author | Peter Kozak <spag@golwen.net> | 2013-06-27 08:56:03 +0200 |
---|---|---|
committer | Peter Kozak <spag@golwen.net> | 2013-06-27 08:56:03 +0200 |
commit | 39c06e5b4fd5a984c4f93fa48567c63848632ced (patch) | |
tree | 393ec0dbe1020d6800c94476f6c331d211ab9c30 /public | |
parent | 677e234c6b3bbec189f2caf2f237f609ab44b274 (diff) | |
parent | 1c6646bc732def369e54ef4ac576d748c6ba9c92 (diff) |
Merge branch 'develop' of github.com:amooma/GS5 into develop
Diffstat (limited to 'public')
-rw-r--r-- | public/js/app.js | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/public/js/app.js b/public/js/app.js index 6d8448a..531e4b8 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -27,10 +27,14 @@ App.SwitchboardRoute = Ember.Route.extend({ // Controller App.SwitchboardController = Ember.ObjectController.extend({ transfer_blind: function(call_id, destination) { - console.log('test') request_url = '/api/v1/calls/' + call_id + '.json'; jQuery.get(request_url, { transfer_blind: destination }); - } + }, + + transfer_attended: function(call_id, destination) { + request_url = '/api/v1/calls/' + call_id + '.json'; + jQuery.get(request_url, { transfer_attended: destination }); + } }); // Models @@ -47,6 +51,7 @@ DS.RESTAdapter.reopen({ App.Switchboard = DS.Model.extend({ switchboardEntrys: DS.hasMany('App.SwitchboardEntry'), activeCalls: DS.hasMany('App.ActiveCall'), + dispatchableIncomingCalls: DS.hasMany('App.DispatchableIncomingCall'), name: DS.attr('string') }); @@ -56,7 +61,8 @@ App.SwitchboardEntry = DS.Model.extend({ name: DS.attr('string'), path_to_user: DS.attr('string'), avatar_src: DS.attr('string'), - callstate: DS.attr('string') + callstate: DS.attr('string'), + switchable: DS.attr('boolean') }); App.ActiveCall = DS.Model.extend({ @@ -83,6 +89,30 @@ App.ActiveCall = DS.Model.extend({ }.property('b_callstate') }); +App.DispatchableIncomingCall = DS.Model.extend({ + start_stamp: DS.attr('number'), + callstate: DS.attr('string'), + b_callstate: DS.attr('string'), + destination: DS.attr('string'), + b_caller_id_number: DS.attr('string'), + + isActive: function() { + if (this.get('b_callstate') == 'ACTIVE') { + return true + } else { + return false + } + }.property('b_callstate'), + + isRinging: function() { + if (this.get('b_callstate') == 'RINGING') { + return true + } else { + return false + } + }.property('b_callstate') +}); + App.Adapter = DS.RESTAdapter.extend(); App.store = App.Store.create({ |