Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
0a883f3
global refactoring / optimizations / fix #36
aterrien Jul 15, 2012
a57cee8
numpad support
aterrien Aug 6, 2012
bf39e8c
IIFE had disappeared / thanks @eliotj
aterrien Aug 14, 2012
4900e49
add ability to independently set input (middle text) color
jaketrent Jan 23, 2013
df7f358
add inputColor option doc
jaketrent Jan 23, 2013
6effba1
add ability to set line cap style (eg, to rounded)
jaketrent Jan 23, 2013
8e441ff
add line cap doc
jaketrent Jan 23, 2013
4a120ee
add line cap option to doc
jaketrent Jan 23, 2013
a672f8f
branching / tagging 1.2.0
aterrien Jan 24, 2013
6bda399
Release 1.2.0
Jan 24, 2013
9a3e5a7
Add jQuery manifest
aterrien Jan 24, 2013
4ba94db
jquery manifest
aterrien Jan 24, 2013
44f3207
add some popular tags
aterrien Jan 24, 2013
5a8c2ed
Merge pull request #63 from jaketrent/master
aterrien Jan 24, 2013
979795e
Update README.md
aterrien Jan 25, 2013
bc89c87
Add download link
aterrien Jan 25, 2013
bf70456
Release 1.2.2
Jan 29, 2013
9dea104
use of $ passed to the ready() function / compat with noConflict
aterrien Feb 9, 2013
195976e
data-linecap=round example
aterrien Feb 12, 2013
4e1d48b
Added stepping functionality
aterrien Feb 15, 2013
6f159c1
misprint defaulT
aterrien Feb 15, 2013
69d60e2
Adds a superposition example (clock)
aterrien Mar 23, 2013
738eabc
Prevent errors in browsers that don't support canvases.
Apr 9, 2013
4fb4d31
Added the `error` hook to the doc.
Apr 9, 2013
2cee011
Merge pull request #82 from pioul/master
aterrien Jun 20, 2013
82e9503
"cursor" option description changed
ninjatux Jun 24, 2013
5adb8ba
Merge pull request #101 from NinjaTux/master
aterrien Jun 24, 2013
adf9332
Support for HiDPI screens #99 #93 #61
aterrien Jun 27, 2013
bc468f9
excanvas support for IE7/8 compatibility
fadomire Aug 27, 2013
43ce98a
Merge pull request #110 from fadomire/master
aterrien Aug 27, 2013
6dca8a7
font and fontWeight support #100 @kylestetz @asnyder
Sep 2, 2013
ac5e0b8
font and fontWeight support #100 @kylestetz @asnyder
Sep 2, 2013
e83f4fb
First implem of responsive support #98
Sep 12, 2013
6b5848c
fits outer div in height when % #98
Sep 13, 2013
0bbe958
input readonly support
Sep 23, 2013
bfa2aba
fix #118
Oct 1, 2013
66eb4d3
precond thickness opt #121
Oct 4, 2013
b2aa1d4
Allow dynamic resizing of read-only knobs.
Oct 31, 2013
dde8a52
Merge pull request #133 from jwalton/master
aterrien Nov 1, 2013
abcca72
fix version, license in a separate file
Nov 11, 2013
9181358
fix version, license in a separate file
Nov 11, 2013
f6ce33d
Adds LICENSE
Nov 13, 2013
737854a
Adds LICENSE
Nov 13, 2013
bb8ffc7
Make change event always fire as the user interacts with the knob:
amuino Nov 14, 2013
d3fef4c
Workaround for #56 #97
aterrien Nov 18, 2013
87c54d4
Merge pull request #140 from amuino/consistent_change_events
aterrien Nov 19, 2013
ec05292
Revert fix regression since #140
aterrien Nov 19, 2013
1d82b10
Make change event always fire as the user interacts with the knob
amuino Nov 20, 2013
11a0a89
Merge pull request #143 from amuino/consistent_change_events
aterrien Nov 20, 2013
7896719
Disable log change
aterrien Nov 20, 2013
4537561
Follow-up Android browser fix: fixed full knob display.
T2L Nov 26, 2013
87ac73a
Merge pull request #144 from lemberg/master
aterrien Nov 26, 2013
4ba17cf
Release events on mousewheel
aterrien Dec 3, 2013
e04c247
Merge branch 'master' of https://github.com/aterrien/jQuery-Knob
aterrien Dec 3, 2013
a04ae2d
Revert call change on val() #143
aterrien Dec 7, 2013
921c78a
add bower.json
aterrien Jan 7, 2014
354ab5e
Fix IE8 #150 #153 @zitrusblau, input blur, more consistent release hook
aterrien Jan 9, 2014
d6cadb0
Yeah, it works on 8.0
aterrien Jan 9, 2014
627a17b
jshint
aterrien Jan 9, 2014
4e4373b
Configuring the spinner size dynamically #147 #155 @legenddolphin
aterrien Jan 9, 2014
935f375
Add excanvas.js
aterrien Jan 14, 2014
b7b6ca5
Add excanvas.js
aterrien Jan 14, 2014
030fe57
Fix decimal values #78 @Aaon
aterrien Jan 23, 2014
e0f3b77
Allow choice of rotation; clockwise/anticlockwise
mal Nov 3, 2013
337ab0e
Update tron skin to use new arc function
mal Nov 7, 2013
3ef3110
Add an example of the rotation option
mal Nov 7, 2013
f785736
format() function (allows to add % or other unit) #170, #172, #134, #…
aterrien Feb 23, 2014
ac8320d
Fix #177
aterrien Feb 27, 2014
9af8860
Merge branch 'issue-105' of https://github.com/mal/jQuery-Knob into m…
aterrien Mar 4, 2014
236a5dc
1.2.8
aterrien Mar 4, 2014
1a6d581
iPod example default value
aterrien Mar 4, 2014
d182c67
Fix IE11 beginPath #198 #194
aterrien Apr 24, 2014
1974fc0
Add UMD declaration
fidothe May 6, 2014
1a4e3cf
loosen jquery version dependency
fidothe May 6, 2014
f0ee538
Merge pull request #202 from fidothe/add-UMD-declaration
aterrien May 6, 2014
f06ac07
Merge pull request #204 from fidothe/fix-jquery-bower-dep
aterrien May 6, 2014
4d6b6d4
Add jquery.knob.min.js
aterrien Jun 25, 2014
3e2760e
Fix #160
mrkeyboard Jul 1, 2014
e040dd5
Merge pull request #218 from mrkeyboard/master
aterrien Jul 2, 2014
5e0a620
Merge 'Fixed Code Style #219'
aterrien Jul 9, 2014
b3e18cf
Merge 'Fixed Code Style #219'
aterrien Jul 9, 2014
6966f40
Merge 'Fixed Code Style #219'
aterrien Jul 9, 2014
116e495
Fix decimal value #107
aterrien Sep 2, 2014
f014950
Fix decimal value #107
aterrien Sep 2, 2014
b47be8e
Fix decimal value #107
aterrien Sep 3, 2014
91bbbbc
Added support for CommonJS modules as described in http://dontkry.com…
beloglazov Sep 23, 2014
591b836
Syntax highlighting on README.md
mhor Oct 3, 2014
a897b87
Merge pull request #238 from mhor/patch-1
aterrien Oct 3, 2014
fb9b10a
Merge pull request #236 from beloglazov/master
aterrien Oct 3, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nbproject/
20 changes: 20 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
The MIT License (MIT)

