<commit_before>MLS.contentFilter = (function () {

    var $cf = $jQ('#content-filter'),
        hashLoaded = false,
        options = {
            endpoint: null,
            callback: function () {},
            container: null
        },

        pub = {

            /*============================
            =            Init            =
            ============================*/

            init: function (o) {
                options = $jQ.extend(options, o);

                // endpoint = endpoint ? endpoint : (ep || MLS.ajax.endpoints.PRODUCT_LISTING);
                // callback = c || contentGrid.reInit;


                $cf = $jQ('#content-filter');
                var $collapsible = $cf.find('.collapsible'),
                    $facets = $cf.find('.facet');


                // collapse all but first dimension
                $collapsible.find('.facet-list').slideToggle('slow');


                // load content on load (if hash)
                !hashLoaded && pub.loadFromHash();
                hashLoaded = true;

                /*==========  bind click events  ==========*/

                // dimension (expansion/collapse)
                $collapsible.find('.dimension-header').on('click', pub.dimensionClick);

                $facets.on('click', pub.facetClick);
                $jQ('.filter-panels li').on('click', pub.sort); /* mobile option */

                // remove filter
                $jQ('#filter-selections').find('a').on('click', pub.removeFilter);

                // compability services
                $jQ('.compatibility-filter').children('select').on('change', pub.compabilitySelect);

                // type ahead (searc)
                $jQ('.compatibility-filter').children('input.type-ahead').on('keyup', pub.compabilitySearch);

                // sort links
                $jQ('#sort-options').find('li').on('click', pub.sort);
                $jQ('#mobile-sort-filter li.sort-option').on('click', pub.sort);
            },
            /*-----  End of Init  ------*/



            /*================================================
            =            Finalize (unbind events)            =
            =================================================*/

            finalize: function () {
                $cf = $jQ('#content-filter');
                var $collapsible = $cf.find('.collapsible'),
                    $facets = $cf.find('.facet');

                 /*==========  bind click events  ==========*/


                // dimension (expansion/collapse)
                $collapsible.find('.dimension-header').unbind('click', pub.dimensionClick);


                $facets.unbind('click', pub.facetClick);
                $jQ('.filter-panels li').unbind('click', pub.sort); /* mobile option */

                // remove filter
                $jQ('#clear-selections').find('li').find('a').unbind('click', pub.removeFilter);

                // compability services
                $jQ('.compatibility-filter').children('select').unbind('change', pub.compabilitySelect);

                // type ahead (searc)
                $jQ('.compatibility-filter').children('input.type-ahead').unbind('keyup', pub.compabilitySearch);

                 // sort links
                $jQ('#sort-options').find('li').on('click', pub.sort);
                $jQ('#mobile-sort-filter li.sort-option').on('click', pub.sort);

            },

            /*-----  End of Finalize (unbind events)  ------*/




            /*============================================
            =            Reinit: on ajax load            =
            ============================================*/

            reInit: function () {
                MLS.contentFilter.finalize();
                MLS.contentFilter.init();

            },

            /*-----  End of Reinit: on ajax load  ------*/




            /*======================================
            =            Load from Hash            =
            ======================================*/
            // If the url contains paramaters in the hash when it
            // is first loaded then request content

            loadFromHash: function () {

                var hash = window.location.hash,
                params = {};

                if (hash !== '') { // we have a hash
                    params = MLS.util.getParamsFromUrl(hash);

                    if (!$jQ.isEmptyObject(params)) {
                        pub.processRequest(params);
                    }

                }

            },

            /*-----  End of Load from Hash  ------*/




            /*=======================================
            =            Listing sorting            =
            =======================================*/

            sort: function (e) {
                e.preventDefault();
                var $elem = $jQ(this),
                    href = $elem.find('a').attr('href'),
                    params = MLS.util.getParamsFromUrl(href);

                pub.processRequest(params);
            },

            /*-----  End of Listing sorting  ------*/



            /*=======================================
            =            dimension click            =
            =======================================*/

            dimensionClick: function (e) {
                e.preventDefault();
                $jQ(this).toggleClass('active').promise().done(function () {
                    $jQ(this).next().slideToggle('slow');
                });
            },

            /*-----  End of dimension click  ------*/





            /*==========================================
            =            Compability search            =
            ==========================================*/

            compabilitySearch: function (e) {<commit_msg>set hash when sorting list<commit_after>MLS.contentFilter = (function () {

    var $cf = $jQ('#content-filter'),
        hashLoaded = false,
        options = {
            endpoint: null,
            callback: function () {},
            container: null
        },

        pub = {

            /*============================
            =            Init            =
            ============================*/

            init: function (o) {
                options = $jQ.extend(options, o);

                // endpoint = endpoint ? endpoint : (ep || MLS.ajax.endpoints.PRODUCT_LISTING);
                // callback = c || contentGrid.reInit;


                $cf = $jQ('#content-filter');
                var $collapsible = $cf.find('.collapsible'),
                    $facets = $cf.find('.facet');


                // collapse all but first dimension
                $collapsible.find('.facet-list').slideToggle('slow');


                // load content on load (if hash)
                !hashLoaded && pub.loadFromHash();
                hashLoaded = true;

                /*==========  bind click events  ==========*/

                // dimension (expansion/collapse)
                $collapsible.find('.dimension-header').on('click', pub.dimensionClick);

                $facets.on('click', pub.facetClick);
                $jQ('.filter-panels li').on('click', pub.sort); /* mobile option */

                // remove filter
                $jQ('#filter-selections').find('a').on('click', pub.removeFilter);

                // compability services
                $jQ('.compatibility-filter').children('select').on('change', pub.compabilitySelect);

                // type ahead (searc)
                $jQ('.compatibility-filter').children('input.type-ahead').on('keyup', pub.compabilitySearch);

                // sort links
                $jQ('#sort-options').find('li').on('click', pub.sort);
                $jQ('#mobile-sort-filter li.sort-option').on('click', pub.sort);
            },
            /*-----  End of Init  ------*/



            /*================================================
            =            Finalize (unbind events)            =
            =================================================*/

            finalize: function () {
                $cf = $jQ('#content-filter');
                var $collapsible = $cf.find('.collapsible'),
                    $facets = $cf.find('.facet');

                 /*==========  bind click events  ==========*/


                // dimension (expansion/collapse)
                $collapsible.find('.dimension-header').unbind('click', pub.dimensionClick);


                $facets.unbind('click', pub.facetClick);
                $jQ('.filter-panels li').unbind('click', pub.sort); /* mobile option */

                // remove filter
                $jQ('#clear-selections').find('li').find('a').unbind('click', pub.removeFilter);

                // compability services
                $jQ('.compatibility-filter').children('select').unbind('change', pub.compabilitySelect);

                // type ahead (searc)
                $jQ('.compatibility-filter').children('input.type-ahead').unbind('keyup', pub.compabilitySearch);

                 // sort links
                $jQ('#sort-options').find('li').on('click', pub.sort);
                $jQ('#mobile-sort-filter li.sort-option').on('click', pub.sort);

            },

            /*-----  End of Finalize (unbind events)  ------*/




            /*============================================
            =            Reinit: on ajax load            =
            ============================================*/

            reInit: function () {
                MLS.contentFilter.finalize();
                MLS.contentFilter.init();

            },

            /*-----  End of Reinit: on ajax load  ------*/




            /*======================================
            =            Load from Hash            =
            ======================================*/
            // If the url contains paramaters in the hash when it
            // is first loaded then request content

            loadFromHash: function () {

                var hash = window.location.hash,
                params = {};

                if (hash !== '') { // we have a hash
                    params = MLS.util.getParamsFromUrl(hash);

                    if (!$jQ.isEmptyObject(params)) {
                        pub.processRequest(params);
                    }

                }

            },

            /*-----  End of Load from Hash  ------*/




            /*=======================================
            =            Listing sorting            =
            =======================================*/

            sort: function (e) {
                e.preventDefault();
                var $elem = $jQ(this),
                    href = $elem.find('a').attr('href'),
                    params = MLS.util.getParamsFromUrl(href);

                window.location.hash = MLS.util.setHash(href);
                pub.processRequest(params);
            },

            /*-----  End of Listing sorting  ------*/



            /*=======================================
            =            dimension click            =
            =======================================*/

            dimensionClick: function (e) {
                e.preventDefault();
                $jQ(this).toggleClass('active').promise().done(function () {
                    $jQ(this).next().slideToggle('slow');
                });
            },

            /*-----  End of dimension click  ------*/





            /*==========================================
            =            Compability search            =
            ==========================================*/

            compabilitySearch: function (e) {
{'fraction_non_alphanumeric': 0.2367654617097824, 'fraction_numerical': 0.0, 'mean_word_length': 1.3768322475570032, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3177305', 'n_tokens_mistral': 2901, 'n_tokens_neox': 2555, 'n_words': 468}