<commit_before>//     goog.mvc 0.9

//     (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.array');
goog.require('goog.events');
goog.require('goog.History');

/**
 * @constructor
 */
mvc.Router = function() {
    this.history_ = new goog.History();
    goog.events.listen(this.history_, goog.history.EventType.NAVIGATE,
        this.onChange_, false, this);
    this.history_.setEnabled(true);
    this.routes_ = [];
};

/**
 * pass through the fragment for the URL
 *
 * @param {string} fragment
 */
mvc.Router.prototype.navigate = function(fragment) {
    this.history_.setToken(fragment);
};<commit_msg>I've added a method that checks if HTML5History is supported(for URLs without Hashtags, for example Google+)<commit_after>//     goog.mvc 0.9

//     (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.array');
goog.require('goog.events');
goog.require('goog.History');

/**
 * @constructor
 */
mvc.Router = function() {
    this.checkhistorysupport();
    goog.events.listen(this.history_, goog.history.EventType.NAVIGATE,
        this.onChange_, false, this);
    this.history_.setEnabled(true);
    this.routes_ = [];
};
/**
*checks if HTML5History is supported
*/
mvc.prototype.checkhistorysupport=function (){
    if(goog.history.Html5History.isSupported()){
    this.history_= new goog.history.Html5History();this.history_.setUseFragment(false);
}
else
{
    this.history_=new goog.History();
}
};
/**
 * pass through the fragment for the URL
 *
 * @param {string} fragment
 */
mvc.Router.prototype.navigate = function(fragment) {
    this.history_.setToken(fragment);
};
{'fraction_non_alphanumeric': 0.15487179487179487, 'fraction_numerical': 0.008205128205128205, 'mean_word_length': 3.634204275534442, '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': '2785107', 'n_tokens_mistral': 653, 'n_tokens_neox': 621, 'n_words': 130}