Copyright (c) 2013 Anthony Terrien

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
149 changes: 82 additions & 67 deletions README.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,72 +2,80 @@ jQuery Knob
=============

- canvas based ; no png or jpg sprites.
- touch, mousewheel, keyboard events implemented.
- touch, mouse and mousewheel, keyboard events implemented.
- downward compatible ; overloads an input element.

Example
-------

<input type="text" value="75" class="dial">
```html
<input type="text" value="75" class="dial">

<script>
<script>
$(function() {
$(".dial").knob();
}
</script>
});
</script>
```

Options
-------

Options are provided as attributes 'data-option':

<input type="text" class="dial" data-min="-50" data-max="50">
```html
<input type="text" class="dial" data-min="-50" data-max="50">
```

... or in the "knob()" call :

$(".dial").knob({
'min':-50
,'max':50
})
```javascript
$(".dial").knob({
'min':-50,
'max':50
});
```

The following options are supported :

Behaviors :
* min : min value || default=0.
* max : max value || default=100.
* stopper : stop at 0 & 100 on keydown/mousewheel || default=true.
* readOnly : disable input and events.
* angleOffset: change the 0 position of the knob (in degree), || default=0.
* min : min value | default=0.
* max : max value | default=100.
* step : step size | default=1.
* angleOffset : starting angle in degrees | default=0.
* angleArc : arc size in degrees | default=360.
* stopper : stop at min & max on keydown/mousewheel | default=true.
* readOnly : disable input and events | default=false.
* rotation : direction of progression | default=clockwise.

