<commit_before>var config = require("../config/config");
var Util = require("../helpers/Util");

var Link = require("react-router").Link;
var Mousetrap = require("mousetrap");
require("mousetrap/plugins/global-bind/mousetrap-global-bind");
var React = require("react/addons");
var RouteHandler = require("react-router").RouteHandler;

var AboutModalComponent = require("../components/modals/AboutModalComponent");
var AppModalComponent = require("../components/modals/AppModalComponent");
var NavTabsComponent = require("../components/NavTabsComponent");

var AppsActions = require("../actions/AppsActions");
var DeploymentActions = require("../actions/DeploymentActions");
var QueueActions = require("../actions/QueueActions");

var tabs = require("../constants/tabs");

var Marathon = React.createClass({
  displayName: "Marathon",

  contextTypes: {
    router: React.PropTypes.func
  },

  getInitialState: function () {
    return {
      activeAppId: null,
      activeAppView: null,
      activeTabId: null,
      modal: null
    };
  },

  componentDidMount: function () {
    var router = this.context.router;

    this.onRouteChange();

    Mousetrap.bindGlobal("esc", function () {
      if (this.state.modal != null) {
        this.handleModalDestroy();
      }
    }.bind(this));

    Mousetrap.bind("c", function () {
      router.transitionTo("newapp");
    }, "keyup");

    Mousetrap.bind("g a", function () {
      if (this.state.modal == null) {
        router.transitionTo("apps");
      }
    }.bind(this));

    Mousetrap.bind("g d", function () {
      if (this.state.modal == null) {
        router.transitionTo("deployments");
      }
    }.bind(this));

    Mousetrap.bind("g v", function () {
      Util.alert(`The UI version is ${config.version}`);
    });

    Mousetrap.bind("shift+,", function () {
      router.transitionTo("about");
    });

    this.startPolling();
  },

  componentWillReceiveProps: function () {
    this.onRouteChange();
  },

  onRouteChange: function () {
    var router = this.context.router;
<commit_msg>Fixing keyboard shortcuts for modals<commit_after>var config = require("../config/config");
var Util = require("../helpers/Util");

var Link = require("react-router").Link;
var Mousetrap = require("mousetrap");
require("mousetrap/plugins/global-bind/mousetrap-global-bind");
var React = require("react/addons");
var RouteHandler = require("react-router").RouteHandler;

var AboutModalComponent = require("../components/modals/AboutModalComponent");
var AppModalComponent = require("../components/modals/AppModalComponent");
var NavTabsComponent = require("../components/NavTabsComponent");

var AppsActions = require("../actions/AppsActions");
var DeploymentActions = require("../actions/DeploymentActions");
var QueueActions = require("../actions/QueueActions");

var tabs = require("../constants/tabs");

var Marathon = React.createClass({
  displayName: "Marathon",

  contextTypes: {
    router: React.PropTypes.func
  },

  getInitialState: function () {
    return {
      activeAppId: null,
      activeAppView: null,
      activeTabId: null,
      modal: null
    };
  },

  componentDidMount: function () {
    var router = this.context.router;

    this.onRouteChange();

    Mousetrap.bindGlobal("esc", function () {
      if (this.state.modal != null) {
        this.handleModalDestroy();
      }
    }.bind(this));

    Mousetrap.bind("c", function () {
      router.transitionTo(router.getCurrentPathname(), {}, {modal: "newapp"});
    }, "keyup");

    Mousetrap.bind("g a", function () {
      if (this.state.modal == null) {
        router.transitionTo("apps");
      }
    }.bind(this));

    Mousetrap.bind("g d", function () {
      if (this.state.modal == null) {
        router.transitionTo("deployments");
      }
    }.bind(this));

    Mousetrap.bind("g v", function () {
      Util.alert(`The UI version is ${config.version}`);
    });

    Mousetrap.bind("shift+,", function () {
      router.transitionTo(router.getCurrentPathname(), {}, {modal: "about"});
    });

    this.startPolling();
  },

  componentWillReceiveProps: function () {
    this.onRouteChange();
  },

  onRouteChange: function () {
    var router = this.context.router;

{'fraction_non_alphanumeric': 0.1673363271094304, 'fraction_numerical': 0.0, 'mean_word_length': 3.4594309799789253, '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': '496628', 'n_tokens_mistral': 1307, 'n_tokens_neox': 1267, 'n_words': 232}