<commit_before>//     (c) 2012 <NAME>, Catch.com
//     goog.mvc may be freely distributed under the MIT license.
//     For all details and documentation:
//     https://github.com/rhysbrettbowen/goog.mvc

goog.provide('mvc.Router');

goog.require('goog.History');
goog.require('goog.array');
goog.require('goog.events');
goog.require('goog.history.Html5History');



/**
 * @constructor
 *
 * @param {boolean=} opt_noFragment set to true to hide fragment when using
 * HTML5 history.
 * @param {string=} opt_blankPage url to a blank page - needed if HTML5 is not
 * available and you don't want to show the fragment.
 */
mvc.Router = function(opt_noFragment, opt_blankPage) {
  this.history_ = goog.history.Html5History.isSupported() ?
      new goog.history.Html5History() :
      new goog.History(!!(opt_blankPage && opt_noFragment), opt_blankPage);
  if (this.history_.setUseFragment)
    this.history_.setUseFragment(!opt_noFragment);
  goog.events.listen(this.history_, goog.history.EventType.NAVIGATE,
      this.onChange_, false, this);
  this.history_.setEnabled(true);
  this.routes_ = [];<commit_msg>expose goog.History options for elements<commit_after>//     (c) 2012 <NAME>, Catch.com
//     goog.mvc may be freely distributed under the MIT license.
//     For all details and documentation:
//     https://github.com/rhysbrettbowen/goog.mvc

goog.provide('mvc.Router');

goog.require('goog.History');
goog.require('goog.array');
goog.require('goog.events');
goog.require('goog.history.Html5History');



/**
 * @constructor
 *
 * @param {boolean=} opt_noFragment set to true to hide fragment when using
 * HTML5 history.
 * @param {string=} opt_blankPage url to a blank page - needed if HTML5 is not
 * available and you don't want to show the fragment.
 * @param {HTMLInputElement=} opt_input The hidden input element to be used to
 * store the history token.  If not provided, a hidden input element will
 * be created using document.write.
 * @param {HTMLIFrameElement=} opt_iframe The hidden iframe that will be used by
 * IE for pushing history state changes, or by all browsers if opt_noFragment
 * is true. If not provided, a hidden iframe element will be created using
 * document.write.
 */
mvc.Router = function(opt_noFragment, opt_blankPage, opt_input, opt_iframe) {
  this.history_ = goog.history.Html5History.isSupported() ?
      new goog.history.Html5History() :
      new goog.History(!!(opt_blankPage && opt_noFragment), opt_blankPage,
        opt_input, opt_iframe);
  if (this.history_.setUseFragment)
    this.history_.setUseFragment(!opt_noFragment);
  goog.events.listen(this.history_, goog.history.EventType.NAVIGATE,
      this.onChange_, false, this);
  this.history_.setEnabled(true);
  this.routes_ = [];
{'fraction_non_alphanumeric': 0.1204950855478704, 'fraction_numerical': 0.006552602839461231, 'mean_word_length': 4.136448598130841, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '5843608', 'n_tokens_mistral': 874, 'n_tokens_neox': 833, 'n_words': 236}