{% load wagtailadmin_tags compress %}

{% comment %}
    Javascript declarations to be included on the 'create page' and 'edit page' views
{% endcomment %}

<script>
    window.chooserUrls = {
        'pageChooser': '{% url "wagtailadmin_choose_page" %}'
    };
</script>

{% compress js %}
    <script src="{{ STATIC_URL }}wagtailadmin/js/vendor/rangy-core.js"></script>
    <script src="{{ STATIC_URL }}wagtailadmin/js/vendor/hallo.js"></script>
    <script src="{{ STATIC_URL }}wagtailadmin/js/vendor/tag-it.js"></script>
    <script src="{{ STATIC_URL }}wagtailadmin/js/expanding_formset.js"></script>
    <script src="{{ STATIC_URL }}wagtailadmin/js/modal-workflow.js"></script>
    <script src="{{ STATIC_URL }}wagtailadmin/js/hallo-plugins/hallo-wagtaillink.js"></script>
    <script src="{{ STATIC_URL }}wagtailadmin/js/hallo-plugins/hallo-hr.js"></script>
    <script src="{{ STATIC_URL }}wagtailadmin/js/page-editor.js"></script>
    <script src="{{ STATIC_URL }}wagtailadmin/js/page-chooser.js"></script>
    <script src="{{ STATIC_URL }}admin/js/urlify.js"></script>
    <script src="{{ STATIC_URL }}wagtailadmin/js/privacy-indicator.js"></script>

    {% hook_output 'insert_editor_js' %}
{% endcompress %}

{% include "wagtailadmin/shared/datetimepicker_translations.html" %}

{% comment %}
    Additional js from widgets media. Allows for custom widgets in admin panel.
{% endcomment %}
{{ edit_handler.form.media.js }}

<script>
    (function() {
        function fixPrefix(str) {return str;}

        {{ edit_handler.render_js }}
    })();
</script>
