This repository was archived by the owner on Aug 28, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathindex.html
More file actions
216 lines (192 loc) · 6.94 KB
/
index.html
File metadata and controls
216 lines (192 loc) · 6.94 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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1">
<title>EventControl demo</title>
<meta name="description" content="EventControl Demo">
<meta name="author" content="Kristoffer Gronlund">
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" integrity="sha384-fLW2N01lMqjakBkx3l/M9EahuwpSfeNvV63J5ezn3uZzapT0u7EYsXMjQV+0En5r" crossorigin="anonymous">
<link href='https://fonts.googleapis.com/css?family=Open+Sans:300,400,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="eventcontrol.css">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<style>
body {
font-family: 'Open Sans', sans-serif;
padding-top: 20px;
padding-bottom: 20px;
}
.header, .footer {
padding-right: 15px;
padding-left: 15px;
}
.header {
padding-bottom: 20px;
border-bottom: 1px solid #e5e5e5;
}
.header h3 {
margin-top: 0;
margin-bottom: 0;
line-height: 40px;
}
.jumbotron {
text-align: center;
background: none;
border: 0px solid #fff;
border-radius: 0px;
}
.row h1 {
margin-top: 60px;
margin-bottom: 40px;
}
.footer {
margin-top: 20px;
padding-top: 19px;
color: #777;
border-top: 1px solid #e5e5e5;
}
@media (min-width: 768px) {
.container {
max-width: 730px;
}
}
.eventcontrol-target {
width: 100%;
height: 64px;
border: 1px solid #e5e5e5;
border-radius: 3px;
background: #eee;
margin-top: 10px;
padding: 4px;
overflow: hidden;
text-align: center;
}
.eventcontrol-target h2 {
margin: 0;
font-size: 48px;
}
</style>
</head>
<body>
<div class="container">
<div class="header clearfix">
<nav>
<ul class="nav nav-pills pull-right">
<li role="presentation" class="active"><a href="#demo">Demo</a></li>
<li role="presentation"><a href="#usage">Usage</a></li>
<li role="presentation"><a href="#download">Download</a></li>
</ul>
</nav>
<h3 class="text-muted">EventControl</h3>
</div>
<div class="jumbotron">
<h1>EventControl</h1>
<p class="lead">jQuery timeline control with support for stacking events.</p>
</div>
<div class="row">
<div class="col-md-12">
<h1 id="demo">Demo</h1>
</div>
<div class="col-md-12">
<div class="eventcontrol"></div>
<div class="eventcontrol-target"></div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<h1 id="usage">Usage</h1>
</div>
<div class="col-md-12">
<pre>
$('.eventcontrol').EventControl({
oncreate: function(item, element) {
// Called when creating the item.
// Can set attributes on the element here,
// for example:
element.css('color', 'red');
},
onhover: function(item, element, event, inout) {
// Called when mouse hovers over an item
// inout is 'in' when entering, and 'out' when exiting.
},
onclick: function(item, element, event) {
// Called when an item is left-clicked.
},
data: [], // An array of objects with a timestamp key.
hammertime: true, // Enable use of hammer.js to support touch devices
items_height: 101, // height in px of item/event area
markers_height: 31, // height in px of markers area
displayUTC: false, // Show timestamps as UTC, else local time
});
</pre>
<p>Once created, the EventControl object can be accessed as demonstrated
below. Right now, there is no support for updating the dataset, I plan
to add this later.
</p>
<pre>
var state = $('.eventcontrol').EventControl(); // save state
$('.eventcontrol').EventControl(state); // restore state
// zoom in / out: focus is (0 - 1), optional, default is 0.5
$('.eventcontrol').EventControl('zoom-in', focus);
$('.eventcontrol').EventControl('zoom-out', focus);
</pre>
<p>The library can optionally use <tt>hammer.js</tt> to support basic
touch controls. Supporting pinch to zoom interferes with all kinds of
functionality, so you'll probably want to hook up zoom in/out to
separate controls.
</p>
</div>
</div>
<div class="row">
<div class="col-md-12">
<h1 id="download">Download</h1>
</div>
<div class="col-md-12">
<ul>
<li><a href="https://github.com/krig/eventcontrol/releases/latest">Latest release</a></li>
<li><a href="https://github.com/krig/eventcontrol">Github Repository</a></li>
<li><a href="https://github.com/krig/eventcontrol/raw/master/eventcontrol.js">eventcontrol.js</a></li> - minifies and gzips to about <strong>2.7k</strong> excluding dependencies.
<li><a href="https://github.com/krig/eventcontrol/raw/master/eventcontrol.css">eventcontrol.css</a></li>
</ul>
</div>
<div class="col-md-12">
<h2>Dependencies</h2>
<ul>
<li><a href="http://momentjs.com/">moment.js</a></li>
<li><a href="https://jquery.org/">jquery</a></li>
<li><a href="https://github.com/jquery/jquery-mousewheel">jquery-mousewheel</a></li>
</ul>
<h3>Optional</h3>
<ul>
<li><a href="http://hammerjs.github.io/">hammer.js</a></li>
</ul>
</div>
</div>
<footer class="footer">
<p>© 2016 <a href="http://krig.github.io/">Kristoffer Gronlund</a></p>
</footer>
</div>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
<!-- moment.js -->
<script src="moment.min.js"></script>
<!-- jquery.mousewheel.js -->
<script src="jquery.mousewheel.min.js"></script>
<!-- hammer.js -->
<script src="hammer.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="eventcontrol.js"></script>
<script src="demo.js"></script>
</body>
</html>