diff options
-rw-r--r-- | design/templates/details/entry.html | 55 |
1 files changed, 28 insertions, 27 deletions
diff --git a/design/templates/details/entry.html b/design/templates/details/entry.html index cea73ef..eb9d83c 100644 --- a/design/templates/details/entry.html +++ b/design/templates/details/entry.html @@ -107,30 +107,33 @@ class="detail {%if t == 1 or t == 3 or t == 5 %}double{%else%}single{%endif%}{%i {%endif%} {% endblock %} {% block js %} -<script src="/media/js/lightbox.js" type="text/javascript"></script> -<script> -var opts= { - //nextOnClick: false, - captions: true, - onload: function(){ - var im = document.getElementById("jslghtbx-contentwrapper"); - var link = im.appendChild(document.createElement('a')) - link.href = im.firstChild.src; - link.innerHTML= "open "; - link.target = "_blank"; - link.setAttribute('class', 'p-link'); - im.appendChild(link); - } -}; -var lightbox = new Lightbox(); -lightbox.load(opts); -</script> -{% with object.get_template_name_display as t %}{%if t == "single" or t == "single-dark" %} -<script src="/media/js/leaflet-master/leaflet-mod.js"></script> -<script src="/media/js/detail.min.js"></script> -{%endif%}{%endwith%} <script type="text/javascript"> -window.onload = function() { +document.addEventListener("DOMContentLoaded", function(event) { + var leaflet = document.createElement('script'); + leaflet.src = "/media/js/leaflet-master/leaflet-mod.js"; + document.body.appendChild(leaflet); + var detail = document.createElement('script'); + detail.src = "/media/js/detail.min.js"; + document.body.appendChild(detail); + var lightbox = document.createElement('script'); + lightbox.src = "/media/js/lightbox.js"; + document.body.appendChild(lightbox); + + var opts= { + //nextOnClick: false, + captions: true, + onload: function(){ + var im = document.getElementById("jslghtbx-contentwrapper"); + var link = im.appendChild(document.createElement('a')) + link.href = im.firstChild.src; + link.innerHTML= "open "; + link.target = "_blank"; + link.setAttribute('class', 'p-link'); + im.appendChild(link); + } + }; + var lightbox = new Lightbox(); + lightbox.load(opts); {% if object.enable_comments %} {% get_comment_count for object as comment_count %} {%if comment_count > 0 %} @@ -166,9 +169,7 @@ function checkVisible(elm) { return !(rect.bottom < 0 || rect.top - viewHeight >= 0); } {%endif%} -} +}); </script> -{% with object.template_name as t %}{%if t == 1 or t == 3 %} -<script src="/media/js/hyphenate.min.js" type="text/javascript"></script> -{%endif%}{%endwith%}{%endblock%} +{%endblock%} |