FollowUserActivity.js

From disqus.com, 2 Months ago, written in JavaScript, viewed 3 times. This paste is a reply to FavoriteThreadActivity.js from disqus.com - view diff
URL https://pastebin.freepbx.org/view/3daefa39 Embed
Download Paste or View Raw
  1. define('home/models/activities/FollowUserActivity',[
  2.     'home/models/Activity',
  3.     'home/activityExpander',
  4. ], function (
  5.     Activity,
  6.     activityExpander
  7. ) {
  8.     'use strict';
  9.  
  10.     /**
  11.      * User follows (the current) user
  12.      *
  13.      * Relations {
  14.      *     actor: {
  15.      *         type: 'user',
  16.      *         description: 'The user that did the following action'
  17.      *     },
  18.      *     target: {
  19.      *         type: 'user',
  20.      *         description: 'The user being followed'
  21.      *     }
  22.      * }
  23.      */
  24.     return Activity.extend({
  25.         defaults: {
  26.             verb: 'follow',
  27.         },
  28.  
  29.         initialize: function (attributes) {
  30.             this.actor = attributes.actor;
  31.             this.target = attributes.target;
  32.         },
  33.  
  34.         parseRelatedModels: function (attributes, objects) {
  35.             attributes.actor = activityExpander.buildUser(objects, attributes.actor);
  36.             attributes.target = activityExpander.buildUser(objects, attributes.object);
  37.  
  38.             return attributes;
  39.         },
  40.     });
  41. });
  42.  
  43. // https://c.disquscdn.com/next/home/js/models/activities/FollowUserActivity.js

Replies to FollowUserActivity.js rss

Title Name Language When
HighlightPostActivity.js disqus.com javascript 2 Months ago.

Reply to "FollowUserActivity.js"

Here you can reply to the paste above