-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocumentation.html
297 lines (284 loc) · 13.7 KB
/
documentation.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
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
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
<!DOCTYPE html>
<head>
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@300&display=swap" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-giJF6kkoqNQ00vy+HMDP7azOuL0xtbfIcaT9wjKHr8RbDVddVHyTfAAsrekwKmP1" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="styles/documentationStyles.css" />
</head>
<html>
<body>
<h1>
Documentation
</h1>
<div id="GettingStarted">
<h2>
Getting Started
</h2>
<h3>
Steps to follow:
</h3>
<ul>
<li>
Add CSS link tag to "tutotialjsStyles.css." Before or after ur own CSS files depending on your needs.
Adding it after may override your own styles.
</li>
<li>
Add script tag to "tutorial.js" before your own script. You should end up with something like this:
</li>
</ul>
<!-- HTML generated using hilite.me -->
<b>Generated by hilite.me </b>
<div style="background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;"><table><tr><td><pre style="margin: 0; line-height: 125%"> 1
2
3
4
5
6
7
8
9
10
11
12</pre></td><td><pre style="margin: 0; line-height: 125%"><span style="color: #557799"><!DOCTYPE html></span>
<span style="color: #007700"><head></span>
<span style="color: #007700"><link</span> <span style="color: #0000CC">rel=</span><span style="background-color: #fff0f0">"stylesheet"</span> <span style="color: #0000CC">type=</span><span style="background-color: #fff0f0">"text/css"</span> <span style="color: #0000CC">href=</span><span style="background-color: #fff0f0">"styles/myStyles.css"</span> <span style="color: #007700">/></span>
<span style="color: #007700"><link</span> <span style="color: #0000CC">rel=</span><span style="background-color: #fff0f0">"stylesheet"</span> <span style="color: #0000CC">type=</span><span style="background-color: #fff0f0">"text/css"</span> <span style="color: #0000CC">href=</span><span style="background-color: #fff0f0">"styles/tutorialjsStyles.css"</span> <span style="color: #007700">/></span>
<span style="color: #007700"></head></span>
<span style="color: #007700"><html></span>
<span style="color: #007700"><body></span>
<span style="color: #007700"><script </span><span style="color: #0000CC">type=</span><span style="background-color: #fff0f0">"module"</span> <span style="color: #0000CC">src=</span><span style="background-color: #fff0f0">"./scripts/tutorial/tutorial.js"</span><span style="color: #007700">></script></span>
<span style="color: #007700"><script </span><span style="color: #0000CC">type=</span><span style="background-color: #fff0f0">"module"</span> <span style="color: #0000CC">src=</span><span style="background-color: #fff0f0">"./scripts/myScript.js"</span> <span style="color: #007700">></script></span>
<span style="color: #007700"></body></span>
<span style="color: #007700"></html></span>
</pre></td></tr></table></div>
</br>
<p>
Now you can use the Tutorial object in your code!
</p>
</div>
<div id="BasicTutorial">
<h2>
BasicTutorial
</h2>
<h3>
Constructor
</h3>
<!-- Used Bootstrap to style the tables -->
<table class="table">
<thead>
<tr>
<th scope="col">Parameter</th>
<th scope="col">Description</th>
<th scope="col">Structure/Example</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">elements</th>
<td>The array of elements that will be highlighted during this tutorial. Each element specifies a <b>position</b> corresponding to
the position of the element in the tutorial. Each element also specifies a <b>domElement</b> that indicates the DOM element to be highlighted.
Also, <b>info</b> indicates the the info to be displayed on the floating tool tip. Lastly, you can provide an optional <b>callback</b> parameter that is fired when the element is highlighted.</td>
<td>
<PRE>[{position: int (starts at 0),
domElement: DOM element,
info: DOM element),
callback: function (optional)}, ...]
</PRE>
</td>
</tr>
<tr>
<th scope="row">outlineColor</th>
<td>The color of the highlight box.</td>
<td>Any valid CSS color: ie. "red" or "#fff8dc".</td>
</tr>
<tr>
<th scope="row">defaultControls</th>
<td>A boolean to specify whether the default tutorial controller should be added to the DOM.</td>
<td>true , false</td>
</tr>
</tbody>
</table>
<h3>
Attributes
</h3>
<table class="table">
<thead>
<tr>
<th scope="col">Name</th>
<th scope="col">Description</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">isRunning</th>
<td>A boolean that is true when the tutorial is executing, and false when the tutorial is idle or finished.</td>
</tr>
</table>
<h3>
Methods
</h3>
<table class="table">
<thead>
<tr>
<th scope="col">Name</th>
<th scope="col">Description</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">startTutorial()</th>
<td>Starts the tutorial, adding the controller and highlighter to DOM</td>
</tr>
<tr>
<th scope="row">next()</th>
<td>Move to the next step in the tutorial (highlight the next DOM element and update the info displayed).</td>
</tr>
<tr>
<th scope="row">prev()</th>
<td>Move to the previous step in the tutorial (highlight the DOM element previous to the current one and update the info displayed).</td>
</tr>
<tr>
<th scope="row">skip()</th>
<td>Ends the tutorial and removes controller and highlighter from the DOM.</td>
</tr>
</table>
</div>
<div id="TimelineTutorial">
<h2>
TimelineTutorial
</h2>
<h3>
Constructor
</h3>
<table class="table">
<thead>
<tr>
<th scope="col">Parameter</th>
<th scope="col">Description</th>
<th scope="col">Structure/Example</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">elements</th>
<td>The array of elements that will be highlighted during this tutorial. Each element specifies a <b>position</b> corresponding to
the position of the element in the tutorial. Each element also specifies a <b>domElement</b> that indicates the DOM element to be highlighted.
Also, <b>info</b> indicates the the info to be displayed on the floating tool tip. You must provide a <b>unique title</b> for each element so that it can be
displayed on the timeline. Lastly, you can provide an optional <b>callback</b> parameter that is fired when the element is highlighted. NOTE:
the title "Exit" is reserved.
</td>
<td><PRE>[{position: int (starts at 0)
domElement: DOM Element
info: DOM Element,
title: String
callback: function (optional)}, ...]
</PRE></td>
</tr>
<tr>
<th scope="row">outlineColor</th>
<td>The color of the highlight box.</td>
<td>Any valid CSS color: ie. "red" or "#fff8dc".</td>
</tr>
</tbody>
</table>
<h3>
Attributes
</h3>
<table class="table">
<thead>
<tr>
<th scope="col">Name</th>
<th scope="col">Description</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">isRunning</th>
<td>A boolean that is true when the tutorial is executing, and false when the tutorial is idle or finished.</td>
</tr>
</table>
<h3>
Methods
</h3>
<table class="table">
<thead>
<tr>
<th scope="col">Name</th>
<th scope="col">Description</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">startTutorial()</th>
<td>Starts the tutorial, adding the timeline bar, tooltip, and highlighter to DOM</td>
</tr>
<tr>
<th scope="row">reset()</th>
<td>Ends the tutorial and removes timeline bar, highlighter, and tooltip from the DOM.</td>
</tr>
</table>
</div>
<div id="TimedSequence">
<h2>
TimedSequence
</h2>
<h3>
Constructor
</h3>
<table class="table">
<thead>
<tr>
<th scope="col">Parameter</th>
<th scope="col">Description</th>
<th scope="col">Structure/Example</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">elements</th>
<td>The array of elements that will be highlighted during this tutorial. Each element specifies a <b>position</b> corresponding to
the position of the element in the tutorial. Each element also specifies a <b>domElement</b> that indicates the DOM element to be highlighted.
Also, <b>info</b> indicates the the info to be displayed on the floating tool tip (this is only needed if useTooltip is true). You must specify a
<b>duration</b> to indicate the amount of time spent on a particular element.
</td>
<td><PRE>[{position: int (starts at 0)
domElement: DOM Element
info: DOM Element,
duration: int (milliseconds)} ...]
</PRE></td>
</tr>
<tr>
<th scope="row">useTooltip</th>
<td>A boolean to indicate whether a tooltip, displaying <b>info</b>, should accompany highlighted elements.</td>
<td>true, false</td>
</tr>
<tr>
<th scope="row">outlineColor</th>
<td>The color of the highlight box.</td>
<td>Any valid CSS color: ie. "red" or "#fff8dc".</td>
</tr>
</tbody>
</table>
<h3>
Methods
</h3>
<table class="table">
<thead>
<tr>
<th scope="col">Name</th>
<th scope="col">Description</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">startSequence(repititions: int)</th>
<td>Initiates the timed sequence and repeats it <b>repititions</b> number of times.</td>
</tr>
<tr>
<th scope="row">reset()</th>
<td>Ends the sequence before it is completed.</td>
</tr>
</table>
</div>
</body>
</html>