Created
November 7, 2018 07:54
-
-
Save ger86/3abe4410b3d57dc7bf7988ccb3993817 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# footer.html | |
{% extends 'base_pdf.html.twig' %} | |
{% block body %} | |
<div class="footer"> | |
<div class="footer__pager"> | |
<span class="page"></span>/<span class="topage"></span> | |
</div> | |
</div> | |
<script> | |
function subst() { | |
var vars={}; | |
var x= document.location.search.substring(1).split('&'); | |
for(var i in x) { | |
var z=x[i].split('=',2); | |
vars[z[0]] = unescape(z[1]); | |
} | |
var x=['frompage','topage','page','webpage','section','subsection','subsubsection']; | |
for(var i in x) { | |
var y = document.getElementsByClassName(x[i]); | |
for(var j=0; j<y.length; ++j) { | |
y[j].textContent = vars[x[i]]; | |
} | |
} | |
} | |
subst(); | |
</script> | |
{% endblock %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment