From fe50b33c4cec99cc766160d6a628554a52189f48 Mon Sep 17 00:00:00 2001 From: Iain B Date: Sun, 19 Jul 2015 11:58:25 +0200 Subject: [PATCH 1/4] added definition for jquery knob --- jquery.knob/jquery.knob-tests.ts | 37 ++++++++++ jquery.knob/jquery.knob.d.ts | 116 +++++++++++++++++++++++++++++++ 2 files changed, 153 insertions(+) create mode 100644 jquery.knob/jquery.knob-tests.ts create mode 100644 jquery.knob/jquery.knob.d.ts diff --git a/jquery.knob/jquery.knob-tests.ts b/jquery.knob/jquery.knob-tests.ts new file mode 100644 index 000000000..b85d7895b --- /dev/null +++ b/jquery.knob/jquery.knob-tests.ts @@ -0,0 +1,37 @@ +/// + +// create from html attrs +$('').knob(); + +// create with object +$('').knob({ + min: 0, + max: 100, + angleArc: 270 +}); + +// hooks +var hookKnob = $('').knob({ + release: function(value) { + console.log(value); + }, + change: function(value) { + console.log(value); + }, + draw: function() { + console.log(this); + }, + cancel: function() { + console.log(this); + }, + format: function(value) { + console.log(value); + } +}); + +// trigger +hookKnob.trigger('release'); +hookKnob.trigger('change'); +hookKnob.trigger('draw'); +hookKnob.trigger('cancel'); +hookKnob.trigger('format'); \ No newline at end of file diff --git a/jquery.knob/jquery.knob.d.ts b/jquery.knob/jquery.knob.d.ts new file mode 100644 index 000000000..875f5fd76 --- /dev/null +++ b/jquery.knob/jquery.knob.d.ts @@ -0,0 +1,116 @@ +// Type definitions for jQuery Knob 1.2.11 +// Project: +// Definitions by: Iain Buchanan +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module JQueryKnob { + export interface JQueryKnobOptions { + /** + * min value | default=0 + */ + min?: number; + /** + * max value | default=100 + */ + max?: number; + /** + * step size | default=1 + */ + step?: number; + /** + * starting angle in degrees | default=0 + */ + angleOffset?: number; + /** + * arc size in degrees | default=360 + */ + angleArc?: number; + /** + * stop at min & max on keydown/mousewheel | default=true + */ + stopper?: boolean; + /** + * disable input and events | default=false + */ + readOnly?: boolean; + /** + * direction of progression | default=clockwise + */ + rotation?: string; + /** + * 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 + */ + cursor?: string | boolean; + /** + * gauge thickness + */ + thickness?: number; + /** + * gauge stroke endings | default=butt, round=rounded line endings + */ + lineCap?: string; + /** + * dial width + */ + width?: number; + /** + * default=true | false=hide input + */ + displayInput?: boolean; + /** + * default=false | true=displays the previous value with transparency + */ + displayPrevious?: boolean; + /** + * foreground color + */ + fgColor?: string; + /** + * input value (number) color + */ + inputColor?: string; + /** + * font family + */ + font?: string; + /** + * font weight + */ + fontWeight?: string; + /** + * background color + */ + bgColor?: string; + /** + * executed on release + */ + release?: (value: number) => void; + /** + * executed at each change of the value + */ + change?: (value: number) => void; + /** + * when drawing the canvas + */ + draw?: () => void; + /** + * triggered on [esc] keydown + */ + cancel?: () => void; + /** + * allows to format output (add unit %, ms...) + */ + format?: (value: number) => void; + } +} + +interface JQuery { + /** + * Create a knob for the given input field, with optional options + */ + knob(options?: JQueryKnob.JQueryKnobOptions): JQuery; +} \ No newline at end of file From c0554493a4a1fd4a233a1969c57ab1c8a756f15e Mon Sep 17 00:00:00 2001 From: Iain B Date: Sun, 19 Jul 2015 12:00:36 +0200 Subject: [PATCH 2/4] added project link --- jquery.knob/jquery.knob.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jquery.knob/jquery.knob.d.ts b/jquery.knob/jquery.knob.d.ts index 875f5fd76..7d02fa34f 100644 --- a/jquery.knob/jquery.knob.d.ts +++ b/jquery.knob/jquery.knob.d.ts @@ -1,5 +1,5 @@ // Type definitions for jQuery Knob 1.2.11 -// Project: +// Project: http://anthonyterrien.com/knob/ // Definitions by: Iain Buchanan // Definitions: https://github.com/borisyankov/DefinitelyTyped From 1a9abb71582e4e04dbb805cf2f715cbe6f7bf828 Mon Sep 17 00:00:00 2001 From: Iain B Date: Sun, 19 Jul 2015 16:02:02 +0200 Subject: [PATCH 3/4] fixed filenames --- jquery-knob/jquery-knob-tests.ts | 37 ++++++++++ jquery-knob/jquery-knob.d.ts | 116 +++++++++++++++++++++++++++++++ 2 files changed, 153 insertions(+) create mode 100644 jquery-knob/jquery-knob-tests.ts create mode 100644 jquery-knob/jquery-knob.d.ts diff --git a/jquery-knob/jquery-knob-tests.ts b/jquery-knob/jquery-knob-tests.ts new file mode 100644 index 000000000..a6c85e2c8 --- /dev/null +++ b/jquery-knob/jquery-knob-tests.ts @@ -0,0 +1,37 @@ +/// + +// create from html attrs +$('').knob(); + +// create with object +$('').knob({ + min: 0, + max: 100, + angleArc: 270 +}); + +// hooks +var hookKnob = $('').knob({ + release: function(value) { + console.log(value); + }, + change: function(value) { + console.log(value); + }, + draw: function() { + console.log(this); + }, + cancel: function() { + console.log(this); + }, + format: function(value) { + console.log(value); + } +}); + +// trigger +hookKnob.trigger('release'); +hookKnob.trigger('change'); +hookKnob.trigger('draw'); +hookKnob.trigger('cancel'); +hookKnob.trigger('format'); \ No newline at end of file diff --git a/jquery-knob/jquery-knob.d.ts b/jquery-knob/jquery-knob.d.ts new file mode 100644 index 000000000..7d02fa34f --- /dev/null +++ b/jquery-knob/jquery-knob.d.ts @@ -0,0 +1,116 @@ +// Type definitions for jQuery Knob 1.2.11 +// Project: http://anthonyterrien.com/knob/ +// Definitions by: Iain Buchanan +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module JQueryKnob { + export interface JQueryKnobOptions { + /** + * min value | default=0 + */ + min?: number; + /** + * max value | default=100 + */ + max?: number; + /** + * step size | default=1 + */ + step?: number; + /** + * starting angle in degrees | default=0 + */ + angleOffset?: number; + /** + * arc size in degrees | default=360 + */ + angleArc?: number; + /** + * stop at min & max on keydown/mousewheel | default=true + */ + stopper?: boolean; + /** + * disable input and events | default=false + */ + readOnly?: boolean; + /** + * direction of progression | default=clockwise + */ + rotation?: string; + /** + * 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 + */ + cursor?: string | boolean; + /** + * gauge thickness + */ + thickness?: number; + /** + * gauge stroke endings | default=butt, round=rounded line endings + */ + lineCap?: string; + /** + * dial width + */ + width?: number; + /** + * default=true | false=hide input + */ + displayInput?: boolean; + /** + * default=false | true=displays the previous value with transparency + */ + displayPrevious?: boolean; + /** + * foreground color + */ + fgColor?: string; + /** + * input value (number) color + */ + inputColor?: string; + /** + * font family + */ + font?: string; + /** + * font weight + */ + fontWeight?: string; + /** + * background color + */ + bgColor?: string; + /** + * executed on release + */ + release?: (value: number) => void; + /** + * executed at each change of the value + */ + change?: (value: number) => void; + /** + * when drawing the canvas + */ + draw?: () => void; + /** + * triggered on [esc] keydown + */ + cancel?: () => void; + /** + * allows to format output (add unit %, ms...) + */ + format?: (value: number) => void; + } +} + +interface JQuery { + /** + * Create a knob for the given input field, with optional options + */ + knob(options?: JQueryKnob.JQueryKnobOptions): JQuery; +} \ No newline at end of file From 53e564fa511f5e4c1017b0aa9560910718685804 Mon Sep 17 00:00:00 2001 From: Iain B Date: Mon, 20 Jul 2015 17:07:37 +0200 Subject: [PATCH 4/4] remove old dir --- jquery.knob/jquery.knob-tests.ts | 37 ---------- jquery.knob/jquery.knob.d.ts | 116 ------------------------------- 2 files changed, 153 deletions(-) delete mode 100644 jquery.knob/jquery.knob-tests.ts delete mode 100644 jquery.knob/jquery.knob.d.ts diff --git a/jquery.knob/jquery.knob-tests.ts b/jquery.knob/jquery.knob-tests.ts deleted file mode 100644 index b85d7895b..000000000 --- a/jquery.knob/jquery.knob-tests.ts +++ /dev/null @@ -1,37 +0,0 @@ -/// - -// create from html attrs -$('').knob(); - -// create with object -$('').knob({ - min: 0, - max: 100, - angleArc: 270 -}); - -// hooks -var hookKnob = $('').knob({ - release: function(value) { - console.log(value); - }, - change: function(value) { - console.log(value); - }, - draw: function() { - console.log(this); - }, - cancel: function() { - console.log(this); - }, - format: function(value) { - console.log(value); - } -}); - -// trigger -hookKnob.trigger('release'); -hookKnob.trigger('change'); -hookKnob.trigger('draw'); -hookKnob.trigger('cancel'); -hookKnob.trigger('format'); \ No newline at end of file diff --git a/jquery.knob/jquery.knob.d.ts b/jquery.knob/jquery.knob.d.ts deleted file mode 100644 index 7d02fa34f..000000000 --- a/jquery.knob/jquery.knob.d.ts +++ /dev/null @@ -1,116 +0,0 @@ -// Type definitions for jQuery Knob 1.2.11 -// Project: http://anthonyterrien.com/knob/ -// Definitions by: Iain Buchanan -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/// - -declare module JQueryKnob { - export interface JQueryKnobOptions { - /** - * min value | default=0 - */ - min?: number; - /** - * max value | default=100 - */ - max?: number; - /** - * step size | default=1 - */ - step?: number; - /** - * starting angle in degrees | default=0 - */ - angleOffset?: number; - /** - * arc size in degrees | default=360 - */ - angleArc?: number; - /** - * stop at min & max on keydown/mousewheel | default=true - */ - stopper?: boolean; - /** - * disable input and events | default=false - */ - readOnly?: boolean; - /** - * direction of progression | default=clockwise - */ - rotation?: string; - /** - * 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 - */ - cursor?: string | boolean; - /** - * gauge thickness - */ - thickness?: number; - /** - * gauge stroke endings | default=butt, round=rounded line endings - */ - lineCap?: string; - /** - * dial width - */ - width?: number; - /** - * default=true | false=hide input - */ - displayInput?: boolean; - /** - * default=false | true=displays the previous value with transparency - */ - displayPrevious?: boolean; - /** - * foreground color - */ - fgColor?: string; - /** - * input value (number) color - */ - inputColor?: string; - /** - * font family - */ - font?: string; - /** - * font weight - */ - fontWeight?: string; - /** - * background color - */ - bgColor?: string; - /** - * executed on release - */ - release?: (value: number) => void; - /** - * executed at each change of the value - */ - change?: (value: number) => void; - /** - * when drawing the canvas - */ - draw?: () => void; - /** - * triggered on [esc] keydown - */ - cancel?: () => void; - /** - * allows to format output (add unit %, ms...) - */ - format?: (value: number) => void; - } -} - -interface JQuery { - /** - * Create a knob for the given input field, with optional options - */ - knob(options?: JQueryKnob.JQueryKnobOptions): JQuery; -} \ No newline at end of file