From 6c8df3c5457b28ab3454b87e4cafc1c5bbd22bb7 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Sun, 23 Jun 2013 21:30:16 +0200 Subject: Added moment.js and improved the GUI. --- public/js/app.js | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) (limited to 'public/js/app.js') diff --git a/public/js/app.js b/public/js/app.js index da887c4..6d8448a 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -64,7 +64,23 @@ App.ActiveCall = DS.Model.extend({ callstate: DS.attr('string'), b_callstate: DS.attr('string'), destination: DS.attr('string'), - b_caller_id_number: 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(); @@ -108,6 +124,14 @@ App.Call = DS.Model.extend({ } else { return false } + }.property('b_callstate'), + + isRinging: function() { + if (this.get('b_callstate') == 'RINGING') { + return true + } else { + return false + } }.property('b_callstate') }); @@ -122,3 +146,10 @@ Ember.Handlebars.registerBoundHelper('show_callstate', function(value) { return new Handlebars.SafeString('' + value + ''); } }); + +Ember.Handlebars.registerBoundHelper('from_now', function(start_stamp) { + moment().lang('de'); + var day = moment.unix(start_stamp).fromNow(); + return day; +}); + -- cgit v1.2.3