Proposition that allows to include modules from ar array. Works both on usual page + ajax page

This commit is contained in:
jf-cbd
2025-12-23 14:55:00 +01:00
parent a627f8a471
commit 35d3194e6c
11 changed files with 190 additions and 8 deletions

View File

@@ -185,6 +185,20 @@
</script>
{% endif %}
{% block iboPageJsModuleScripts %}
{% if aPage.aJsFilesModules is not empty %}
<script>
console.log("aPage:", {{ aPage|raw }});
</script>
{% for aJsModule in aPage.aJsFilesModules %}
<script type="module">
import { {{ aJsModule.sModuleName }} } from "{{ aJsModule.sJsModuleSrc }}";
{{ aJsModule.sModuleConfigJs|raw }}
</script>
{% endfor %}
{% endif %}
{% endblock %}
{% block iboPageCssFiles %}
{% if aPage.aCssFiles is not empty %}
<script type="text/javascript">

View File

@@ -144,6 +144,21 @@ const aLoadedJsFilesResolveCallbacks = new Map();
{% endblock %}
{% endblock %}
{% block iboPageJsModuleScripts %}
{% if aPage.aJsFilesModules is not empty %}
<script>
console.log("aPage:", {{ aPage|raw }});
</script>
{% for aJsModule in aPage.aJsFilesModules %}
<script type="module">
import { {{ aJsModule.sModuleName }} } from "{{ aJsModule.sJsModuleSrc }}";
{{ aJsModule.sModuleConfigJs|raw }}
</script>
{% endfor %}
{% endif %}
{% endblock %}
{% block iboCapturedOutput %}
{{ aPage.sCapturedOutput|raw }}
{% endblock %}