summaryrefslogtreecommitdiff
path: root/public/js/app.js
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-06-23 21:30:16 +0200
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-06-23 21:30:16 +0200
commit6c8df3c5457b28ab3454b87e4cafc1c5bbd22bb7 (patch)
treeab59b1d044de58198edf7f6dac742d8a52b8b6bf /public/js/app.js
parent130e77d4c9df2cca2425b63a443ea8745133d083 (diff)
Added moment.js and improved the GUI.
Diffstat (limited to 'public/js/app.js')
-rw-r--r--public/js/app.js33
1 files changed, 32 insertions, 1 deletions
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('<span class="label">' + value + '</span>');
}
});
+
+Ember.Handlebars.registerBoundHelper('from_now', function(start_stamp) {
+ moment().lang('de');
+ var day = moment.unix(start_stamp).fromNow();
+ return day;
+});
+