mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-19 15:22:17 +02:00
N°3705 - Migrate module to new UIBlock system : Kanban board - css and dictionnary in ajax page
This commit is contained in:
@@ -37,20 +37,11 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
window['{{ sPromiseId }}'] = new Promise(function(resolve, reject){
|
window['{{ sPromiseId }}'] = new Promise(function(resolve, reject){
|
||||||
var aFilesToLoad{{ sId }} = [];
|
var aFilesToLoad{{ sId }} = [];
|
||||||
{# manage Dictionary file if exist #}
|
|
||||||
var sUrlDictFile = '';
|
|
||||||
{% if aPage.sDictScript is not empty %}
|
|
||||||
if ($.inArray('{{ aPage.sDictScript|raw }}', aListJsFiles) == -1)
|
|
||||||
{
|
|
||||||
sUrlDictFile = "{{ aPage.sDictScript|raw }}";
|
|
||||||
aListJsFiles.push(sUrlDictFile);
|
|
||||||
}
|
|
||||||
{% endif %}
|
|
||||||
{# manage the other Js File #}
|
{# manage the other Js File #}
|
||||||
{% for sJsFile in aPage.aJsFiles %}
|
{% for sJsFile in aPage.aJsFiles %}
|
||||||
if ($.inArray('{{ sJsFile|raw }}', aListJsFiles) == -1)
|
if ($.inArray('{{ sJsFile|raw }}', aListJsFiles) == -1)
|
||||||
{
|
{
|
||||||
aFilesToLoad{{ sId }}.push('{{ sJsFile|raw|add_itop_version }}');
|
aFilesToLoad{{ sId }}.push('{{ sJsFile|add_itop_version|raw }}');
|
||||||
aListJsFiles.push("{{ sJsFile|raw }}");
|
aListJsFiles.push("{{ sJsFile|raw }}");
|
||||||
}
|
}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
@@ -81,27 +72,7 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
{# first load Dictionary if exist #}
|
fLoadScript{{ sId }}();
|
||||||
if (sUrlDictFile != '')
|
|
||||||
{
|
|
||||||
$.ajax({
|
|
||||||
url: '{{ aPage.sDictScript|raw }}',
|
|
||||||
dataType: 'script',
|
|
||||||
cache: true
|
|
||||||
}).done(function (data) {
|
|
||||||
if (Dict != undefined && data.startsWith("var aDictEntries = {\""))
|
|
||||||
{
|
|
||||||
eval(data);
|
|
||||||
$.extend(Dict._entries, aDictEntries);
|
|
||||||
}
|
|
||||||
}).then(function () {
|
|
||||||
fLoadScript{{ sId }}();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
fLoadScript{{ sId }}();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -115,50 +86,14 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% block iboPageJsInlineOnDomReady %}
|
{% block iboPageJsInlineOnDomReady %}
|
||||||
|
{% for sJsInlineOnDomReady in aPage.aJsInlineOnDomReady %}
|
||||||
{# first load Dictionnary if exist #}
|
|
||||||
{% if aPage.sDictScript is not empty %}
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
window['{{ sPromiseId }}'] = new Promise(function(resolve, reject){
|
window['{{ sPromiseId }}'] = new Promise(function (resolve, reject) {
|
||||||
if ($.inArray('{{ aPage.sDictScript|raw }}', aListJsFiles) == -1)
|
{{ sJsInlineOnDomReady|raw }}
|
||||||
{
|
resolve();
|
||||||
aListJsFiles.push("{{ aPage.sDictScript|raw }}");
|
|
||||||
$.ajax({
|
|
||||||
url: '{{ aPage.sDictScript|raw }}',
|
|
||||||
dataType: 'script',
|
|
||||||
cache: true
|
|
||||||
}).done(function (data) {
|
|
||||||
if (Dict != undefined && data.startsWith("var aDictEntries = {\""))
|
|
||||||
{
|
|
||||||
eval(data);
|
|
||||||
$.extend(Dict._entries, aDictEntries);
|
|
||||||
}
|
|
||||||
}).then(function () {
|
|
||||||
{% for sJsInlineOnDomReady in aPage.aJsInlineOnDomReady %}
|
|
||||||
{{ sJsInlineOnDomReady|raw }}
|
|
||||||
{% endfor %}
|
|
||||||
resolve();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
{% for sJsInlineOnDomReady in aPage.aJsInlineOnDomReady %}
|
|
||||||
{{ sJsInlineOnDomReady|raw }}
|
|
||||||
{% endfor %}
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
{% else %}
|
{% endfor %}
|
||||||
{% for sJsInlineOnDomReady in aPage.aJsInlineOnDomReady %}
|
|
||||||
<script type="text/javascript">
|
|
||||||
window['{{ sPromiseId }}'] = new Promise(function(resolve, reject){
|
|
||||||
{{ sJsInlineOnDomReady|raw }}
|
|
||||||
resolve();
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
{% endfor %}
|
|
||||||
{% endif %}
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user