aboutsummaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2015-02-03 20:51:04 +0100
committerChristian Weiske <cweiske@cweiske.de>2015-02-03 20:55:15 +0100
commit1c40892fc9ff71d7add588e929b9a4881de6c5b4 (patch)
tree27f0d67adc2c2ed3682c0177d599bb4b194015e5 /data
parent966b9033d71b5226a3209658b81cec21024bd0b6 (diff)
downloadphorkie-1c40892fc9ff71d7add588e929b9a4881de6c5b4.tar.gz
phorkie-1c40892fc9ff71d7add588e929b9a4881de6c5b4.zip
xhtml compatibility in single file embed mode
Diffstat (limited to 'data')
-rw-r--r--data/templates/embed-file.htm8
1 files changed, 5 insertions, 3 deletions
diff --git a/data/templates/embed-file.htm b/data/templates/embed-file.htm
index 46075de..f573ac3 100644
--- a/data/templates/embed-file.htm
+++ b/data/templates/embed-file.htm
@@ -1,7 +1,9 @@
/* embedding {{file.getFilename()}} 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}}-{{file.getFilename()}}');
+me.insertAdjacentHTML(
+ 'afterend',
+ '<link rel="stylesheet" href="{{htmlhelper.fullUrl('css/embed.css')}}"/>'
+ + '<div class="phork" id="{{repo.id}}">'
+ {% filter json_encode(constant('JSON_UNESCAPED_SLASHES'))|raw -%}{% include 'embed-part-file.htm' %}{%- endfilter %}
+ '</div>'
);