-
Notifications
You must be signed in to change notification settings - Fork 30
/
index.html
202 lines (145 loc) · 7.41 KB
/
index.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
<!Doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>jQueryUI Extensions Collection</title>
<link rel="stylesheet" type="text/css" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css">
</head>
<body>
<div style="width: 600px; margin: auto">
<h1>jQuery UI Extensions</h1>
<p>This my collection of customizations and enhancements to the standard jQuery UI library. </p>
<p class="text-center">
<iframe src="http://ghbtns.com/github-btn.html?user=bseth99&repo=jquery-ui-extensions&type=fork"
allowtransparency="true" frameborder="0" scrolling="0" width="53" height="20"></iframe>
<iframe src="http://ghbtns.com/github-btn.html?user=bseth99&repo=jquery-ui-extensions&type=watch"
allowtransparency="true" frameborder="0" scrolling="0" width="62" height="20"></iframe>
<iframe src="http://ghbtns.com/github-btn.html?user=bseth99&type=follow"
allowtransparency="true" frameborder="0" scrolling="0" width="132" height="20"></iframe>
</p>
<p class="text-center">
<a class="btn btn-primary" rel="nofollow" href="https://github.com/bseth99/jquery-ui-extensions/archive/master.zip" >
Download Latest Version
</a>
</p>
<h2>Features</h2>
<ul>
<li><p><strong>Spinner</strong>: Add <code>alignment</code> to the available options to create four different alternative
layouts for the spin buttons.</p></li>
<li><p><strong>SlideSpinner</strong>: Adds a Slider control to the Spinner to enable visual reference to where
a user is in the valid range and a faster way to change values.</p></li>
<li><p><strong>LabeledSlider</strong>: Adds tick marks at configurable intervals to the Slider control. Optional text labels
can also be passed to the widget.</p></li>
<li><p><strong>ComboBox</strong>: Enhances the demo provided on the <a href="http://jqueryui.com/autocomplete/#combobox">jQueryUI site</a>
by adding a value function and some addtional features.</p></li>
<li><p><strong>WaitButton</strong>: Extends the default jQueryUI Button widget by adding a spinner and disabling the
button when its clicked. Prevents multiple clicking and provides visual feedback that something
is happening.</p></li>
<li><p><strong>TimePicker</strong>: Uses several Spinner widgets to allow entering time. The spinners will automatically
rollover another time component (ie hours flip from 11 -> 12 so AM -> PM and minutes cause hours to increment/decrement).
<a href="http://www.benknowscode.com/2014/03/build-time-picker-using-jquery-ui.html">Read this blog post</a> for more information.
</p></li>
<li><p><strong>Scrollable</strong>: Moved to <a href="../jquery-ui-scrollable/index.html">bseth99/jquery-ui-scrollable</a></p></li>
</ul>
<h2>
<a name="usage" class="anchor" href="#usage"><span class="octicon octicon-link"></span></a>Usage</h2>
<p>Either download the
<a href="https://raw.github.com/bseth99/jquery-ui-extensions/master/dist/ext-jquery-ui.min.js">Minified</a> or the
<a href="https://raw.github.com/bseth99/jquery-ui-extensions/master/dist/ext-jquery-ui.js">Full</a> source and add it
after the normal jQuery UI scripts.</p>
<p>Also download the <a href="https://raw.github.com/bseth99/jquery-ui-extensions/master/dist/ext-jquery-ui.css">CSS</a>
file and include it after any jQuery UI CSS files.</p>
<p>You can also just browse the source and grab what you want to use. Just be mindful of the dependencies:</p>
<ul>
<li>
<strong>SlideSpinner</strong>: Requires the enhanced Spinner control</li>
<li>
<strong>TimePicker</strong>: Requires the enhanced Spinner control</li>
</ul><h3>
<a name="waitbutton" class="anchor" href="#waitbutton"><span class="octicon octicon-link"></span></a>WaitButton</h3>
<p>WaitButton adds two options that enable controling the label and icon used to show the waiting status:</p>
<pre><code> $('#save')
.waitbutton({
waitLabel: 'Saving ...',
waitIcon: 'my-icon-class'
})
</code></pre>
<p>Neither are required to use the widget. When omitted, the label will remain the same as the current label and
the class used for the primary icon will be the default ui-icon-waiting class which expects a GIF named
waitbutton-loading.gif to be present in a images folder relative to the CSS file. You can use the <a href="https://raw.github.com/bseth99/jquery-ui-extensions/master/dist/images/waitbutton-loading.gif">one I have
created</a>
or design your own. Just be aware that the ui-icon class on the button widget a lot 16x16 pixels for
the icon.</p>
<p>The widget triggers a <code>waiting</code> event when a user clicks the button. An object is passed to the handler with
a callback that should be called once the action is complete. Failure to call the callback will result in the
button remaining in the waiting state.</p>
<pre><code> $('#save')
.waitbutton({
waiting: function ( e, ui ) {
// do something
ui.done();
}
})
</code></pre>
<p>or</p>
<pre><code> $('#save')
.waitbutton()
.on( 'buttonwaiting', function ( e, ui ) {
// do something
ui.done();
}
})
</code></pre>
<p>The <code>done()</code> callback takes up to two option arguments that control the new label and state of the button.
Review the <a href="tests/visual/waitbutton/base.html">demo</a> for examples of each variation.</p>
<h3>
<a name="timepicker" class="anchor" href="#timepicker"><span class="octicon octicon-link"></span></a>
TimePicker
</h3>
<p>TimePicker currently exposes the getter/setter function <code>value</code>. After initializing the widget, set the value using a
time string:</p>
<pre><code> $( '#picker' ).timepicker();
$( '#picker' ).timepicker( 'value', '8:25 AM' );
</code></pre>
<p>And retrieve the value as a time string:</p>
<pre><code> time = $( '#picker' ).timepicker( 'value' );
// time == '8:25 AM'
</code></pre>
<p>You can also initialize the picker to show time in either a 12 or 24 hour clock:</p>
<h4>12-hour (default)</h4>
<pre><code> $( '#picker' ).timepicker({ format: 'hh:mm a' });
</code></pre>
<h4>24-hour</h4>
<pre><code> $( '#picker' ).timepicker({ format: 'HH:mm' });
</code></pre>
<p>Optionally, you can include <a href="http://momentjs.com">MomentJS</a> to activate more advanced value handling. Without Moment,
only time strings will be accepted/returned by the value function. With Moment, you can pass Date, String, or Moment instances to the
value function and it will return Moment instances representing the selected time:</p>
<pre><code> $( '#picker' ).timepicker();
$( '#picker' ).timepicker( 'value', '8:25 AM' );
time = $( '#picker' ).timepicker( 'value' );
time.format( 'HH:mm' ); // 08:25
time.add( 'm', 5 );
time.format( 'h:mm A' ); // 8:30 AM
</code></pre>
<h2>Demo</h2>
<p>I created some <a href="tests/visual/index.html">tests</a> that
show what the widgets can do. </p>
<h2>License</h2>
<p>Copyright (c) 2012-2014 Ben Olson <br/>
Licensed under the MIT License</p>
</div>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-34780028-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</body>
</html>