From f7d8a1ba570fd620d65b377ebe806eac0b578328 Mon Sep 17 00:00:00 2001 From: jzaefferer Date: Fri, 22 Oct 2010 06:16:12 +0200 Subject: Porting old spinner implementation to 1.8, dropping some baggage. --- demos/spinner/default.html | 65 +++++++++++++++++++++++++++++++++++++ demos/spinner/donation.html | 74 ++++++++++++++++++++++++++++++++++++++++++ demos/spinner/hexadecimal.html | 37 +++++++++++++++++++++ demos/spinner/index.html | 20 ++++++++++++ demos/spinner/latlong.html | 60 ++++++++++++++++++++++++++++++++++ demos/spinner/rtl.html | 36 ++++++++++++++++++++ 6 files changed, 292 insertions(+) create mode 100644 demos/spinner/default.html create mode 100644 demos/spinner/donation.html create mode 100644 demos/spinner/hexadecimal.html create mode 100644 demos/spinner/index.html create mode 100644 demos/spinner/latlong.html create mode 100644 demos/spinner/rtl.html (limited to 'demos/spinner') diff --git a/demos/spinner/default.html b/demos/spinner/default.html new file mode 100644 index 000000000..d90b73f6d --- /dev/null +++ b/demos/spinner/default.html @@ -0,0 +1,65 @@ + + + + + jQuery UI Spinner - Default functionality + + + + + + + + + + + + +
+ +

+

+ +

+ + +

+ +

+ + +

+ +
+ +
+

+Default spinner. +

+
+ + + diff --git a/demos/spinner/donation.html b/demos/spinner/donation.html new file mode 100644 index 000000000..617570b12 --- /dev/null +++ b/demos/spinner/donation.html @@ -0,0 +1,74 @@ + + + + + jQuery UI Spinner - Default functionality + + + + + + + + + + + + +
+ +

+ + +

+

+ + +

+
+ +
+

+Example of a donation form, with currency selection and amout spinner. +

+
+ + + diff --git a/demos/spinner/hexadecimal.html b/demos/spinner/hexadecimal.html new file mode 100644 index 000000000..03952a62d --- /dev/null +++ b/demos/spinner/hexadecimal.html @@ -0,0 +1,37 @@ + + + + + jQuery UI Spinner - Hexadecimal + + + + + + + + + + + + +
+ +

+ + +

+
+ +
+

+Example of a hexadecimal spinner. +

+
+ + + diff --git a/demos/spinner/index.html b/demos/spinner/index.html new file mode 100644 index 000000000..6d7b980bd --- /dev/null +++ b/demos/spinner/index.html @@ -0,0 +1,20 @@ + + + + jQuery UI Spinner Demos + + + +
+

Examples

+ +
+ + diff --git a/demos/spinner/latlong.html b/demos/spinner/latlong.html new file mode 100644 index 000000000..6b955ba47 --- /dev/null +++ b/demos/spinner/latlong.html @@ -0,0 +1,60 @@ + + + + + jQuery UI Spinner - Map + + + + + + + + + + + + + + +
+ + + +
+ + + +
+ +
+ +
+

+Google Maps integration, using spinners to change latidude and longitude. +

+
+ + + diff --git a/demos/spinner/rtl.html b/demos/spinner/rtl.html new file mode 100644 index 000000000..52d7b1048 --- /dev/null +++ b/demos/spinner/rtl.html @@ -0,0 +1,36 @@ + + + + + jQuery UI Spinner - Default functionality + + + + + + + + + + + + +
+ +

+

+ +
+ +
+

+Default spinner. +

