-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
157 lines (130 loc) · 5.22 KB
/
Copy pathindex.html
File metadata and controls
157 lines (130 loc) · 5.22 KB
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bitcoin HK Regulatory Timeline</title>
<meta charset="utf-8">
<meta name="description" content="Bitcoin HK Regulatory Timeline">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-touch-fullscreen" content="yes">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<!-- FAVICONS -->
<link rel="apple-touch-icon" sizes="180x180" href="https://www.bitcoin.org.hk/favicon.png">
<link rel="icon" type="image/png" href="https://www.bitcoin.org.hk/favicon.png" sizes="32x32">
<link rel="icon" type="image/png" href="https://www.bitcoin.org.hk/favicon.png" sizes="16x16">
<!--
If we want to support loading different versions of timeline like we used to,
this isn't good enough. We used that to get the non-minimized version, for debugging,
but now maybe sourcemaps are a better alternative?
-->
<script id='timeline-script-tag' type="text/javascript" src="js/timeline.js"></script>
<link rel="stylesheet" href="css/timeline.css">
<!-- Google Analytics should be handled by Timeline -->
<base target="_blank">
<!-- Style-->
<style>
html,
body {
width: 100%;
height: 100%;
padding: 0px;
margin: 0px;
}
#timeline-embed {
height: 100%;
}
</style>
<!-- HTML5 shim, for IE6-8 support of HTML elements-->
<!--[if lt IE 9]> <script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
</head>
<body>
<!-- BEGIN Timeline Embed -->
<div id="timeline-embed"></div>
<!-- Override -->
<script type="text/javascript">
function ready(fn) {
if (document.readyState != 'loading') {
fn();
} else {
document.addEventListener('DOMContentLoaded', fn);
}
}
function setPageLanguage() {
var lang = window.location.href.match(/&lang=([a-zA-Z]*?)&?/);
if (lang) {
document.getElementsByTagName('html')[0].setAttribute('lang', lang[1]);
}
}
function createEmbedDiv(containerId, width, height) {
if (typeof(width) != 'string' && typeof(width) != 'number') {
width = '100%'
}
if (typeof(height) != 'string' && typeof(height) != 'number') {
height = '100%'
}
// default containerId would be 'timeline-embed'
t = document.createElement('div');
t.style.position = 'relative';
te = document.getElementById(containerId);
te.appendChild(t);
te.classList.add("tl-timeline-embed");
if (width.toString().match("%")) {
te.style.width = width.split("%")[0] + "%";
} else {
width = Number(width) - 2;
te.style.width = (width) + 'px';
}
if (height.toString().match("%")) {
te.style.height = height;
te.classList.add("tl-timeline-full-embed");
} else if (width.toString().match("%")) {
te.classList.add("tl-timeline-full-embed");
height = Number(height) - 16;
te.style.height = (height) + 'px';
} else {
height = height - 16;
te.style.height = (height) + 'px';
}
}
/**
* Parse all URL parameters as possible Timeline options.
* Timeline itself will use or ignore these based on actual
* supported options.
*/
function optionsFromUrlParams() {
var param_str = window.location.href.slice(window.location.href.indexOf('?') + 1);
if (param_str.match('#')) {
param_str = param_str.split('#')[0];
}
param_str = param_str.split('&');
var url_vars = {}
for (var i = 0; i < param_str.length; i++) {
var uv = param_str[i].split('=');
url_vars[uv[0]] = uv[1];
}
return url_vars;
};
ready(function() {
setPageLanguage();
var options = optionsFromUrlParams();
options.debug = false;
options.initial_zoom = 3;
options.hash_bookmark = false;
options.marker_height_min = 50;
options.marker_width_min = 200;
options.start_at_slide = 0;
options.optimal_tick_width = 200;
options.duration = 1000;
options.is_embed = true;
createEmbedDiv('timeline-embed', options.width, options.height);
// Google Analytics: ga_property_id is not something we let users override
// options.ga_property_id = 'UA-27829802-4';
if (typeof(options.source) == 'undefined') {
options.source = '1HSTI7Sr2jdCh2Anyh9TjD_0bbkU5mAAXun0_M4TPWcs' // hk regs spreadsheet
}
options.soundcite = true;
window.options = options
window.timeline = new TL.Timeline('timeline-embed', options.source, options)
})
</script>
</body>
</html>