Untitled

From Ivory Earthworm, 12 Years ago, written in Plain Text, viewed 2 times.
URL https://paste.blessuren.de/view/384e0372 Embed
Download Paste or View Raw
  1.     Pump.FollowersUserContent = Pump.TemplateView.extend({
  2.         templateName: 'user-content-followers',
  3.         modelName: 'followers',
  4.         parts: ["people-stream",
  5.                 "major-person",
  6.                 "profile-responses"],
  7.         subs: {
  8.             "#people-stream": {
  9.                 attr: "peopleStreamView",
  10.                 subView: "PeopleStreamView",
  11.                 subOptions: {
  12.                     model: "followers"
  13.                 }
  14.             }
  15.         },  
  16.              events: {
  17.             "click #followall": "FollowAll"
  18.         },
  19.         "FollowAll": function () {
  20.             var view = this,
  21.             profile = view.options.data.profile.toJSON();
  22.             url = profile.followers.url;
  23.             nickname = profile.displayName;
  24.             Pump.areYouSure("Follow all "+nickname+" followers? This will take a few seconds and you have to reload the page manually!", function(err, sure) {
  25.                 if (err) {
  26.                     view.showError(err);
  27.                 } else if (sure) {
  28.                     var user = Pump.User.unique({
  29.                         nickname: nickname,
  30.                         url: url
  31.                     }),
  32.                         followers = Pump.PeopleStream.unique({
  33.                             url: url
  34.                         });
  35.                     follower = followers.toJSON();
  36.                     _.each(follower.items, function (user) {
  37.                         act = {
  38.                             verb: "follow",
  39.                             object: user
  40.                         };
  41.                         Pump.newMinorActivity(act, function (err, act) {
  42.                             Pump.addMinorActivity(act);
  43.                         });
  44.                     });
  45.                     //window.location.reload();
  46.                 }
  47.             });
  48.         }
  49.     });
  50.  

Reply to "Untitled"

Here you can reply to the paste above