<commit_before>/**
  This view handles rendering of a user's stream

  @class UserStreamView
  @extends Discourse.View
  @namespace Discourse
  @uses Discourse.Scrolling
  @module Discourse
**/
Discourse.UserStreamView = Ember.CollectionView.extend(Discourse.Scrolling, {
  loading: false,
  elementId: 'user-stream',
  content: Em.computed.alias('controller.stream.content'),
  itemViewClass: Ember.View.extend({ templateName: 'user/stream_item' }),

  scrolled: function(e) {
    var eyeline = this.get('eyeline');
    if (eyeline) { eyeline.update(); }
  },

  loadMore: function() {
    var userStreamView = this;
    if (userStreamView.get('loading')) { return; }

    var stream = this.get('stream');
    stream.findItems().then(function() {
      userStreamView.set('loading', false);
      userStreamView.get('eyeline').flushRest();
    });
  },

  willDestroyElement: function() {
    this.unbindScrolling();
  },

  didInsertElement: function() {
    console.log(this.get('content'));
    this.bindScrolling();

    var eyeline = new Discourse.Eyeline('#user-stream .item');
    this.set('eyeline', eyeline);

    var userStreamView = this;
    eyeline.on('sawBottom', function() {
      userStreamView.loadMore();
    });
  }
});


Discourse.View.registerHelper('userStream', Discourse.UserStreamView);<commit_msg>remove console.log<commit_after>/**
  This view handles rendering of a user's stream

  @class UserStreamView
  @extends Discourse.View
  @namespace Discourse
  @uses Discourse.Scrolling
  @module Discourse
**/
Discourse.UserStreamView = Ember.CollectionView.extend(Discourse.Scrolling, {
  loading: false,
  elementId: 'user-stream',
  content: Em.computed.alias('controller.stream.content'),
  itemViewClass: Ember.View.extend({ templateName: 'user/stream_item' }),

  scrolled: function(e) {
    var eyeline = this.get('eyeline');
    if (eyeline) { eyeline.update(); }
  },

  loadMore: function() {
    var userStreamView = this;
    if (userStreamView.get('loading')) { return; }

    var stream = this.get('stream');
    stream.findItems().then(function() {
      userStreamView.set('loading', false);
      userStreamView.get('eyeline').flushRest();
    });
  },

  willDestroyElement: function() {
    this.unbindScrolling();
  },

  didInsertElement: function() {
    this.bindScrolling();

    var eyeline = new Discourse.Eyeline('#user-stream .item');
    this.set('eyeline', eyeline);

    var userStreamView = this;
    eyeline.on('sawBottom', function() {
      userStreamView.loadMore();
    });
  }
});


Discourse.View.registerHelper('userStream', Discourse.UserStreamView);
{'fraction_non_alphanumeric': 0.15055406954528086, 'fraction_numerical': 0.0, 'mean_word_length': 4.015325670498084, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7248846', 'n_tokens_mistral': 830, 'n_tokens_neox': 811, 'n_words': 151}