diff --git a/README.md b/README.md index 6ed8efc..2257ff4 100755 --- a/README.md +++ b/README.md @@ -8,27 +8,33 @@ jQuery Knob Example ------- - +```html + - + +``` Options ------- Options are provided as attributes 'data-option': - +```html + +``` ... or in the "knob()" call : - $(".dial").knob({ - 'min':-50 - ,'max':50 - }); +```javascript +$(".dial").knob({ + 'min':-50, + 'max':50 +}); +``` The following options are supported : @@ -47,6 +53,7 @@ UI : * thickness : gauge thickness. * lineCap : gauge stroke endings. | default=butt, round=rounded line endings * width : dial width. +* height : dial height. * displayInput : default=true | false=hide input. * displayPrevious : default=false | true=displays the previous value with transparency. * fgColor : foreground color. @@ -58,11 +65,13 @@ UI : Hooks ------- - + 'release' : function (v) { /*make something*/ } + }); + +``` * 'release' : executed on release @@ -92,40 +101,44 @@ The scope (this) of each hook function is the current Knob instance (refer to th Example ------- - +```html + - - + 'change' : function (v) { console.log(v); } + }); + +``` Dynamically configure ------- - + } + ); + +``` Set the value ------- - + +``` Supported browser ------- diff --git a/bower.json b/bower.json index 7969769..1eeb316 100755 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { - "name": "aterrien/jQuery-Knob", - "version": "1.2.11", + "name": "jquery-knob", + "version": "1.2.13", "main": "js/jquery.knob.js", "description": "Nice, downward compatible, touchable, jQuery dial.", "license": "MIT", diff --git a/js/jquery.knob.js b/js/jquery.knob.js old mode 100755 new mode 100644 index 163847b..792313c --- a/js/jquery.knob.js +++ b/js/jquery.knob.js @@ -2,7 +2,7 @@ /** * Downward compatible, touchable dial * - * Version: 1.2.11 + * Version: 1.2.12 * Requires: jQuery v1.7+ * * Copyright (c) 2012 Anthony Terrien @@ -11,7 +11,10 @@ * Thanks to vor, eskimoblood, spiffistan, FabrizioC */ (function (factory) { - if (typeof define === 'function' && define.amd) { + if (typeof exports === 'object') { + // CommonJS + module.exports = factory(require('jquery')); + } else if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. define(['jquery'], factory); } else { @@ -294,7 +297,7 @@ } return this; - } + }; this._draw = function () { @@ -469,7 +472,7 @@ // Utils this.h2rgba = function (h, a) { var rgb; - h = h.substring(1,7) + h = h.substring(1,7); rgb = [ parseInt(h.substring(0,2), 16), parseInt(h.substring(2,4), 16), @@ -666,7 +669,7 @@ ); this.$c.bind("mousewheel DOMMouseScroll", mw); - this.$.bind("mousewheel DOMMouseScroll", mw) + this.$.bind("mousewheel DOMMouseScroll", mw); }; this.init = function () { diff --git a/knob.jquery.json b/knob.jquery.json index 26564ad..01a9063 100755 --- a/knob.jquery.json +++ b/knob.jquery.json @@ -9,7 +9,7 @@ "ui", "input" ], - "version": "1.2.11", + "version": "1.2.13", "author": { "name": "Anthony Terrien", "url": "https://github.com/aterrien" diff --git a/package.json b/package.json new file mode 100644 index 0000000..fbb4245 --- /dev/null +++ b/package.json @@ -0,0 +1,24 @@ +{ + "name": "jquery-knob", + "version": "1.2.13", + "description": "Nice, downward compatible, touchable, jQuery dial", + "main": "dist/jquery.knob.min.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/aterrien/jQuery-Knob.git" + }, + "keywords": [ + "jquery", + "knob", + "dial" + ], + "author": "Anthony Terrien", + "license": "MIT", + "bugs": { + "url": "https://github.com/aterrien/jQuery-Knob/issues" + }, + "homepage": "https://github.com/aterrien/jQuery-Knob#readme" +}