<commit_before>(function() {
  var Likes = function() {
    var self = this;

    this.subscribe("widget/ready", function(evt, element) {
      $.extend(self, {
        loadingImage: $("<img/>", { src: "/images/ajax-loader.gif" }),
        expander: element.find("a.expand_likes")
      });

      self.expander.click(self.expandLikes);
    });

    this.expandLikes = function(evt) {
      evt.preventDefault();

      var likesList = self.expander.siblings(".likes_list");
      if(likesList.children().length == 0) {
        self.loadingImage.appendTo(likesList.parent());
        $.get(self.expander.href, function(data) {
          self.loadingImage.fadeOut(100, function() {
            likesList.html(data)
              .fadeToggle(100);
          });
        });
      }
      else {
        likesList.fadeToggle(100);
      }
    };
  };

  Diaspora.Widgets.Likes = Likes;
})();<commit_msg>Fixing expand likes ajax call that was broken. Related jasmine still red.<commit_after>(function() {
  var Likes = function() {
    var self = this;

    this.subscribe("widget/ready", function(evt, element) {
      $.extend(self, {
        loadingImage: $("<img/>", { src: "/images/ajax-loader.gif" }),
        expander: element.find("a.expand_likes")
      });

      self.expander.click(self.expandLikes);
    });

    this.expandLikes = function(evt) {
      evt.preventDefault();

      var likesList = self.expander.siblings(".likes_list");
      if(likesList.children().length == 0) {
        self.loadingImage.appendTo(likesList.parent());
        $.get(self.expander.attr('href'), function(data) {
          self.loadingImage.fadeOut(100, function() {
            likesList.html(data)
              .fadeToggle(100);
          });
        });
      }
      else {
        likesList.fadeToggle(100);
      }
    };
  };

  Diaspora.Widgets.Likes = Likes;
})();
{'fraction_non_alphanumeric': 0.16488222698072805, 'fraction_numerical': 0.010706638115631691, 'mean_word_length': 2.3256227758007118, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1669356', 'n_tokens_mistral': 613, 'n_tokens_neox': 592, 'n_words': 85}