+
+ + + -- cgit v1.2.3 From bc3d283d2c1547ac3d8b5aeb894b2e6290e2d3c6 Mon Sep 17 00:00:00 2001 From: jzaefferer Date: Sat, 23 Oct 2010 01:51:12 +0200 Subject: Replaced hexadecimal demo with decimal demo. Updated that and the currency demo (previously donation) to use globalization plugin with a select for three different cultures (probably more to come). Updated spinner widget to use Globalization when available, replacing all number formatting related options with a single numberformat option. --- demos/spinner/currency.html | 62 ++ demos/spinner/decimal.html | 58 ++ demos/spinner/donation.html | 74 --- demos/spinner/hexadecimal.html | 37 -- demos/spinner/index.html | 4 +- external/glob.de-DE.js | 55 ++ external/glob.ja-JP.js | 74 +++ external/glob.js | 1333 ++++++++++++++++++++++++++++++++++++++++ ui/jquery.ui.spinner.js | 174 ++---- 9 files changed, 1628 insertions(+), 243 deletions(-) create mode 100644 demos/spinner/currency.html create mode 100644 demos/spinner/decimal.html delete mode 100644 demos/spinner/donation.html delete mode 100644 demos/spinner/hexadecimal.html create mode 100644 external/glob.de-DE.js create mode 100644 external/glob.ja-JP.js create mode 100644 external/glob.js (limited to 'demos/spinner') diff --git a/demos/spinner/currency.html b/demos/spinner/currency.html new file mode 100644 index 000000000..418dca228 --- /dev/null +++ b/demos/spinner/currency.html @@ -0,0 +1,62 @@ + + + + + jQuery UI Spinner - Default functionality + + + + + + + + + + + + + + + +
+ +

+ + +

+

+ + +

+
+ +
+

+ Example of a donation form, with currency selection and amout spinner. +

+
+ + + diff --git a/demos/spinner/decimal.html b/demos/spinner/decimal.html new file mode 100644 index 000000000..82d0fcc20 --- /dev/null +++ b/demos/spinner/decimal.html @@ -0,0 +1,58 @@ + + + + + jQuery UI Spinner - decimal + + + + + + + + + + + + + + + +
+

+ + +

+

+ + +

+
+ +
+

+ Example of a decimal spinner. Step is set to 0.01. +
The code handling the culture change reads the current spinner value, + then changes the culture, then sets the value again, resulting in an updated + formatting, based on the new culture. +

+
+ + + diff --git a/demos/spinner/donation.html b/demos/spinner/donation.html deleted file mode 100644 index 617570b12..000000000 --- a/demos/spinner/donation.html +++ /dev/null @@ -1,74 +0,0 @@ - - - - - jQuery UI Spinner - Default functionality - - - - - - - - - - - - -
- -

- - -

-

- - -

-
- -
-

-Example of a donation form, with currency selection and amout spinner. -

-
- - - diff --git a/demos/spinner/hexadecimal.html b/demos/spinner/hexadecimal.html deleted file mode 100644 index 03952a62d..000000000 --- a/demos/spinner/hexadecimal.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - jQuery UI Spinner - Hexadecimal - - - - - - - - - - - - -
- -

- - -

-
- -
-

-Example of a hexadecimal spinner. -

-
- - - diff --git a/demos/spinner/index.html b/demos/spinner/index.html index 6d7b980bd..68716ac99 100644 --- a/demos/spinner/index.html +++ b/demos/spinner/index.html @@ -9,8 +9,8 @@

Examples

diff --git a/demos/spinner/rtl.html b/demos/spinner/rtl.html deleted file mode 100644 index 93a2022ff..000000000 --- a/demos/spinner/rtl.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - jQuery UI Spinner - Default functionality - - - - - - - - - - - - -
- -

-

- -
- -
-

-Default spinner. -

