<commit_before>{% set builderId = 'builder_' ~ random() %}

<div id="{{ builderId }}">
    {% if form.getAttribute('injectCSS') %}
        <style type="text/css">{{ form.getAttribute('injectCSS') }}</style>
    {% endif %}

    {% if preview is not defined or not preview %}
        <div id="props-dialog-form" title="{{ 'dialog.properties'|trans }}"></div>
    {% endif %}

    <div id="form-{{ preview is defined and preview ? 'preview' : 'editor' }}">
        <ul class="form-list form-section clearfix"></ul>
    </div>
</div>

<script type="text/javascript">
    AppFormBuilder.onPageLoad(function () {
        // declare the form builder
        var {{ builderId }} = new FormBuilder('{{ builderId }}', '{% if preview is defined and preview %}{{ formView.vars.name }}{% endif %}');

        {% if allowManualFieldName is defined and allowManualFieldName %}
            {{ builderId }}.setAllowManualFieldName(true);
        {% endif %}

        {{ builderId }}.init({
            {% if form %}
                form: {
                    id: '{{ form.getId() }}',
                    title: '{{ form.getName()|default('form.default_name'|trans) }}',
                    pluralTitle: '{{ form.getPluralName()|default('') }}',
                    width: {{ form.getAttribute('width')|default(691) }},
                    labelWidth: {{ form.getAttribute('labelWidth')|default(150) }},
                    isDefault: '{{ form.isDefaultFlag() ? 'Yes' : 'No' }}',
                    isTable: '{{ form.isTableFlag() ? 'Yes' : 'No' }}',
                    injectCSS: {{ form.getAttribute('injectCSS') }}
                },
                fields: {
                    {% for field in form.getFields() %}
                        '{{ field.getName() }}': {{ field.getAttributes()|json_encode()|raw }},
                    {% endfor %}
                }
            {% endif %}
        }{% if preview is defined and preview %}, true{% endif %});

        currentBuilder = {{ builderId }};

        {% if preview is not defined or not preview %}
            {% if form %}
                {% for field in form.getFields() %}
                    $('.form-saved-type[data-name="{{ field.getName() }}"]').hide();
                {% endfor %}
            {% endif %}

            resetListRules();
        {% endif %}

        {# use this function to load additional settigns #}
        if (typeof _builderInit == 'function') _builderInit(currentBuilder);

        {% if preview is defined and preview %}
            handlePreview({{ builderId }});
        {% else %}
            handleEditor();
        {% endif %}
    });
</script>
<commit_msg>Added double quotes around string (multi lines)<commit_after>{% set builderId = 'builder_' ~ random() %}

<div id="{{ builderId }}">
    {% if form.getAttribute('injectCSS') %}
        <style type="text/css">{{ form.getAttribute('injectCSS') }}</style>
    {% endif %}

    {% if preview is not defined or not preview %}
        <div id="props-dialog-form" title="{{ 'dialog.properties'|trans }}"></div>
    {% endif %}

    <div id="form-{{ preview is defined and preview ? 'preview' : 'editor' }}">
        <ul class="form-list form-section clearfix"></ul>
    </div>
</div>

<script type="text/javascript">
    AppFormBuilder.onPageLoad(function () {
        // declare the form builder
        var {{ builderId }} = new FormBuilder('{{ builderId }}', '{% if preview is defined and preview %}{{ formView.vars.name }}{% endif %}');

        {% if allowManualFieldName is defined and allowManualFieldName %}
            {{ builderId }}.setAllowManualFieldName(true);
        {% endif %}

        {{ builderId }}.init({
            {% if form %}
                form: {
                    id: '{{ form.getId() }}',
                    title: '{{ form.getName()|default('form.default_name'|trans) }}',
                    pluralTitle: '{{ form.getPluralName()|default('') }}',
                    width: {{ form.getAttribute('width')|default(691) }},
                    labelWidth: {{ form.getAttribute('labelWidth')|default(150) }},
                    isDefault: '{{ form.isDefaultFlag() ? 'Yes' : 'No' }}',
                    isTable: '{{ form.isTableFlag() ? 'Yes' : 'No' }}',
                    injectCSS: "{{ form.getAttribute('injectCSS') }}"
                },
                fields: {
                    {% for field in form.getFields() %}
                        '{{ field.getName() }}': {{ field.getAttributes()|json_encode()|raw }},
                    {% endfor %}
                }
            {% endif %}
        }{% if preview is defined and preview %}, true{% endif %});

        currentBuilder = {{ builderId }};

        {% if preview is not defined or not preview %}
            {% if form %}
                {% for field in form.getFields() %}
                    $('.form-saved-type[data-name="{{ field.getName() }}"]').hide();
                {% endfor %}
            {% endif %}

            resetListRules();
        {% endif %}

        {# use this function to load additional settigns #}
        if (typeof _builderInit == 'function') _builderInit(currentBuilder);

        {% if preview is defined and preview %}
            handlePreview({{ builderId }});
        {% else %}
            handleEditor();
        {% endif %}
    });
</script>

{'fraction_non_alphanumeric': 0.17388031614602936, 'fraction_numerical': 0.002258185923974407, 'mean_word_length': 1.89015769439913, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, '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': '2214961', 'n_tokens_mistral': 1539, 'n_tokens_neox': 1389, 'n_words': 330}