Update jQuery from 1.12.4 to 3.7.1
[phorkie.git] / data / templates / embed.htm
index 0334c220423f48a62a1b0d97d7bec2d0f0b63697..fcbd2ccac09798c4f022d062c063e18dc51ff472 100644 (file)
@@ -1,7 +1,9 @@
 /* embedding all files of {{repo.getLink('display', null, true)}} */
-document.write('<link rel="stylesheet" href="{{htmlhelper.fullUrl('css/embed.css')}}"/>');
-document.write(
-    '<div class="phork" id="{{repo.id}}">'
+var me = document.getElementById('phork-script-{{repo.id}}');
+me.insertAdjacentHTML(
+    'afterend',
+    '<link rel="stylesheet" href="{{htmlhelper.fullUrl('css/embed.css')}}"/>'
+    + '<div class="phork" id="{{repo.id}}">'
 {% for file in repo.getFiles %}
     + {% filter json_encode(constant('JSON_UNESCAPED_SLASHES'))|raw -%}{% include 'embed-part-file.htm' %}{%- endfilter %}
 {% endfor %}