spacedeck-open/public/javascripts/spacedeck_updates.js

35 lines
712 B
JavaScript
Raw Normal View History

2017-04-07 01:29:05 +02:00
/*
SpacedeckUpdates
This module contains functions dealing with Updates / Notifications.
*/
SpacedeckUpdates = {
user_notifications: [],
updates_items: [],
update_name_for_key: function(key) {
var updates_mapping = {
'space_like': "liked",
'space_comment': "commented in",
'space_follow': "is now following",
'space_publish': "published a new version of"
}
var name = updates_mapping[key];
if(name) return name;
return key;
},
load_updates: function() {
load_notifications(this.user, function(notifications) {
this.user_notifications = notifications;
});
},
activate_updates: function() {
$location.path("/updates");
}
}