Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: templates/frame.tmpl

Issue 29328600: Issue 3122 - Add sitekey frame files ready for sitekey testcases (Closed)
Patch Set: Attempt to make frame URL logic clearer Created Oct. 13, 2015, 11:28 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: templates/frame.tmpl
diff --git a/templates/frame.tmpl b/templates/frame.tmpl
new file mode 100644
index 0000000000000000000000000000000000000000..a0aba4deff203725ca857a6a6f5fcf8be8e9c400
--- /dev/null
+++ b/templates/frame.tmpl
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html{% if public_key and signature %} data-adblockkey="{{ public_key + "_" + signature }}"{% endif %}>
+ <head>
+ <title>{{ title }}</title>
+ <style>
+ html, body { margin: 0; height: 100%; }
+ #iframe { display: block; width: 100%; height: 100%; border: none; }
+ </style>
+ {{ head|safe }}
+ </head>
+ <body>
+ <iframe id="iframe"></iframe>
+
+ {% block body %}{{ body|safe }}{% endblock %}
+
+ <script type="text/javascript">
+ var iframe = document.getElementById("iframe")
+
+ function update_iframe_location()
+ {
+ if (window.location.hash)
+ iframe.src = frame_url(window.location);
+ }
+ window.addEventListener("hashchange", update_iframe_location);
+ update_iframe_location();
+ </script>
+ </body>
+</html>
« no previous file with comments | « static/site.key ('k') | templates/sitekey_frame.tmpl » ('j') | templates/sitekey_frame.tmpl » ('J')

Powered by Google App Engine
This is Rietveld