summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/posts/templates/posts/jrnl_detail.html74
1 files changed, 5 insertions, 69 deletions
diff --git a/app/posts/templates/posts/jrnl_detail.html b/app/posts/templates/posts/jrnl_detail.html
index d4bdb5f..e192c70 100644
--- a/app/posts/templates/posts/jrnl_detail.html
+++ b/app/posts/templates/posts/jrnl_detail.html
@@ -162,77 +162,13 @@
</main>
{% endblock %}
{% block js %}
+<script src="/media/js/leaflet-master/leaflet-mod.js"></script>
+<script src="/media/js/detail.js"></script>
<script>
document.addEventListener("DOMContentLoaded", function(event) {
- var leaflet = document.createElement('script');
- leaflet.src = "/media/js/leaflet-master/leaflet-mod.js";
- document.body.appendChild(leaflet);
- var lightbox = document.createElement('script');
- lightbox.src = "/media/js/lightbox.js";
- document.body.appendChild(lightbox);
- leaflet.onload = function(){
- var detail = document.createElement('script');
- detail.src = "/media/js/detail.min.js";
- document.body.appendChild(detail);
- {% with object.get_template_name_display as t %}{%if t == "single" or t == "single-dark" %}
- detail.onload = function(){
- createMap();
- var open = false;
- }
- {%endif%}{%endwith%}
- }
- {%comment%}
- lightbox.onload = function() {
- 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);
- }
- {%endcomment%}
- {% if object.enable_comments %}
-{% get_comment_count for object as comment_count %}
-{%if comment_count > 0 %}
- //delay loading of gravatar images using noscript data-hash attribute
- dataattr = document.getElementsByClassName("datahashloader");
- for(var i=0; i<dataattr.length; i++) {
- var c = dataattr[i].parentNode;
- var img = document.createElement("img");
- img.src = 'https://images.luxagraf.net/gravcache/' + dataattr[i].getAttribute('data-hash') + '.jpg';
- img.className += "comment-card-image";
- img.alt = "gravatar icon";
- c.insertBefore(img, c.childNodes[3]);
- }
-{%endif%}
-{%endif%}
-{% if object.has_video %}
-var tester = document.getElementsByClassName("vidauto");
-var wrapper = document.getElementById('wrapper');
-var dist = 100;
-
-window.onscroll = function() {
- for (var i=0; i<tester.length; i++) {
- checkVisible(tester[i]) ? tester[i].play() : tester[i].pause();
- }
-};
-
-function checkVisible(elm) {
- var rect = elm.getBoundingClientRect();
- var viewHeight = Math.max(document.documentElement.clientHeight, window.innerHeight);
- return !(rect.bottom < 0 || rect.top - viewHeight >= 0);
-}
-{%endif%}
-
+ createMap();
+ var open = false;
+ loadGravatar();
});
</script>
{%endblock%}