|
@@ -25,4 +25,34 @@
|
|
|
</section>
|
|
|
{% endblock %}
|
|
|
|
|
|
-{% block footer %} {% endblock %}
|
|
|
+{% block footer %}
|
|
|
+ {% if conf["ICP"] %}
|
|
|
+ <footer id="foot">
|
|
|
+ <a id="ICP" href="https://beian.miit.gov.cn"> {{ conf['ICP'] }} </a>
|
|
|
+ </footer>
|
|
|
+ <script>
|
|
|
+ function SetFooter (mutationsList, observer) {
|
|
|
+ let foot = document.getElementById('foot')
|
|
|
+ let content_height = content.getBoundingClientRect().bottom
|
|
|
+ let win_height = 0
|
|
|
+ if (window.innerHeight)
|
|
|
+ win_height = window.innerHeight;
|
|
|
+ else if ((document.body) && (document.body.clientHeight))
|
|
|
+ win_height = document.body.clientHeight;
|
|
|
+
|
|
|
+ if (win_height - content_height - foot.clientHeight <= 0)
|
|
|
+ foot.style.marginTop = "0"
|
|
|
+ else
|
|
|
+ foot.style.marginTop = (win_height - content_height - foot.clientHeight).toString() + "px"
|
|
|
+ }
|
|
|
+ let MutationObserver = window.MutationObserver;
|
|
|
+ let observer = new MutationObserver(SetFooter);
|
|
|
+ let content = document.getElementById('content')
|
|
|
+ observer.observe(content, {
|
|
|
+ attributes: true, // 属性的变动
|
|
|
+ subtree: true, // 是否将观察器应用于该节点的所有后代节点
|
|
|
+ });
|
|
|
+ SetFooter()
|
|
|
+ </script>
|
|
|
+ {% endif %}
|
|
|
+{% endblock %}
|