UI :
* cursor : display mode "cursor" | default=gauge.
* cursor : display mode "cursor", cursor size could be changed passing a numeric value to the option, default width is used when passing boolean value "true" | default=gauge.
* thickness : gauge thickness.
* lineCap : gauge stroke endings. | default=butt, round=rounded line endings
* width : dial width.
* displayInput : default=true | false=hide input.
* displayPrevious : default=false | true=displays the previous value with transparency.
* fgColor : foreground color.
* inputColor : input value (number) color.
* font : font family.
* fontWeight : font weight.
* bgColor : background color.
* ticks : number of ticks | 0=disable.
* tickColor.
* tickLength.
* tickWidth.
* tickColorizeValues : colorize ticks.
* skin : default | "tron".

Hooks
-------

<script>
```html
<script>
$(".dial").knob({
'release':function(v,ipt) { /*make something*/ }
});
</script>
'release' : function (v) { /*make something*/ }
});
</script>
```

* 'release' : executed on release

Parameters :
+ value : int, current value
+ input : jQuery element, input element

* 'change' : executed at each change of the value

Expand All @@ -76,57 +84,64 @@ Hooks

* 'draw' : when drawing the canvas

Parameters :
+ angle : computed angle
+ value : current value
+ opt : plugin options
+ context : Canvas context 2d
Context :
- this.g : canvas context 2D (see Canvas documentation)
- this.$ : jQuery wrapped element
- this.o : options
- this.i : input
- ... console.log(this);

* 'cancel' : triggered on [esc] keydown

* 'format' : allows to format output (add unit %, ms ...)

The scope (this) of each hook function is the current Knob instance (refer to the demo code).

Example
-------

<input type="text" value="75" class="dial">

<script>
$(".dial").knob(
{
'change':function(e){
console.log(e);
}
}
);
</script>
```html
<input type="text" value="75" class="dial">

<script>
$(".dial").knob({
'change' : function (v) { console.log(v); }
});
</script>
```

Dynamically configure
-------

<script>
$('.dial').trigger('configure',{"min":10, "max":40, "fgColor":"#FF0000", "skin":"tron", "cursor":true})
</script>

Supported browser
```html
<script>
$('.dial').trigger(
'configure',
{
"min":10,
"max":40,
"fgColor":"#FF0000",
"skin":"tron",
"cursor":true
}
);
</script>
```

Set the value
-------

Tested on Chrome, Safari, Firefox, IE 9.0.
```html
<script>
$('.dial')
.val(27)
.trigger('change');
</script>
```

Revision 1.1.2
-------
- removed padding around the wheel in default skin / default thickness = 0.35.
- 'configure' event.
- added 'displayPrevious' option.
- change color cgColor / 'displayPrevious' must be true.
- escape keycode supported while changing = restore the current value.
- tab keycode supported.
- added 'stopper'.
- bugfix init when 'value' attribute is not defined.
- JSLint qa.
- infinite mode demo.

Revision 1.1.1
Supported browser
-------
- keyboard/mousewheel control refactoring / acceleration.
- bugfix no keyboard or mousewheel when readonly.
- bugfix min/max can be exceeded.
- hooks / keyboard events.

Tested on Chrome, Safari, Firefox, IE>=8.0 (IE8.0 with excanvas).

![secretplan](https://raw.github.com/aterrien/jQuery-Knob/master/secretplan.jpg)
13 changes: 13 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "aterrien/jQuery-Knob",
"version": "1.2.11",
"main": "js/jquery.knob.js",
"description": "Nice, downward compatible, touchable, jQuery dial.",
"license": "MIT",
"ignore": [],
"dependencies": {
"jquery": ">=1.7.0"
},
"devDependencies": {}
}

1 change: 1 addition & 0 deletions dist/jquery.knob.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading