/
standalone.html
75 lines (60 loc) · 2.9 KB
/
standalone.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
{% macro cdn_jslib(local_filename, cdn_url, libobj, integrity=None) %}
<script src="{{ cdn_url }}" crossorigin="anonymous"
{% if integrity is not none %}
integrity="{{ integrity }}"
{% endif %}
></script>
<script>jsFallbackFromCDN('{{ libobj }}', '{{ local_filename }}');</script>
{% endmacro %}
{% macro embed_jslib(local_filename) %}
<!-- INSERTED {{ local_filename }} -->
<script type="text/javascript">{{ offline_file(local_filename) }}</script>
{% endmacro %}
{% macro cdn_stylesheet(local_filename, cdn_url) %}
<link rel="stylesheet" href="{{ cdn_url }}">
<link rel="stylesheet" href="{{ static_ref(local_filename) }}">
{% endmacro %}
{% macro embed_stylesheet(local_filename) %}
<!-- INSERTED {{ local_filename }} -->
<style>{{ offline_file(local_filename) }}</style>
{% endmacro %}
<!DOCTYPE html>
<html>
<head>
<title>{{ title }}</title>
<meta charset="UTF-8" />
<link rel="icon" type="image/png" sizes="16x16" href="{{ static_ref('images/favicon-16x16.png') }}">
<link rel="icon" type="image/png" sizes="32x32" href="{{ static_ref('images/favicon-32x32.png') }}">
<link rel="icon" type="image/png" sizes="96x96" href="{{ static_ref('images/favicon-96x96.png') }}">
<script>
function jsFallbackFromCDN(libname_to_check, localFilename) {
var parts = libname_to_check.split('.')
if (((parts.length == 1) && (typeof window[parts[0]] == "undefined")) ||
((parts.length == 2) && (typeof window[parts[0]][parts[1]] == "undefined"))) {
console.log(`***Failed to load ${localFilename} from CDN. Falling back to local offline version.***`);
document.write(unescape(`%3Cscript src="./offline/${localFilename}" type="text/javascript"%3E%3C/script%3E`));
}
}
</script>
{{ cdn_jslib("jquery-3.2.1.min.js", "https://code.jquery.com/jquery-3.2.1.min.js", "jQuery",
integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=") }}
{{ cdn_jslib("jquery-ui.min.js", "https://code.jquery.com/ui/1.12.1/jquery-ui.min.js", "jQuery.ui",
integrity="sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU=") }}
{{ cdn_jslib("plotly-latest.min.js", "https://cdn.plot.ly/plotly-latest.min.js", "Plotly") }}
{{ cdn_jslib("katex.min.js", "https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.7.1/katex.min.js", "katex") }}
{{ embed_jslib("pygsti_plotly_ex.js") }}
{{ cdn_stylesheet("smoothness-jquery-ui.css", "https://code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css") }}
{{ cdn_stylesheet("katex.css", "https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.7.1/katex.min.css") }}
{{ embed_stylesheet("pygsti_dataviz.css") }}
{{ embed_stylesheet("pygsti_dashboard.css") }}
{{ embed_stylesheet("pygsti_fonts.css") }}
<script>
window.plotman = new PlotManager();
</script>
</head>
<body>
<div>
{{ singleItem|render }}
</div>
</body>
</html>