<commit_before>require(['jquery'], function (j) {
    "use strict";
    j(document).ready(function () {

        /**
         * Update url params
         * @param uri
         * @param key
         * @param value
         * @returns {string}
         */
        function updateUrlParameter(uri, key, value) {
            var re = new RegExp('([?&])' + key + '=.*?(&|$)', 'i'),
                separator = uri.indexOf('?') !== -1 ? '&' : '?';

            if (uri.match(re)) {
                uri = uri.replace(re, '$1' + key + '=' + value + '$2');
            } else {
                uri = uri + separator + key + '=' + value;
            }

            return uri;
        }

        /**
         * Change urls
         * @param value
         */
        function changeUrls(value) {
            var elmToChange =
                [
                    '#connector_developer_settings_sync_settings_reset_orders',
                    '#connector_developer_settings_sync_settings_reset_reviews',
                    '#connector_developer_settings_sync_settings_reset_wishlists',
                    '#connector_developer_settings_sync_settings_reset_catalog'
                ];

            j.each(elmToChange, function (k, v) {
                var str = j(v).attr('onclick'),
                    updatedUrl = updateUrlParameter(str, value, encodeURIComponent(j('#' + value).val()));

                j(v).attr('onclick', updatedUrl);
            });
        }

        /**
         * Observe change on given element
         * @param value
         */
        function observeChange(value) {
            j('#' + value).change(function () {
                changeUrls(value);
            });
        }

        function start() {
            var elmToObserve = ['from', 'to'];

            j.each(elmToObserve, function (key, value) {
                observeChange(value);
            });
        }

        start();
    });
});<commit_msg>use standard $ variable to refer to jQuery<commit_after>require(['jquery'], function ($) {
    "use strict";
    $(document).ready(function () {

        /**
         * Update url params
         * @param uri
         * @param key
         * @param value
         * @returns {string}
         */
        function updateUrlParameter(uri, key, value) {
            var re = new RegExp('([?&])' + key + '=.*?(&|$)', 'i'),
                separator = uri.indexOf('?') !== -1 ? '&' : '?';

            if (uri.match(re)) {
                uri = uri.replace(re, '$1' + key + '=' + value + '$2');
            } else {
                uri = uri + separator + key + '=' + value;
            }

            return uri;
        }

        /**
         * Change urls
         * @param value
         */
        function changeUrls(value) {
            var elmToChange =
                [
                    '#connector_developer_settings_sync_settings_reset_orders',
                    '#connector_developer_settings_sync_settings_reset_reviews',
                    '#connector_developer_settings_sync_settings_reset_wishlists',
                    '#connector_developer_settings_sync_settings_reset_catalog'
                ];

            $.each(elmToChange, function (k, v) {
                var str = $(v).attr('onclick'),
                    updatedUrl = updateUrlParameter(str, value, encodeURIComponent($('#' + value).val()));

                $(v).attr('onclick', updatedUrl);
            });
        }

        /**
         * Observe change on given element
         * @param value
         */
        function observeChange(value) {
            $('#' + value).change(function () {
                changeUrls(value);
            });
        }

        function start() {
            var elmToObserve = ['from', 'to'];

            $.each(elmToObserve, function (key, value) {
                observeChange(value);
            });
        }

        start();
    });
});
{'fraction_non_alphanumeric': 0.14044512663085187, 'fraction_numerical': 0.0015349194167306216, 'mean_word_length': 1.4076354679802956, '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': '3379579', 'n_tokens_mistral': 1076, 'n_tokens_neox': 1028, 'n_words': 196}