From 3b27a5d45b12f6bac65da2a8e17387bfda42a2f1 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Thu, 20 Jun 2013 19:02:50 +0200 Subject: Update Ember, Ember-Data and Handlebars. --- public/js/app.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'public/js/app.js') diff --git a/public/js/app.js b/public/js/app.js index 893b4af..51b3b71 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -38,9 +38,7 @@ App.SwitchboardController = Ember.ObjectController.extend({ }); // Models -App.Store = DS.Store.extend({ - revision: 12 -}); +App.Store = DS.Store.extend(); DS.RESTAdapter.configure("plurals", { switchboard_entry: "switchboard_entries" -- cgit v1.2.3 From 4ce04ec03bc8f362d48ded43833645e7f454cb5c Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Fri, 21 Jun 2013 15:07:44 +0200 Subject: Added blind transfer functionality for the switchboard. --- public/js/app.js | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'public/js/app.js') diff --git a/public/js/app.js b/public/js/app.js index 51b3b71..da887c4 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -1,5 +1,4 @@ App = Ember.Application.create({ - LOG_TRANSITIONS: true, rootElement: '#emberjs-container', // Reload the switchboard every x milliseconds @@ -9,11 +8,6 @@ App = Ember.Application.create({ var switchboard = App.Switchboard.find(switchboard_id); setInterval(function() { switchboard.reload(); - - // var switchboard_entries = App.SwitchboardEntry.find(); - // switchboard_entries.forEach(function(switchboard_entry) { - // switchboard_entry.reload(); - // }); }, reload_interval); } } @@ -32,8 +26,10 @@ App.SwitchboardRoute = Ember.Route.extend({ // Controller App.SwitchboardController = Ember.ObjectController.extend({ - blind_transfer: function() { - console.log('transfer') + transfer_blind: function(call_id, destination) { + console.log('test') + request_url = '/api/v1/calls/' + call_id + '.json'; + jQuery.get(request_url, { transfer_blind: destination }); } }); @@ -52,8 +48,6 @@ App.Switchboard = DS.Model.extend({ switchboardEntrys: DS.hasMany('App.SwitchboardEntry'), activeCalls: DS.hasMany('App.ActiveCall'), name: DS.attr('string') - - }); App.SwitchboardEntry = DS.Model.extend({ @@ -114,8 +108,7 @@ App.Call = DS.Model.extend({ } else { return false } - }.property('b_callstate') - + }.property('b_callstate') }); App.store.adapter.serializer.configure(App.PhoneNumber, { sideloadAs: 'phone_numbers' }); @@ -125,5 +118,7 @@ Ember.Handlebars.registerBoundHelper('avatar_img', function(value) { }); Ember.Handlebars.registerBoundHelper('show_callstate', function(value) { - return new Handlebars.SafeString('' + value + ''); + if (value) { + return new Handlebars.SafeString('' + value + ''); + } }); -- cgit v1.2.3