From 82e95033bbda08c44213c52d6eb4cdf1c54226c9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Valerio=20Barril=C3=A0?=
Date: Mon, 24 Jun 2013 12:27:02 +0300
Subject: [PATCH 01/57] "cursor" option description changed
Reading the plugin code I noticed that cursor width could be changed passing a numeric value, so I changed the readme in order to explain this useful feature.
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 637bd12..2b33108 100644
--- a/README.md
+++ b/README.md
@@ -42,7 +42,7 @@ Behaviors :
* readOnly : disable input and events | default=false.
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.
From adf93321422c67b949b95cc28e374c00c2adf252 Mon Sep 17 00:00:00 2001
From: Anthony Terrien
Date: Thu, 27 Jun 2013 23:16:02 +0200
Subject: [PATCH 02/57] Support for HiDPI screens #99 #93 #61
---
js/jquery.knob.js | 23 ++++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)
diff --git a/js/jquery.knob.js b/js/jquery.knob.js
index ef3ab5f..ae36b6b 100644
--- a/js/jquery.knob.js
+++ b/js/jquery.knob.js
@@ -63,6 +63,7 @@
this.cH = null; // change hook
this.eH = null; // cancel hook
this.rH = null; // release hook
+ this.scale = 1; // scale factor
this.run = function () {
var cf = function (e, conf) {
@@ -166,6 +167,21 @@
this.o.height + 'px;">'))
.before(this.$c);
+ this.scale = (window.devicePixelRatio || 1) /
+ (
+ this.c.webkitBackingStorePixelRatio ||
+ this.c.mozBackingStorePixelRatio ||
+ this.c.msBackingStorePixelRatio ||
+ this.c.oBackingStorePixelRatio ||
+ this.c.backingStorePixelRatio || 1
+ );
+ if (this.scale !== 1) {
+ this.$c[0].width = this.$c[0].width * this.scale;
+ this.$c[0].height = this.$c[0].height * this.scale;
+ this.$c.width(this.o.width);
+ this.$c.height(this.o.height);
+ }
+
if (this.v instanceof Object) {
this.cv = {};
this.copy(this.v, this.cv);
@@ -196,8 +212,9 @@
var d = true,
c = document.createElement('canvas');
- c.width = s.o.width;
- c.height = s.o.height;
+ c.width = s.o.width * s.scale;
+ c.height = s.o.height * s.scale;
+
s.g = c.getContext('2d');
s.clear();
@@ -551,7 +568,7 @@
this.$.val(this.v);
this.w2 = this.o.width / 2;
this.cursorExt = this.o.cursor / 100;
- this.xy = this.w2;
+ this.xy = this.w2 * this.scale;
this.lineWidth = this.xy * this.o.thickness;
this.lineCap = this.o.lineCap;
this.radius = this.xy - this.lineWidth / 2;
From bc468f9540e507e6ba557bc754e1355d9d7f4f9d Mon Sep 17 00:00:00 2001
From: fadomire
Date: Tue, 27 Aug 2013 09:54:13 +0200
Subject: [PATCH 03/57] excanvas support for IE7/8 compatibility
added excanvas support code from @buradleix https://github.com/buradleix/jQuery-Knob/
---
js/jquery.knob.js | 23 +++++++++++------------
1 file changed, 11 insertions(+), 12 deletions(-)
diff --git a/js/jquery.knob.js b/js/jquery.knob.js
index ae36b6b..a0b4729 100644
--- a/js/jquery.knob.js
+++ b/js/jquery.knob.js
@@ -150,10 +150,15 @@
(!this.o.displayInput) && this.$.hide();
- this.$c = $('');
+ this.$c = $(document.createElement('canvas')).attr({
+ width: this.o.width,
+ height: this.o.height
+ });
+ if (typeof G_vmlCanvasManager !== 'undefined') {
+ G_vmlCanvasManager.initElement(this.$c[0]);
+ }
+
this.c = this.$c[0].getContext? this.$c[0].getContext('2d') : null;
if (!this.c) {
@@ -209,13 +214,9 @@
this._draw = function () {
// canvas pre-rendering
- var d = true,
- c = document.createElement('canvas');
-
- c.width = s.o.width * s.scale;
- c.height = s.o.height * s.scale;
+ var d = true;
- s.g = c.getContext('2d');
+ s.g = s.c;
s.clear();
@@ -224,8 +225,6 @@
(d !== false) && s.draw();
- s.c.drawImage(c, 0, 0);
- c = null;
};
this._touch = function (e) {
@@ -682,4 +681,4 @@
).parent();
};
-})(jQuery);
\ No newline at end of file
+})(jQuery);
From 6dca8a7a79ade47c70835b06b2509ce688ecd3b9 Mon Sep 17 00:00:00 2001
From: root
Date: Mon, 2 Sep 2013 22:13:19 +0200
Subject: [PATCH 04/57] font and fontWeight support #100 @kylestetz @asnyder
---
README.md | 0
index.html | 0
js/jquery.knob.js | 10 ++++++----
knob.jquery.json | 0
4 files changed, 6 insertions(+), 4 deletions(-)
mode change 100644 => 100755 README.md
mode change 100644 => 100755 index.html
mode change 100644 => 100755 js/jquery.knob.js
mode change 100644 => 100755 knob.jquery.json
diff --git a/README.md b/README.md
old mode 100644
new mode 100755
diff --git a/index.html b/index.html
old mode 100644
new mode 100755
diff --git a/js/jquery.knob.js b/js/jquery.knob.js
old mode 100644
new mode 100755
index a0b4729..79b4f0e
--- a/js/jquery.knob.js
+++ b/js/jquery.knob.js
@@ -48,7 +48,7 @@
this.o = null; // array of options
this.$ = null; // jQuery wrapped element
this.i = null; // mixed HTMLInputElement or array of HTMLInputElement
- this.g = null; // 2D graphics context for 'pre-rendering'
+ this.g = null; // deprecated 2D graphics context for 'pre-rendering'
this.v = null; // value ; mixed array or integer
this.cv = null; // change value ; not commited value
this.x = 0; // canvas x position
@@ -100,6 +100,8 @@
displayPrevious : this.$.data('displayprevious'),
fgColor : this.$.data('fgcolor') || '#87CEEB',
inputColor: this.$.data('inputcolor') || this.$.data('fgcolor') || '#87CEEB',
+ font: this.$.data('font') || 'Arial',
+ fontWeight: this.$.data('font-weight') || 'bold',
inline : false,
step : this.$.data('step') || 1,
@@ -154,13 +156,13 @@
width: this.o.width,
height: this.o.height
});
-
+
if (typeof G_vmlCanvasManager !== 'undefined') {
G_vmlCanvasManager.initElement(this.$c[0]);
}
this.c = this.$c[0].getContext? this.$c[0].getContext('2d') : null;
-
+
if (!this.c) {
this.o.error && this.o.error();
return;
@@ -602,7 +604,7 @@
,'margin-left' : '-' + ((this.o.width * 3 / 4 + 2) >> 0) + 'px'
,'border' : 0
,'background' : 'none'
- ,'font' : 'bold ' + ((this.o.width / s) >> 0) + 'px Arial'
+ ,'font' : this.o.fontWeight + ' ' + ((this.o.width / s) >> 0) + 'px ' + this.o.font
,'text-align' : 'center'
,'color' : this.o.inputColor || this.o.fgColor
,'padding' : '0px'
diff --git a/knob.jquery.json b/knob.jquery.json
old mode 100644
new mode 100755
From ac5e0b8d478b2b17ed22e40849c4801b49db7e15 Mon Sep 17 00:00:00 2001
From: root
Date: Mon, 2 Sep 2013 22:18:03 +0200
Subject: [PATCH 05/57] font and fontWeight support #100 @kylestetz @asnyder
---
README.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/README.md b/README.md
index 2b33108..8c6dd33 100755
--- a/README.md
+++ b/README.md
@@ -50,6 +50,8 @@ UI :
* 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.
Hooks
From e83f4fb9f92837caa6402eac72ccf5480fe0970a Mon Sep 17 00:00:00 2001
From: root
Date: Fri, 13 Sep 2013 01:01:18 +0200
Subject: [PATCH 06/57] First implem of responsive support #98
---
index.html | 18 ++++++++
js/jquery.knob.js | 106 ++++++++++++++++++++++++++++++++++------------
2 files changed, 98 insertions(+), 26 deletions(-)
diff --git a/index.html b/index.html
index 67b1530..d003bb0 100755
--- a/index.html
+++ b/index.html
@@ -205,6 +205,24 @@
jQuery Knob
+
+
× Responsive
+
+data-width="80%"
+
+
+
+ Current div width is 30% of window width.
+ Knob width is 80% of current div.
+ Knob width is 80% of 30% of window width.
+ Test resizing window.
+
+
+
+
+