<commit_before>/* jshint browser:true, devel:true */
/* global define */
define(['jquery', 'underscore', 'backbone', 'oro/translator', 'oro/app', 'oro/mediator', 'oro/messenger', 'oro/registry',
    'oro/modal', 'oro/loading-mask', 'oro/navigation/pagestate/view', 'oro/navigation/pagestate/model',
    'oro/pageable-collection', 'jquery.form'],
function($, _, Backbone, __, app, mediator, messenger, registry,
         Modal, LoadingMask, PagestateView, PagestateModel,
         PageableCollection) {
    'use strict';

    var Navigation,
        instance,
        pageCacheStates = {
            state: {},

            registerStateObject: function(type, fields) {
                this.state[type] = {};
                _.each(fields, function(field) {
                    this.state[type][field] = '';
                }, this);
            },

            saveObjectCache: function(type, values) {
                _.each(values, function(value, key) {
                    this.state[type][key] = value;
                }, this);
            },

            getObjectCache: function(type) {
                return this.state[type];
            }
        };

    pageCacheStates.registerStateObject('grid',['collection']);
    pageCacheStates.registerStateObject('form',['form_data']);

    /**
     * Router for hash navigation
     *
     * @export  oro/navigation
     * @class   oro.Navigation
     * @extends Backbone.Router
     */
    Navigation = Backbone.Router.extend({
        /**
         * Hash navigation enabled/disabled flag
         */
        enabled: true,

        /**
         * links - Selector for all links that will be processed by hash navigation
         * scrollLinks - Selector for anchor links
         * forms - Selector for all forms that will be processed by hash navigation
         * content - Selector for ajax response content area
         * container - Selector for main content area
         * loadingMask - Selector for loading spinner
         * searchDropdown - Selector for dropdown with search results
         * menuDropdowns - Selector for 3 dots menu and user dropdowns
         * pinbarHelp - Selector for pinbars help link
         * historyTab - Selector for history 3 dots menu tab
         * mostViwedTab - Selector for most viewed 3 dots menu tab
         * flashMessages - Selector for system messages block
         * menu - Selector for system main menu
         * breadcrumb - Selector for breadcrumb block
         * pinButton - Selector for pin, close and favorite buttons div
         *
         * @property
         */
        selectors: {
            links:          'a:not([href^=#],[href^=javascript],[href^=mailto],[href^=skype],[href^=http],[href^=ftp],[href^=callto],[href^=tel]),span[data-url]',
            scrollLinks:    'a[href^=#]',
            forms:          'form',
            content:        '#content',
            container:      '#container',
            loadingMask:    '.hash-loading-mask',
            searchDropdown: '#search-div',
            menuDropdowns:  '.pin-menus.dropdown, .nav .dropdown',
            pinbarHelp:     '.pin-bar-empty',
            historyTab:     '#history-content',
            mostViewedTab:  '#mostviewed-content',
            flashMessages:  '#flash-messages',
            menu:           '#main-menu',
            breadcrumb:     '#breadcrumb',
            pinButton:      '#pin-button-div'
        },
        selectorCached: {},

        /** @property {oro.LoadingMask} */
        loadingMask: '',

        /** @property {String} */
        baseUrl: '',

        /** @property {String} */
        headerId: '',

        /** @property {Object} */
        headerObject: '',

        /**<commit_msg>Fixed BAP-1565: Hash navigation lost in search results<commit_after>/* jshint browser:true, devel:true */
/* global define */
define(['jquery', 'underscore', 'backbone', 'oro/translator', 'oro/app', 'oro/mediator', 'oro/messenger', 'oro/registry',
    'oro/modal', 'oro/loading-mask', 'oro/navigation/pagestate/view', 'oro/navigation/pagestate/model',
    'oro/pageable-collection', 'jquery.form'],
function($, _, Backbone, __, app, mediator, messenger, registry,
         Modal, LoadingMask, PagestateView, PagestateModel,
         PageableCollection) {
    'use strict';

    var Navigation,
        instance,
        pageCacheStates = {
            state: {},

            registerStateObject: function(type, fields) {
                this.state[type] = {};
                _.each(fields, function(field) {
                    this.state[type][field] = '';
                }, this);
            },

            saveObjectCache: function(type, values) {
                _.each(values, function(value, key) {
                    this.state[type][key] = value;
                }, this);
            },

            getObjectCache: function(type) {
                return this.state[type];
            }
        };

    pageCacheStates.registerStateObject('grid',['collection']);
    pageCacheStates.registerStateObject('form',['form_data']);

    /**
     * Router for hash navigation
     *
     * @export  oro/navigation
     * @class   oro.Navigation
     * @extends Backbone.Router
     */
    Navigation = Backbone.Router.extend({
        /**
         * Hash navigation enabled/disabled flag
         */
        enabled: true,

        /**
         * links - Selector for all links that will be processed by hash navigation
         * scrollLinks - Selector for anchor links
         * forms - Selector for all forms that will be processed by hash navigation
         * content - Selector for ajax response content area
         * container - Selector for main content area
         * loadingMask - Selector for loading spinner
         * searchDropdown - Selector for dropdown with search results
         * menuDropdowns - Selector for 3 dots menu and user dropdowns
         * pinbarHelp - Selector for pinbars help link
         * historyTab - Selector for history 3 dots menu tab
         * mostViwedTab - Selector for most viewed 3 dots menu tab
         * flashMessages - Selector for system messages block
         * menu - Selector for system main menu
         * breadcrumb - Selector for breadcrumb block
         * pinButton - Selector for pin, close and favorite buttons div
         *
         * @property
         */
        selectors: {
            links:          'a:not([href^=#],[href^=javascript],[href^=mailto],[href^=skype],[href^=ftp],[href^=callto],[href^=tel]),span[data-url]',
            scrollLinks:    'a[href^=#]',
            forms:          'form',
            content:        '#content',
            container:      '#container',
            loadingMask:    '.hash-loading-mask',
            searchDropdown: '#search-div',
            menuDropdowns:  '.pin-menus.dropdown, .nav .dropdown',
            pinbarHelp:     '.pin-bar-empty',
            historyTab:     '#history-content',
            mostViewedTab:  '#mostviewed-content',
            flashMessages:  '#flash-messages',
            menu:           '#main-menu',
            breadcrumb:     '#breadcrumb',
            pinButton:      '#pin-button-div'
        },
        selectorCached: {},

        /** @property {oro.LoadingMask} */
        loadingMask: '',

        /** @property {String} */
        baseUrl: '',

        /** @property {String} */
        headerId: '',

        /** @property {Object} */
        headerObject: '',

        /**
{'fraction_non_alphanumeric': 0.12342535513267221, 'fraction_numerical': 0.0013401232913428035, 'mean_word_length': 1.8759152215799615, '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': '2496662', 'n_tokens_mistral': 2033, 'n_tokens_neox': 1941, 'n_words': 483}