spacedeck_updates.js 712 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. SpacedeckUpdates
  3. This module contains functions dealing with Updates / Notifications.
  4. */
  5. SpacedeckUpdates = {
  6. user_notifications: [],
  7. updates_items: [],
  8. update_name_for_key: function(key) {
  9. var updates_mapping = {
  10. 'space_like': "liked",
  11. 'space_comment': "commented in",
  12. 'space_follow': "is now following",
  13. 'space_publish': "published a new version of"
  14. }
  15. var name = updates_mapping[key];
  16. if(name) return name;
  17. return key;
  18. },
  19. load_updates: function() {
  20. load_notifications(this.user, function(notifications) {
  21. this.user_notifications = notifications;
  22. });
  23. },
  24. activate_updates: function() {
  25. $location.path("/updates");
  26. }
  27. }