{"size": 950, "ext": "js", "max_stars_repo_path": "public/javascripts/app/views/build/log.js", "max_stars_repo_name": "drnic/travis-ci", "max_stars_repo_stars_event_min_datetime": "2019-06-27T12:45:51.000Z", "max_stars_repo_stars_event_max_datetime": "2019-06-27T12:45:51.000Z", "max_issues_repo_path": "public/javascripts/app/views/build/log.js", "max_issues_repo_name": "drnic/travis-ci", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "public/javascripts/app/views/build/log.js", "max_forks_repo_name": "drnic/travis-ci", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 26.3888888889, "max_line_length": 69, "alphanum_fraction": 0.5978947368}
Travis.Views.Build.Log = Backbone.View.extend({
  initialize: function() {
    _.bindAll(this, 'render', 'setLog', 'appendLog');
    this.template = Travis.templates['build/log'];
    if(this.model) this.attachTo(this.model);
  },
  detach: function() {
    if(this.model) {
      this.model.unbind('change:log', this.setLog);
      this.model.unbind('append:log', this.appendLog);
      delete this.model;
    }
  },
  attachTo: function(model) {
    this.detach();
    this.model = model;
    this.model.bind('change:log', this.setLog)
    this.model.bind('append:log', this.appendLog)
  },
  render: function() {
    this.el = $(this.template({ log: this.model.get('log') || '' }));
    this.el.filterLog();
    return this;
  },
  setLog: function() {
    this.el.text(this.model.get('log') || '');
    this.el.filterLog();
  },
  appendLog: function(chars) {
    if(chars) {
      this.el.append(chars);
      this.el.filterLog();
    }
  }
});
