<!DOCTYPE html>
<html>
<head>
    <!-- jQuery and jQuery UI (REQUIRED) -->
    <link rel="stylesheet" type="text/css"
          href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.min.css">

    {#{% if includeAssets %}#}
        {#{% stylesheets filter='cssrewrite'#}
        {#'@JotunheimrAdminBundle/Resources/public/js/vendor/plugins/elfinder/'#}
        {#'@JotunheimrAdminBundle/Resources/public/js/vendor/plugins/elfinder/build/css/theme.css' %}#}
        {#<link rel="stylesheet" media="screen" href="{{ asset_url }}" type="text/css"/>#}
        {#{% endstylesheets %}#}
    {#{% endif %}#}
</head>

<body>
    {#{% if includeAssets %}#}
        {#<!-- jQuery and jQuery UI (REQUIRED) -->#}
        {#<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>#}
        {#<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>#}

        {#{% javascripts#}
        {#'@JotunheimrAdminBundle/Resources/public/js/vendor/plugins/elfinder/build/js/elfinder.min.js'#}
        {#'@JotunheimrAdminBundle/Resources/public/js/vendor/plugins/elfinder/build/js/i18n/elfinder.hu.js'%}#}
        {#<script type="text/javascript" src="{{ asset_url }}"></script>#}
        {#{% endjavascripts %}#}
    {#{% endif %}#}
    <script type="text/javascript" charset="utf-8">
        $(document).ready(function () {
            var elf = $('.elfinder').elfinder({
                url: '{{ path('ef_connect', {'instance': instance, 'homeFolder': homeFolder }) }}',  // connector URL
                lang: '{{ locale }}',
                onlyMimes: {{ onlyMimes|raw }},
                destroyOnClose: true,
                getFileCallback: function (files, fm) {
                    window.opener.$('.summernote').summernote('editor.insertImage', files.url);
                    window.close();
                }
            }).elfinder('instance');
        });
    </script>
    <div class="elfinder"></div>
</body>
</html>
