<commit_before>var React = require('react');
var Step = require('./step');
var NavigationButton = require('./components/navigationButton');
var NavigationBeads = require('./components/navigationBeads');
var SlideReel = require('./components/slideReel');
var classNames = require('classnames');

var EventListener = require('react-event-listener').default;

require('./react-step-wizard.scss');


var StepWizard = React.createClass({
  statics: {
    Step: Step,
  },

  getInitialState: function() {
    return {
      currentStepIndex: 0,
    };
  },

  getDefaultProps: function() {
    return {
      loopBeginning: true
    };
  },

  propTypes: {
    loopBeginning: React.PropTypes.bool
  },

  consts: {
    hideableClass: "sw-hidable",
  },

  componentWillMount: function() {
    console.log('mount ')
    this.validateChildren();
  },

  componentDidMount: function() {
    // window.addEventListener('popstate', this.navigateBack.bind(this))
    this.onMountHistoryFix();
  },

  onMountHistoryFix: function() {
    //IE 9 doesn't support altering history (otherwise IE 6 wouldn't have happened)
    if(!window.history.pushState) {
      return;
    }

    //This will reset the history when you navigate away from thise page and hit back
    if(window.history.state && window.history.state.currentStepIndex > 0) {
      window.history.go(-window.history.state.currentStepIndex);
      return;
    }

    window.history.replaceState({currentStepIndex: 0}, 'Step 0');
  },

  componentWillUnmount: function() {<commit_msg>removed console.log<commit_after>var React = require('react');
var Step = require('./step');
var NavigationButton = require('./components/navigationButton');
var NavigationBeads = require('./components/navigationBeads');
var SlideReel = require('./components/slideReel');
var classNames = require('classnames');

var EventListener = require('react-event-listener').default;

require('./react-step-wizard.scss');


var StepWizard = React.createClass({
  statics: {
    Step: Step,
  },

  getInitialState: function() {
    return {
      currentStepIndex: 0,
    };
  },

  getDefaultProps: function() {
    return {
      loopBeginning: true
    };
  },

  propTypes: {
    loopBeginning: React.PropTypes.bool
  },

  consts: {
    hideableClass: "sw-hidable",
  },

  componentWillMount: function() {
    this.validateChildren();
  },

  componentDidMount: function() {
    // window.addEventListener('popstate', this.navigateBack.bind(this))
    this.onMountHistoryFix();
  },

  onMountHistoryFix: function() {
    //IE 9 doesn't support altering history (otherwise IE 6 wouldn't have happened)
    if(!window.history.pushState) {
      return;
    }

    //This will reset the history when you navigate away from thise page and hit back
    if(window.history.state && window.history.state.currentStepIndex > 0) {
      window.history.go(-window.history.state.currentStepIndex);
      return;
    }

    window.history.replaceState({currentStepIndex: 0}, 'Step 0');
  },

  componentWillUnmount: function() {
{'fraction_non_alphanumeric': 0.13806706114398423, 'fraction_numerical': 0.0039447731755424065, 'mean_word_length': 3.6246200607902734, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '6854070', 'n_tokens_mistral': 928, 'n_tokens_neox': 882, 'n_words': 190}