forked from paulkinzett/toolbar
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
393 lines (343 loc) · 11.7 KB
/
index.html
File metadata and controls
393 lines (343 loc) · 11.7 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
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
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
<!DOCTYPE html>
<html>
<head>
<title>Toolbar.js - jQuery plugin to create tooltip style toobars</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link href="css/documentation.css" rel="stylesheet" />
<link href="../jquery.toolbars.css" rel="stylesheet" />
<link href='http://fonts.googleapis.com/css?family=Lustria' rel='stylesheet' type='text/css'>
<!--[if gte IE 9]>
<style type="text/css">
.gradient {
filter: none !important;
}
.tool-container.tool-top {
border-bottom: none;
}
</style>
<![endif]-->
<link href="../bootstrap.icons.css" rel="stylesheet">
<link href="css/prettify.css" rel="stylesheet">
<link href="css/sunburst.css" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="js/prettify.js"></script>
<script src="../jquery.toolbar.js"></script>
<script type="text/javascript">
jQuery(document).ready(function($) {
// Define any icon actions before calling the toolbar
$('.toolbar-icons a').on('click', function( event ) {
event.preventDefault();
});
$('#normal-button').toolbar({content: '#user-options', position: 'top'});
$('#normal-button-bottom').toolbar({content: '#user-options', position: 'bottom'});
$('#normal-button-small').toolbar({content: '#user-options-small', position: 'top', hideOnClick: true});
$('#button-left').toolbar({content: '#user-options', position: 'left'});
$('#button-right').toolbar({content: '#user-options', position: 'right'});
$('#link-toolbar').toolbar({content: '#user-options', position: 'top'});
});
</script>
</head>
<body onload="prettyPrint()" >
<div class="tooltip-container normal">
<header>
<h1>Toolbar.Js</h1>
<p>A jQuery plugin that creates tooltip style toolbars</p>
<br/><br/>
</header>
<section>
<p>Toolbar allows you to quickly create tooltip style toolbars for use in web applications and websites. The toolbar is easily customisable using the twitter bootstrap icons and provides flexibility around the toolbars display and number of icons.</p>
</section>
<section>
<h2>Features</h2>
<ul>
<li>Straightforward implementation with simple options</li>
<li>Can run as many toolbars as required</li>
<li>Toolbars can be attached to any element required</li>
<li>Toobar icons are easily customised through the popular twitter bootstrap framework</li>
<li>Toolbars are responsive and follow the element on resize</li>
</ul>
</section>
<section>
<h2>Examples</h2>
<div class="example">
<p>Horizontal toolbar (top)</p>
<section class="left">
<div id="normal-button" class="settings-button"><img src="img/icon-cog-small.png" /></div>
</section>
<section class="right">
<span>JS</span>
<pre class="prettyprint">
$('#user-toolbar').toolbar({
content: '#user-toolbar-options',
position: 'top'
});</pre>
<span>HTML</span>
<pre class="prettyprint">
<div id="user-toolbar-options">
<a href="#"><i class="icon-user"></i></a>
<a href="#"><i class="icon-star"></i></a>
<a href="#"><i class="icon-edit"></i></a>
<a href="#"><i class="icon-delete"></i></a>
<a href="#"><i class="icon-ban"></i></a>
</div>
</pre>
</section>
<div class="clear"></div>
</div>
<div class="example">
<p>Horizontal toolbar (bottom)</p>
<section class="left">
<div id="normal-button-bottom" class="settings-button"><img src="img/icon-cog-small.png" /></div>
</section>
<section class="right">
<span>JS</span>
<pre class="prettyprint">
$('#user-toolbar').toolbar({
content: '#user-toolbar-options',
position: 'bottom'
});</pre>
<span>HTML</span>
<pre class="prettyprint">
<div id="user-toolbar-options">
<a href="#"><i class="icon-user"></i></a>
<a href="#"><i class="icon-star"></i></a>
<a href="#"><i class="icon-edit"></i></a>
<a href="#"><i class="icon-delete"></i></a>
<a href="#"><i class="icon-ban"></i></a>
</div>
</pre>
</section>
<div class="clear"></div>
</div>
<div class="example">
<p>Horizontal toolbar with three items</p>
<section class="left">
<div id="normal-button-small" class="settings-button"><img src="img/icon-cog-small.png" /></div>
</section>
<section class="right">
<span>JS</span>
<pre class="prettyprint">
$('#format-toolbar').toolbar({
content: '#format-toolbar-options',
position: 'top',
hideOnClick: true
});</pre>
<span>HTML</span>
<pre class="prettyprint">
<div id="format-toolbar-options">
<a href="#"><i class="icon-align-left"></i></a>
<a href="#"><i class="icon-align-center"></i></a>
<a href="#"><i class="icon-align-right"></i></a>
</div>
</pre>
</section>
<div class="clear"></div>
</div>
<div class="example">
<p>Vertical toolbar (left)</p>
<section class="left">
<a id="button-left" class="settings-button"><span></span></a>
</section>
<section class="right">
<span>JS</span>
<pre class="prettyprint">
$('#vertical-toolbar').toolbar({
content: '#user-toolbar-options',
position: 'left'
});</pre>
<span>HTML</span>
<pre class="prettyprint">
<div id="user-toolbar-options">
<a href="#"><i class="icon-user"></i></a>
<a href="#"><i class="icon-star"></i></a>
<a href="#"><i class="icon-edit"></i></a>
<a href="#"><i class="icon-delete"></i></a>
<a href="#"><i class="icon-ban"></i></a>
</div>
</pre>
</section>
<div class="clear"></div>
</div>
<div class="example">
<p>Vertical toolbar (right)</p>
<section class="left">
<a id="button-right" class="settings-button"><span></span></a>
</section>
<section class="right">
<span>JS</span>
<pre class="prettyprint">
$('#vertical-toolbar').toolbar({
content: '#user-toolbar-options',
position: 'right'
});</pre>
<span>HTML</span>
<pre class="prettyprint">
<div id="user-toolbar-options">
<a href="#"><i class="icon-user"></i></a>
<a href="#"><i class="icon-star"></i></a>
<a href="#"><i class="icon-edit"></i></a>
<a href="#"><i class="icon-delete"></i></a>
<a href="#"><i class="icon-ban"></i></a>
</div>
</pre>
</section>
<div class="clear"></div>
</div>
<div class="example">
<p>Horizontal toolbar triggered by a link</p>
<section class="left">
<a id="link-toolbar" class="demo-link">Options</a>
</section>
<section class="right">
<span>JS</span>
<pre class="prettyprint">
$('#normal-button').toolbar({
content: '#user-options',
position: 'top'
});</pre>
<span>HTML</span>
<pre class="prettyprint">
<div id="user-toolbar-options">
<a href="#"><i class="icon-user"></i></a>
<a href="#"><i class="icon-star"></i></a>
<a href="#"><i class="icon-edit"></i></a>
<a href="#"><i class="icon-delete"></i></a>
<a href="#"><i class="icon-ban"></i></a>
</div>
</pre>
</section>
<div class="clear"></div>
</div>
</section>
<section>
<h2>Usage</h2>
<span>Include the plugin javascript file along with jquery</span>
<pre class="prettyprint">
<script src="jquery.min.js"></script>
<script src="jquery.toolbar.js"></script>
</pre>
<br/>
<span>Include the css files</span>
<pre class="prettyprint">
<link href="jquery.toolbar.css" rel="stylesheet" />
<link href="bootstrap.icons.css" rel="stylesheet" />
</pre>
<br/>
<span>Define your toolbar HTML</span>
<pre class="prettyprint">
<div id="user-toolbar-options">
<a href="#"><i class="icon-user"></i></a>
<a href="#"><i class="icon-star"></i></a>
<a href="#"><i class="icon-edit"></i></a>
<a href="#"><i class="icon-delete"></i></a>
<a href="#"><i class="icon-ban"></i></a>
</div>
</pre>
<br/>
<span>Attach the toolbar to an element passing in your options as an object. Available options are detailed below.</span>
<pre class="prettyprint">
$('#element').toolbar( options );
</pre>
<br/>
<h3>Notes</h3>
<ul>
<li>The element that triggers the toolbar will gain the class <code>.pressed</code> when the toolbar is visible.</li>
<li>Define any javascript for icon actions before calling the toolbar.</li>
</ul>
</section>
<section>
<h2>Options</h2>
<table>
<thead>
<tr>
<th>Option</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>content</td>
<td>The id of the element containing the icons HTML.</td>
</tr>
<tr>
<td>position</td>
<td>Indicates the display position of the toobar relative to the element its attached agaisnt. Select either 'top', 'bottom', 'left' or 'right. Default: top.</td>
</tr>
<tr>
<td>hideOnClick</td>
<td>Choose if you want the toolbar to hide when anywhere outside the toolbar is clicked. Default: false.</td>
</tr>
</tbody>
</table>
<br/>
<h2>Methods</h2>
<p>Below is a list of methods available on the elements that already have a toolbar instantiated</p>
<table>
<thead>
<tr>
<th>Method</th>
<th>Arguments</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>getToolbarElement</td>
<td>None</td>
<td>Obtain the element that wraps every tool button</td>
</tr>
</tbody>
</table>
<br/>
<h2>Events</h2>
<p>Below are a list of events that are triggered when certain events happen with the toolbar. You can listen for these events using the .on method.</p>
<span>For example.</span>
<pre class="prettyprint">
$('#element').on('toolbarShown',
function( event ) {
// this: the element the toolbar is attached to
}
);
</pre>
<br/>
<table>
<thead>
<tr>
<th>Event</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>toolbarShown</td>
<td>Triggered when the toolbar is shown.</td>
</tr>
<tr>
<td>toolbarHidden</td>
<td>Triggered when the toolbar is hidden.</td>
</tr>
<tr>
<td>toolbarItemClick</td>
<td>Triggered when a button in the toolbar is clicked. The toolbar item clicked is also passed through for this event.</td>
</tr>
</tbody>
</table>
</section>
<footer>
<p>Built by <a href="http://www.kinzett.co.nz">Paul Kinzett</a> | Released under the MIT license | Fork this project from the <a href="https://github.com/paulkinzett/toolbar">GitHub repository</a>.</p>
</footer>
</div>
<div id="user-options-small" class="toolbar-icons" style="display: none;">
<a href=""><i class="icon-align-left"></i></a>
<a href=""><i class="icon-align-center"></i></a>
<a href=""><i class="icon-align-right"></i></a>
</div>
<div id="user-options" class="toolbar-icons" style="display: none;">
<a href="#"><i class="icon-user"></i></a>
<a href="#"><i class="icon-star"></i></a>
<a href="#"><i class="icon-edit"></i></a>
<a href="#"><i class="icon-trash"></i></a>
<a href="#"><i class="icon-ban-circle"></i></a>
</div>
</body>
</html>