]> www.vanbest.org Git - motioneye-debian/commitdiff
added a special /version/ uri
authorCalin Crisan <ccrisan@gmail.com>
Sun, 24 Aug 2014 17:16:58 +0000 (20:16 +0300)
committerCalin Crisan <ccrisan@gmail.com>
Sun, 24 Aug 2014 17:16:58 +0000 (20:16 +0300)
static/js/version.js [new file with mode: 0644]
templates/version.html [new file with mode: 0644]

diff --git a/static/js/version.js b/static/js/version.js
new file mode 100644 (file)
index 0000000..7d43298
--- /dev/null
@@ -0,0 +1,6 @@
+
+$(window).load(function () {
+    if (window.parent && window.parent.postMessage) {
+        window.parent.postMessage({'hostname': hostname, 'version': version, 'url': window.location.href.replace('version/', '')}, '*');
+    }
+});
diff --git a/templates/version.html b/templates/version.html
new file mode 100644 (file)
index 0000000..3c7a8f8
--- /dev/null
@@ -0,0 +1,15 @@
+{% extends "base.html" %}
+
+{% block script %}
+    {{super()}}
+    <script type="text/javascript">
+        var hostname = '{{hostname}}';
+        var version = '{{version}}';
+    </script>
+    <script type="text/javascript" src="{{STATIC_URL}}js/version.js"></script>
+{% endblock %}
+
+{% block body %}
+hostname = "{{hostname}}"<br>
+version = "{{version}}"
+{% endblock %}