<commit_before>// Licensed under the Apache License, Version 2.0 (the "License"); you may not
// use this file except in compliance with the License. You may obtain a copy of
// the License at
//
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations under
// the License.

import FauxtonAPI from "./base";
import React from "react";
import ReactDOM from "react-dom";
import Backbone from "backbone";

var RouteObject = function (options) {
  this._options = options;
  this.reactComponents = {};

  this._configure(options || {});
  this.initialize.apply(this, arguments);
  this.addEvents();
};

var broadcaster = {};
_.extend(broadcaster, Backbone.Events);

RouteObject.on = function (eventName, fn) {
  broadcaster.on(eventName, fn);
};

/* How Route Object events work
 To listen to a specific route objects events:

 myRouteObject = FauxtonAPI.RouteObject.extend({
  events: {
    "beforeRender": "beforeRenderEvent"
  },

  beforeRenderEvent: function (view, selector) {
    console.log('Hey, beforeRenderEvent triggered',arguments);
  },
 });

  It is also possible to listen to events triggered from all Routeobjects.
  This is great for more general things like adding loaders, hooks.

  FauxtonAPI.RouteObject.on('beforeRender', function (routeObject, view, selector) {
    console.log('hey, this will trigger when any routeobject renders a view');
  });

 Current Events to subscribe to:
  * beforeFullRender -- before a full render is being done
  * beforeEstablish -- before the routeobject calls establish
  * AfterEstablish -- after the routeobject has run establish
  * beforeRender -- before a view is rendered
  * afterRender -- a view is finished being rendered
  * renderComplete -- all rendering is complete

*/

// Piggy-back on Backbone's self-propagating extend function
RouteObject.extend = Backbone.Model.extend;

var routeObjectOptions = ["views", "routes", "events", "roles", "crumbs", "layout", "apiUrl", "establish"];

_.extend(RouteObject.prototype, Backbone.Events, {
  // Should these be default vals or empty funcs?
  views: {},
  routes: {},
  events: {},
  crumbs: [],
  layout: "with_sidebar",
  apiUrl: null,<commit_msg>fix comment<commit_after>// Licensed under the Apache License, Version 2.0 (the "License"); you may not
// use this file except in compliance with the License. You may obtain a copy of
// the License at
//
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations under
// the License.

import FauxtonAPI from "./base";
import React from "react";
import ReactDOM from "react-dom";
import Backbone from "backbone";

var RouteObject = function (options) {
  this._options = options;
  this.reactComponents = {};

  this._configure(options || {});
  this.initialize.apply(this, arguments);
  this.addEvents();
};

var broadcaster = {};
_.extend(broadcaster, Backbone.Events);

RouteObject.on = function (eventName, fn) {
  broadcaster.on(eventName, fn);
};

/* How Route Object events work
 To listen to a specific route objects events:

 myRouteObject = FauxtonAPI.RouteObject.extend({
  events: {
    "beforeRender": "beforeRenderEvent"
  },

  beforeRenderEvent: function (view, selector) {
    console.log('Hey, beforeRenderEvent triggered',arguments);
  },
 });

  It is also possible to listen to events triggered from all Routeobjects.
  This is great for more general things like adding loaders, hooks.

  FauxtonAPI.RouteObject.on('beforeRender', function (routeObject, view, selector) {
    console.log('hey, this will trigger when any routeobject renders a view');
  });

 Current Events to subscribe to:
  * beforeFullRender -- before a full render is being done
  * beforeEstablish -- before the routeobject calls establish
  * afterEstablish -- after the routeobject has run establish
  * beforeRender -- before a view is rendered
  * afterRender -- a view is finished being rendered
  * renderComplete -- all rendering is complete

*/

// Piggy-back on Backbone's self-propagating extend function
RouteObject.extend = Backbone.Model.extend;

var routeObjectOptions = ["views", "routes", "events", "roles", "crumbs", "layout", "apiUrl", "establish"];

_.extend(RouteObject.prototype, Backbone.Events, {
  // Should these be default vals or empty funcs?
  views: {},
  routes: {},
  events: {},
  crumbs: [],
  layout: "with_sidebar",
  apiUrl: null,
{'fraction_non_alphanumeric': 0.10925397472482674, 'fraction_numerical': 0.0016306563391765185, 'mean_word_length': 4.100831600831601, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '5359496', 'n_tokens_mistral': 1358, 'n_tokens_neox': 1329, 'n_words': 518}