<commit_before>Andamio.Application = function (options) {
  _.extend(this, options);
  this.vent = _.extend({}, Backbone.Events);
};

_.extend(Andamio.Application.prototype, Backbone.Events, Andamio.Region, {
  container: 'body',

  el: 'main',

  // starts the app
  start: function () {
    this._initRouter();
    this._initAppView();
    this.initialize.apply(this, arguments);
    this.listenTo(this.router, 'navigate', this.show);
  },

  initialize: function () {},

  // initialize app router
  _initRouter: function () {
    this.router = new this.router();
  },

  // initialize app view
  _initAppView: function () {
    this.appView = new this.appView({el: this.container});
    this.appView.render();
  },

  onShow: function () {
    this.appView.trigger('navigate', this.currentView);
  }
});

Andamio.Application.extend = Andamio.extend;<commit_msg>use vent object as pubsub, change default selectors and make router load default rout by changing the url<commit_after>Andamio.Application = function (options) {
  _.extend(this, options);
  this.vent = _.extend({}, Backbone.Events);
};

_.extend(Andamio.Application.prototype, Backbone.Events, Andamio.Region, {
  // selector where the main appview will be rendered
  container: 'main',

  // data-region where every page will be displayed
  el: 'page',

  // starts the app
  start: function (options) {
    _.extend(this, options);
    this._initRouter();
    this.initialize.apply(this, arguments);
    this._initAppView();
    this.listenTo(this.router, 'navigate', this.show);
  },

  initialize: function () {},

  // initialize app router
  _initRouter: function () {
    this.router = new this.router();
    Backbone.history.start();
    // navigate to default route
    var defaultRoute = _.findWhere(this.router.routes, {default: true});
    if (defaultRoute && !Backbone.history.fragment) {
      this.router.navigate(defaultRoute.url, {trigger: true, replace: true});
    }
  },

  // initialize app view
  _initAppView: function () {
    this.appView = new this.appView({el: this.container});
    this.appView.render();
  },

  onShow: function () {
    this.vent.trigger('navigate', this.currentView);
  }
});

Andamio.Application.extend = Andamio.extend;
{'fraction_non_alphanumeric': 0.1476510067114094, 'fraction_numerical': 0.0, 'mean_word_length': 3.6198347107438016, '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': '2198067', 'n_tokens_mistral': 696, 'n_tokens_neox': 683, 'n_words': 158}