<commit_before>{% extends "mapwidgets/google-map-widget.html" %}
{% block extra_input %}
    <input type="hidden"  class="js-class-options" name="district_set-__prefix__-location-mw-wrap">
{% endblock extra_input %}

{% block javascript %}
    <script type="application/javascript">

        (function($) {
            var mapOptions = JSON.parse("{{ options|escapejs }}");
            {% if not is_formset_empty_from_template %}

                var widgetData = JSON.parse("{{ js_widget_data|escapejs }}");
                var wrapElemSelector = widgetData.wrapElemSelector;
                var mapElemID = widgetData.mapElemID;
                var googleAutoInputID = widgetData.googleAutoInputID;
                var locationInputID = widgetData.locationInputID;

                var mapWidgetOptions = {
                    locationInput: $(locationInputID),
                    wrapElemSelector: wrapElemSelector,
                    locationFieldValue: JSON.parse("{{ field_value|escapejs }}"),
                    mapElement: document.getElementById(mapElemID),
                    mapCenterLocationName: mapOptions.mapCenterLocationName,
                    mapCenterLocation: mapOptions.mapCenterLocation,
                    coordinatesOverlayToggleBtn: $(".mw-btn-coordinates", wrapElemSelector),
                    coordinatesOverlayDoneBtn: $(".mw-btn-coordinates-done", wrapElemSelector),
                    coordinatesOverlayInputs: $(".mw-overlay-input", wrapElemSelector),
                    coordinatesOverlay: $(".mw-coordinates-overlay", wrapElemSelector),
                    myLocationBtn: $(".mw-btn-my-location", wrapElemSelector),
                    addressAutoCompleteInput: document.getElementById(googleAutoInputID),
                    deleteBtn: $(".mw-btn-delete", wrapElemSelector),
                    addMarkerBtn: $(".mw-btn-add-marker", wrapElemSelector),
                    loaderOverlayElem: $(".mw-loader-overlay", wrapElemSelector),
                    zoom: mapOptions.zoom
                };
                new DjangoGoogleMapWidget(mapWidgetOptions);

            {% else %}

                var widgetDataTemplate = JSON.parse("{{ js_widget_data|escapejs }}");
                var inline_add_row_jquery_selector = widgetDataTemplate.inline_add_row_jquery_selector;
                new DjangoMapWidgetGenerater({
                    "inline_add_row_jquery_selector" : inline_add_row_jquery_selector,
                    "widgetDataTemplate": widgetDataTemplate,
                    "mapOptions": mapOptions
                });
                $(document).on('formset:added', function(e) {
                    alert("run!")
                });
            {% endif %}
        })(django.jQuery);
    </script>
{% endblock javascript %}<commit_msg>cleaned inline_add_row_jquery_selector in widget templates<commit_after>{% extends "mapwidgets/google-map-widget.html" %}
{% block extra_input %}
    <input type="hidden"  class="js-class-options" name="district_set-__prefix__-location-mw-wrap">
{% endblock extra_input %}

{% block javascript %}
    <script type="application/javascript">

        (function($) {
            var mapOptions = JSON.parse("{{ options|escapejs }}");
            {% if not is_formset_empty_from_template %}

                var widgetData = JSON.parse("{{ js_widget_data|escapejs }}");
                var wrapElemSelector = widgetData.wrapElemSelector;
                var mapElemID = widgetData.mapElemID;
                var googleAutoInputID = widgetData.googleAutoInputID;
                var locationInputID = widgetData.locationInputID;

                var mapWidgetOptions = {
                    locationInput: $(locationInputID),
                    wrapElemSelector: wrapElemSelector,
                    locationFieldValue: JSON.parse("{{ field_value|escapejs }}"),
                    mapElement: document.getElementById(mapElemID),
                    mapCenterLocationName: mapOptions.mapCenterLocationName,
                    mapCenterLocation: mapOptions.mapCenterLocation,
                    coordinatesOverlayToggleBtn: $(".mw-btn-coordinates", wrapElemSelector),
                    coordinatesOverlayDoneBtn: $(".mw-btn-coordinates-done", wrapElemSelector),
                    coordinatesOverlayInputs: $(".mw-overlay-input", wrapElemSelector),
                    coordinatesOverlay: $(".mw-coordinates-overlay", wrapElemSelector),
                    myLocationBtn: $(".mw-btn-my-location", wrapElemSelector),
                    addressAutoCompleteInput: document.getElementById(googleAutoInputID),
                    deleteBtn: $(".mw-btn-delete", wrapElemSelector),
                    addMarkerBtn: $(".mw-btn-add-marker", wrapElemSelector),
                    loaderOverlayElem: $(".mw-loader-overlay", wrapElemSelector),
                    zoom: mapOptions.zoom
                };
                new DjangoGoogleMapWidget(mapWidgetOptions);

            {% else %}

                var widgetDataTemplate = JSON.parse("{{ js_widget_data|escapejs }}");
                new DjangoMapWidgetGenerater({
                    "widgetDataTemplate": widgetDataTemplate,
                    "mapOptions": mapOptions
                });
                $(document).on('formset:added', function(e) {
                    alert("run!")
                });
            {% endif %}
        })(django.jQuery);
    </script>
{% endblock javascript %}
{'fraction_non_alphanumeric': 0.10892725936811168, 'fraction_numerical': 0.0, 'mean_word_length': 2.078010175240249, 'pattern_counts': {'":': 4, '<': 9, '<?xml version=': 0, '>': 9, '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': '676656', 'n_tokens_mistral': 1397, 'n_tokens_neox': 1272, 'n_words': 215}