Skip to content

Will there be multiple css and/or js files included? #125

@MichaelBrauner

Description

@MichaelBrauner

I think about to use this bundle for my projects.
BUT - I wonder if there will be multiple includes of this css and js files:

 {# CSS. #}
    {% if froala_includeFontAwesome %}
        <link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" />
    {% endif %}
    {% if froala_includeCodeMirror %}
        <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.3.0/codemirror.min.css" />
    {% endif %}

    {% if froala_includeCSS %}
        <link rel="stylesheet" type="text/css" href="{{ asset( froala_basePath ~ 'css/froala_editor.min.css' ) }}" />
        <link rel="stylesheet" type="text/css" href="{{ asset( froala_basePath ~ 'css/froala_style.min.css' ) }}" />

        {% if froala_arrOption[ "theme" ] is defined %}
            <link rel="stylesheet" type="text/css" href="{{ asset( froala_basePath ~ 'css/themes/' ~ froala_arrOption[ "theme" ] ~ '.min.css' ) }}" />
        {% endif %}

        {% for plugin in froala_arrPluginCSS %}
            <link rel="stylesheet" type="text/css" href="{{ asset( froala_basePath ~ 'css/' ~ plugin ~ '.min.css' ) }}" />
        {% endfor %}

    {% endif %}

    {# Editor textarea. #}
    <textarea {{ block( "widget_attributes" ) }}>{{ value }}</textarea>

    {# JS. #}

    {% if froala_includeCodeMirror %}
        <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.3.0/codemirror.min.js"></script>
        <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.3.0/mode/xml/xml.min.js"></script>
    {% endif %}

    {% if froala_includeJS %}
        <script type="text/javascript"  src="{{ asset( "bundles/kmsfroalaeditor/misc.js" ) }}"></script>
        <script type="text/javascript"  src="{{ asset( froala_basePath ~ 'js/froala_editor.min.js' ) }}"></script>

        <!--[if lt IE 9]>
		<script type="text/javascript" src="{{ asset( froala_basePath ~ 'js/froala_editor_ie8.min.js' ) }}"></script>
		<![endif]-->
        <script type="text/javascript" src="{{ asset( froala_basePath ~ 'js/languages/' ~ froala_arrOption.language ~ '.js' ) }}"></script>

        {% for plugin in froala_arrPluginJS %}
            <script type="text/javascript" src="{{ asset( froala_basePath ~ 'js/' ~ plugin ~ '.min.js' ) }}"></script>
        {% endfor %}
    {% endif %}

    {% if froala_customJS is defined %}
        <script type="text/javascript"  src="{{ asset( customJS ) }}"></script>
    {% endif %}

I mean - this will be included for every form field, when I have multiple on my pages?

Is that right?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions