<commit_before><script>
    $jQuery(document).ready(function() {
        function format(item) { return item.title; };
        $jQuery("#municipality").select2({
            placeholder: "<?= translate('Zoek uw woonplaats') ?> ...",
            minimumInputLength: 3,
            ajax: { // instead of writing the function to execute the request we use Select2's convenient helper
                url: "?view=municipalities&format=json",
                dataType: 'json',
                data: function (term) {
                    return {
                        search: term, // search term
                        page_limit: 10
                    };
                },
                results: function (data) { // parse the results into the format expected by Select2.
                    // since we are using custom formatting functions we do not need to alter remote JSON data
                    var results = [];
                    $jQuery.each(data.items, function(i, item) {
                        results.push(item.data);
                    });
                    return {results: results};
                }
            },
            initSelection: function(element, callback) {
                // the input tag has a value attribute preloaded that points to a preselected movie's id
                // this function resolves that id attribute to an object that select2 can render
                // using its formatResult renderer - that way the movie name is shown preselected
                var id=$jQuery(element).val();
                if (id!=="") {
                    $jQuery.ajax("/<?= $site ?>/contact/<?= object('lib:filter.slug')->sanitize(translate('Your district officer')) ?>?view=street&format=json&id="+id, {
                        dataType: "json"
                    }).done(function(data) { callback(data.item); });
                }
            },
            formatResult: format, // omitted for brevity, see the source of this page
            formatSelection: format, // omitted for brevity, see the source of this page
            dropdownCssClass: "bigdrop", // apply css that makes the dropdown taller
            formatInputTooShort: false,
            formatSearching: function () { return "<?= translate('Please wait') ?> ..."; },
            formatNoMatches: function () { return "<?= translate('No matches found') ?>"; }
        });
    });
</script>

<div id="wrap">
    <div class="container container__content">
        <div class="splash">
            <div class="splash__logo"><img src="assets://application/images/logo-<?= $language_short ?>.jpg" /></div>
            <div class="splash__search">
                <form action="<?= route( 'option=com_police&view=municipality' ); ?>" method="get" class="-koowa-grid">
                    <input type="text" class="bigdrop" id="municipality" placeholder="<?= translate('Zoek uw woonplaats') ?> ..." name="id" style="width: 100%">
                </form>
                <div class="splash__toolbar">
                    <button class="btn">Go to site</button>
                </div>
            </div>

            <div class="splash__languages">
                <a href="#">Nederlands</a>
                <a href="#">Français</a>
                <a href="#">Deutsch</a>
                <a href="#">English</a>
            </div><commit_msg>re #575 - Fixed search form<commit_after><script>
    $jQuery(document).ready(function() {
        function format(item) { return item.title; };
        $jQuery("#municipality").select2({
            placeholder: "<?= translate('Search your city') ?> ...",
            minimumInputLength: 3,
            ajax: { // instead of writing the function to execute the request we use Select2's convenient helper
                url: "?view=municipalities&format=json",
                dataType: 'json',
                data: function (term) {
                    return {
                        search: term, // search term
                        page_limit: 10
                    };
                },
                results: function (data) { // parse the results into the format expected by Select2.
                    // since we are using custom formatting functions we do not need to alter remote JSON data
                    var results = [];
                    $jQuery.each(data.items, function(i, item) {
                        results.push(item.data);
                    });
                    return {results: results};
                }
            },
            initSelection: function(element, callback) {
                // the input tag has a value attribute preloaded that points to a preselected movie's id
                // this function resolves that id attribute to an object that select2 can render
                // using its formatResult renderer - that way the movie name is shown preselected
                var id=$jQuery(element).val();
                if (id!=="") {
                    $jQuery.ajax("/<?= $site ?>/contact/<?= object('lib:filter.slug')->sanitize(translate('Your district officer')) ?>?view=street&format=json&id="+id, {
                        dataType: "json"
                    }).done(function(data) { callback(data.item); });
                }
            },
            formatResult: format, // omitted for brevity, see the source of this page
            formatSelection: format, // omitted for brevity, see the source of this page
            dropdownCssClass: "bigdrop", // apply css that makes the dropdown taller
            formatInputTooShort: false,
            formatSearching: function () { return "<?= translate('Please wait') ?> ..."; },
            formatNoMatches: function () { return "<?= translate('No matches found') ?>"; }
        });
    });
</script>

<div id="wrap">
    <div class="container container__content">
        <div class="splash">
            <div class="splash__logo"><img src="assets://application/images/logo-<?= $language_short ?>.jpg" /></div>
            <div class="splash__search">
                <form action="<?= route( 'option=com_police&view=municipality' ); ?>" method="get" class="-koowa-grid">
                    <input type="text" class="bigdrop" id="municipality" placeholder="<?= translate('Search your city') ?> ..." name="id" style="width: 100%">
                    <div class="splash__toolbar">
                        <button class="btn">Go to site</button>
                    </div>
                </form>
            </div>

            <div class="splash__languages">
                <a href="#">Nederlands</a>
                <a href="#">Français</a>
                <a href="#">Deutsch</a>
                <a href="#">English</a>
            </div>
{'fraction_non_alphanumeric': 0.13240107110978874, 'fraction_numerical': 0.0034216007140731924, 'mean_word_length': 1.6924309171005205, 'pattern_counts': {'":': 0, '<': 73, '<?xml version=': 0, '>': 75, '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': '7325133', 'n_tokens_mistral': 1723, 'n_tokens_neox': 1609, 'n_words': 471}