<commit_before>/**
 * Router for basic datagrid
 *
 * @class   OroApp.DatagridRouter
 * @extends OroApp.Router
 */
OroApp.DatagridRouter = OroApp.Router.extend({
    /** @property */
    routes: {
        "g/*encodedStateData": "changeState"
    },

    /**
     * Binded collection, passed in constructor as option
     *
     * @property {OroApp.PageableCollection}
     */
    collection: null,

    /**
     * Initial state of binded collection, passed in constructor
     *
     * @property {Object}
     */
    _initState: null,

    /**
     * Initialize router
     *
     * @param {Object} options
     * @param {OroApp.PageableCollection} options.collection Collection of models.
     */
    initialize: function(options) {
        options = options || {};
        if (!options.collection) {
            throw new TypeError("'collection' is required");
        }

        this.collection = options.collection;
        this._initState = _.clone(this.collection.state);

        this.collection.on('beforeReset', this._handleStateChange, this);


        this.init();

        OroApp.Router.prototype.initialize.apply(this, arguments);
        /**
         * Backbone event. Fired when grid route is initialized
         * @event grid_route:loaded
         */
        OroApp.Events.trigger("grid_route:loaded", this);
    },

    /**<commit_msg>BAP-559: Grid router modifications<commit_after>/**
 * Router for basic datagrid
 *
 * @class   OroApp.DatagridRouter
 * @extends OroApp.Router
 */
OroApp.DatagridRouter = OroApp.Router.extend({
    /** @property */
    routes: {
        "g/*encodedStateData": "changeState",
        "": "init"
    },

    /**
     * Binded collection, passed in constructor as option
     *
     * @property {OroApp.PageableCollection}
     */
    collection: null,

    /**
     * Initial state of binded collection, passed in constructor
     *
     * @property {Object}
     */
    _initState: null,

    /**
     * Initialize router
     *
     * @param {Object} options
     * @param {OroApp.PageableCollection} options.collection Collection of models.
     */
    initialize: function(options) {
        options = options || {};
        if (!options.collection) {
            throw new TypeError("'collection' is required");
        }

        this.collection = options.collection;
        this._initState = _.clone(this.collection.state);

        this.collection.on('beforeReset', this._handleStateChange, this);

        //this.init();

        OroApp.Router.prototype.initialize.apply(this, arguments);
        /**
         * Backbone event. Fired when grid route is initialized
         * @event grid_route:loaded
         */
        OroApp.Events.trigger("grid_route:loaded", this);
    },

    /**
{'fraction_non_alphanumeric': 0.12518195050946143, 'fraction_numerical': 0.001091703056768559, 'mean_word_length': 2.2571090047393363, 'pattern_counts': {'":': 3, '<': 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': '2135621', 'n_tokens_mistral': 791, 'n_tokens_neox': 773, 'n_words': 168}