<commit_before>(function ($) {

    $.entwine('ss', function ($) {

        $('.ss-seo-editor .ss-gridfield-item input, .ss-seo-editor .ss-gridfield-item textarea').entwine({

            onchange: function () {

                // kill the popup for form changes
                window.onbeforeunload = null;

                var $this = $(this);
                var id = $this.closest('tr').attr('data-id');
                var url = $this.closest('.ss-gridfield').attr('data-url') + "/update/" + id;
                var data = $this.attr('name') + '=' + $(this).val();

                statusMessage('Saving changes', 'good');

                $.post(
                    url,
                    data,
                    function (data, textStatus) {
                        statusMessage(data.message, data.type);

                        $this.closest('td').removeClass();
                        if (data.errors.length) {
                            $this.closest('td').addClass('seo-editor-error');
                            data.errors.forEach(function(error) {
                                $this.closest('td').addClass(error)
                            });
                        } else {
                            $this.closest('td').addClass('seo-editor-valid');
                        }

                    },
                    'json'
                );
            }
        });

    });

}(jQuery));<commit_msg>Fix popup & encode URI components<commit_after>(function ($) {

    $.entwine('ss', function ($) {

        $('.ss-seo-editor .ss-gridfield-item input, .ss-seo-editor .ss-gridfield-item textarea').entwine({

            onchange: function () {

                // kill the popup for form changes
                $('.cms-edit-form').removeClass('changed');

                var $this = $(this);
                var id = $this.closest('tr').attr('data-id');
                var url = $this.closest('.ss-gridfield').attr('data-url') + "/update/" + id;
                var data = encodeURIComponent($this.attr('name')) + '=' + encodeURIComponent($(this).val());

                statusMessage('Saving changes', 'good');

                $.post(
                    url,
                    data,
                    function (data, textStatus) {
                        statusMessage(data.message, data.type);

                        $this.closest('td').removeClass();
                        if (data.errors.length) {
                            $this.closest('td').addClass('seo-editor-error');
                            data.errors.forEach(function(error) {
                                $this.closest('td').addClass(error)
                            });
                        } else {
                            $this.closest('td').addClass('seo-editor-valid');
                        }

                    },
                    'json'
                );
            }
        });

    });

}(jQuery));

{'fraction_non_alphanumeric': 0.150253807106599, 'fraction_numerical': 0.0, 'mean_word_length': 1.1054131054131053, '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': '1517665', 'n_tokens_mistral': 777, 'n_tokens_neox': 715, 'n_words': 112}