-
- - - -- cgit v1.2.3 From fceb70d526587b78ceeaa7035ad5e9f152d79816 Mon Sep 17 00:00:00 2001 From: jzaefferer Date: Tue, 2 Nov 2010 16:41:11 +0100 Subject: Spinner: Adding overflow demo --- demos/spinner/index.html | 1 + demos/spinner/overflow.html | 47 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 demos/spinner/overflow.html (limited to 'demos/spinner') diff --git a/demos/spinner/index.html b/demos/spinner/index.html index f43f6e2a1..766f6552c 100644 --- a/demos/spinner/index.html +++ b/demos/spinner/index.html @@ -13,6 +13,7 @@
  • Currency
  • Map
  • Mousewheel Disabled
  • +
  • Overflow
  • diff --git a/demos/spinner/overflow.html b/demos/spinner/overflow.html new file mode 100644 index 000000000..716489155 --- /dev/null +++ b/demos/spinner/overflow.html @@ -0,0 +1,47 @@ + + + + + jQuery UI Spinner - Default functionality + + + + + + + + + + + + +
    +

    + + +

    +
    + +
    +

    + Overflowing spinner restricted to a range of -10 to 10. + For anything above 10, it'll overflow to -10, and the other way round. +

    +
    + + + -- cgit v1.2.3 From 970befceb4b782181fdca990971334a021000afb Mon Sep 17 00:00:00 2001 From: jzaefferer Date: Sun, 28 Nov 2010 19:59:29 +0100 Subject: Spinner: Add demo for time spinner --- demos/spinner/index.html | 2 +- demos/spinner/time.html | 61 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 demos/spinner/time.html (limited to 'demos/spinner') diff --git a/demos/spinner/index.html b/demos/spinner/index.html index 766f6552c..a49fa1368 100644 --- a/demos/spinner/index.html +++ b/demos/spinner/index.html @@ -12,7 +12,7 @@
  • Decimal
  • Currency
  • Map
  • -
  • Mousewheel Disabled
  • +
  • Time
  • Overflow
  • diff --git a/demos/spinner/time.html b/demos/spinner/time.html new file mode 100644 index 000000000..2f55d0f09 --- /dev/null +++ b/demos/spinner/time.html @@ -0,0 +1,61 @@ + + + + + jQuery UI Spinner - decimal + + + + + + + + + + + + + + + +
    +

    + + +

    +
    + +
    +

    + Example of a decimal spinner. Step is set to 0.01. +
    The code handling the culture change reads the current spinner value, + then changes the culture, then sets the value again, resulting in an updated + formatting, based on the new culture. +

    +
    + + + -- cgit v1.2.3 From 0d0ec376e35f1eaaba8199c2abc83a17d5c655a8 Mon Sep 17 00:00:00 2001 From: jzaefferer Date: Wed, 1 Dec 2010 23:28:05 +0100 Subject: Spinner: Introduce page option to configure page size. Use that for timespinner demo to spin minutes on cursor up/down, hours on page up/down. --- demos/spinner/time.html | 36 ++++++++++++++++++++++++------------ ui/jquery.ui.spinner.js | 12 +++++------- 2 files changed, 29 insertions(+), 19 deletions(-) (limited to 'demos/spinner') diff --git a/demos/spinner/time.html b/demos/spinner/time.html index 2f55d0f09..4913a6307 100644 --- a/demos/spinner/time.html +++ b/demos/spinner/time.html @@ -8,7 +8,6 @@ - @@ -16,25 +15,31 @@ @@ -44,7 +49,14 @@

    - + +

    +

    + +

    diff --git a/ui/jquery.ui.spinner.js b/ui/jquery.ui.spinner.js index 7f32adbd8..39a498359 100644 --- a/ui/jquery.ui.spinner.js +++ b/ui/jquery.ui.spinner.js @@ -13,15 +13,13 @@ */ (function($) { -// shortcut constants -var pageModifier = 10; - $.widget('ui.spinner', { options: { incremental: true, max: null, min: null, numberformat: null, + page: 10, step: null, value: null }, @@ -161,10 +159,10 @@ $.widget('ui.spinner', { this._repeat(null, -1, event); return false; case KEYS.PAGE_UP: - this._repeat(null, pageModifier, event); + this._repeat(null, this.options.page, event); return false; case KEYS.PAGE_DOWN: - this._repeat(null, -pageModifier, event); + this._repeat(null, -this.options.page, event); return false; case KEYS.ENTER: @@ -340,11 +338,11 @@ $.widget('ui.spinner', { }, pageUp: function(pages) { - this.stepUp((pages || 1) * pageModifier); + this.stepUp((pages || 1) * this.options.page); }, pageDown: function(pages) { - this.stepDown((pages || 1) * pageModifier); + this.stepDown((pages || 1) * this.options.page); }, value: function(newVal) { -- cgit v1.2.3 From 26bc70180ac239f198334f9f040719a7ca2f5bb4 Mon Sep 17 00:00:00 2001 From: jzaefferer Date: Wed, 1 Dec 2010 23:31:01 +0100 Subject: Spinner: Update timespinner demo description. --- demos/spinner/time.html | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'demos/spinner') diff --git a/demos/spinner/time.html b/demos/spinner/time.html index 4913a6307..72027eb1e 100644 --- a/demos/spinner/time.html +++ b/demos/spinner/time.html @@ -62,10 +62,9 @@

    - Example of a decimal spinner. Step is set to 0.01. -
    The code handling the culture change reads the current spinner value, - then changes the culture, then sets the value again, resulting in an updated - formatting, based on the new culture. + A custom widget extending spinner. Use the Globalization plugin to parse and output + a timestamp, with custom step and page options. Cursor up/down spins minutes, page up/down + spins hours.

    -- cgit v1.2.3