From 4cb82e12b2dc147c7107efd243fd9df3c1ec9300 Mon Sep 17 00:00:00 2001 From: IonDen Date: Sat, 8 Nov 2014 18:14:16 +0300 Subject: [PATCH] Update to 2.0 --- PSD/sprite-skin.psd | Bin 131400 -> 164259 bytes bower.json | 8 +- css/ion.rangeSlider.css | 54 +- css/ion.rangeSlider.skinFlat.css | 29 +- css/ion.rangeSlider.skinHTML5.css | 124 ++ css/ion.rangeSlider.skinModern.css | 116 ++ css/ion.rangeSlider.skinNice.css | 29 +- css/ion.rangeSlider.skinSimple.css | 29 +- css/normalize.css | 427 +++++ css/normalize.min.css | 50 - img/sprite-skin-flat.png | Bin 352 -> 304 bytes img/sprite-skin-modern.png | Bin 0 -> 505 bytes img/sprite-skin-nice.png | Bin 1022 -> 694 bytes img/sprite-skin-simple.png | Bin 385 -> 358 bytes ion-rangeSlider.jquery.json | 7 +- js/ion.rangeSlider.js | 2503 ++++++++++++++++------------ js/ion.rangeSlider.min.js | 84 +- package.json | 32 + readme.md | 456 +++-- readme.ru.md | 454 +++-- 20 files changed, 2959 insertions(+), 1443 deletions(-) mode change 100644 => 100755 PSD/sprite-skin.psd create mode 100644 css/ion.rangeSlider.skinHTML5.css create mode 100644 css/ion.rangeSlider.skinModern.css create mode 100644 css/normalize.css delete mode 100644 css/normalize.min.css create mode 100644 img/sprite-skin-modern.png create mode 100644 package.json diff --git a/PSD/sprite-skin.psd b/PSD/sprite-skin.psd old mode 100644 new mode 100755 index a3e9a84e334257a3b0037dbd5f5ce12b861fa6ac..0b539392da51197d9a6bb50fffcafd5be25d4556 GIT binary patch literal 164259 zcmeD^31Cx2)0?D}-cT+PQ9|WZY0{=AXD^Nlh1wQG@k-OQjigCUQVM>bA4bLdL`4x1 z1-ww?^8%!mTLI}u1wmA(a)^LJp~&5)@1NOsCQaLvqJaNe*4PYf zMscdK&@}3Pn=$+Tu{nnOCmRy;B8CkO8a#F2)S}`dqeHKrT4c7^2TmOlq0h7C8V7YqBq>k1`#b~rqnke0X zsK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 +20,9 @@ "css/ion.rangeSlider.skinFlat.css", "img/sprite-skin-flat.png" ], + "dependencies": { + "jquery": ">=1.8" + }, "moduleType": [ "globals" ], diff --git a/css/ion.rangeSlider.css b/css/ion.rangeSlider.css index 459da41..14ee19d 100644 --- a/css/ion.rangeSlider.css +++ b/css/ion.rangeSlider.css @@ -1,5 +1,5 @@ /* Ion.RangeSlider -// css version 1.9.2 +// css version 2.0.0 // © 2013-2014 Denis Ineshin | IonDen.com // ===================================================================================================================*/ @@ -8,6 +8,12 @@ .irs { position: relative; display: block; + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; } .irs-line { position: relative; display: block; @@ -18,19 +24,29 @@ top: 0; } .irs-line-left { - left: 0; width: 10%; + left: 0; width: 11%; } .irs-line-mid { left: 9%; width: 82%; } .irs-line-right { - right: 0; width: 10%; + right: 0; width: 11%; } - .irs-diapason { + .irs-bar { position: absolute; display: block; - left: 0; width: 100%; + left: 0; width: 0; } + .irs-bar-edge { + position: absolute; display: block; + top: 0; left: 0; + } + + .irs-shadow { + position: absolute; display: none; + left: 0; width: 0; + } + .irs-slider { position: absolute; display: block; cursor: default; @@ -63,7 +79,7 @@ width: 130%; height: 160%; background: rgba(0,0,0,0.0); } - .irs-slider.last { + .irs-slider.type_last { z-index: 2; } @@ -85,7 +101,6 @@ white-space: nowrap; } - .irs-grid { position: absolute; display: none; bottom: 0; left: 0; @@ -106,17 +121,17 @@ .irs-grid-text { position: absolute; bottom: 0; left: 0; - width: 100px; white-space: nowrap; text-align: center; font-size: 9px; line-height: 9px; + padding: 0 3px; color: #000; } .irs-disable-mask { position: absolute; display: block; - top: 0; left: 0; - width: 100%; height: 100%; + top: 0; left: -1%; + width: 102%; height: 100%; cursor: default; background: rgba(0,0,0,0.0); z-index: 2; @@ -124,3 +139,22 @@ .irs-disabled { opacity: 0.4; } +.lt-ie9 .irs-disabled { + filter: alpha(opacity=40); +} + + +.irs-hidden-input { + position: absolute !important; + display: block !important; + top: 0 !important; + left: 0 !important; + width: 0 !important; + height: 0 !important; + font-size: 0 !important; + line-height: 0 !important; + padding: 0 !important; + margin: 0 !important; + outline: none !important; + z-index: -9999 !important; +} diff --git a/css/ion.rangeSlider.skinFlat.css b/css/ion.rangeSlider.skinFlat.css index 0963c87..90c52fb 100644 --- a/css/ion.rangeSlider.skinFlat.css +++ b/css/ion.rangeSlider.skinFlat.css @@ -1,6 +1,6 @@ /* Ion.RangeSlider, Flat UI Skin -// css version 1.9.2 -// © 2013-2014 Denis Ineshin | IonDen.com +// css version 2.0.0 +// © Denis Ineshin, 2014 https://github.com/IonDen // ===================================================================================================================*/ /* ===================================================================================================================== @@ -9,7 +9,8 @@ .irs-line-mid, .irs-line-left, .irs-line-right, -.irs-diapason, +.irs-bar, +.irs-bar-edge, .irs-slider { background: url(../img/sprite-skin-flat.png) repeat-x; } @@ -36,18 +37,32 @@ background-position: 100% -30px; } -.irs-diapason { +.irs-bar { height: 12px; top: 25px; background-position: 0 -60px; } + .irs-bar-edge { + top: 25px; + height: 12px; width: 9px; + background-position: 0 -90px; + } + +.irs-shadow { + height: 3px; top: 34px; + background: #000; + opacity: 0.25; +} +.lt-ie9 .irs-shadow { + filter: alpha(opacity=25); +} .irs-slider { width: 16px; height: 18px; top: 22px; - background-position: 0 -90px; + background-position: 0 -120px; } #irs-active-slider, .irs-slider:hover { - background-position: 0 -120px; + background-position: 0 -150px; } .irs-min, .irs-max { @@ -56,6 +71,7 @@ text-shadow: none; top: 0; padding: 1px 3px; background: #e1e4e9; + -moz-border-radius: 4px; border-radius: 4px; } @@ -65,6 +81,7 @@ text-shadow: none; padding: 1px 5px; background: #ed5565; + -moz-border-radius: 4px; border-radius: 4px; } .irs-from:after, .irs-to:after, .irs-single:after { diff --git a/css/ion.rangeSlider.skinHTML5.css b/css/ion.rangeSlider.skinHTML5.css new file mode 100644 index 0000000..5c7083a --- /dev/null +++ b/css/ion.rangeSlider.skinHTML5.css @@ -0,0 +1,124 @@ +/* Ion.RangeSlider, Simple Skin +// css version 2.0.0 +// © Denis Ineshin, 2014 https://github.com/IonDen +// © guybowden, 2014 https://github.com/guybowden +// ===================================================================================================================*/ + +/* ===================================================================================================================== +// Skin details */ + +.irs { + height: 55px; +} +.irs-with-grid { + height: 75px; +} +.irs-line { + height: 10px; top: 33px; + background: #EEE; + background: linear-gradient(to bottom, #DDD -50%, #FFF 150%); /* W3C */ + border: 1px solid #CCC; + border-radius: 16px; + -moz-border-radius: 16px; +} + .irs-line-left { + height: 8px; + } + .irs-line-mid { + height: 8px; + } + .irs-line-right { + height: 8px; + } + +.irs-bar { + height: 10px; top: 33px; + border-top: 1px solid #428bca; + border-bottom: 1px solid #428bca; + background: #428bca; + background: linear-gradient(to top, rgba(66,139,202,1) 0%,rgba(127,195,232,1) 100%); /* W3C */ +} + .irs-bar-edge { + height: 10px; top: 33px; + width: 14px; + border: 1px solid #428bca; + border-right: 0; + background: #428bca; + background: linear-gradient(to top, rgba(66,139,202,1) 0%,rgba(127,195,232,1) 100%); /* W3C */ + border-radius: 16px 0 0 16px; + -moz-border-radius: 16px 0 0 16px; + } + +.irs-shadow { + height: 2px; top: 38px; + background: #000; + opacity: 0.3; + border-radius: 5px; + -moz-border-radius: 5px; +} +.lt-ie9 .irs-shadow { + filter: alpha(opacity=30); +} + +.irs-slider { + top: 25px; + width: 27px; height: 27px; + border: 1px solid #AAA; + background: #DDD; + background: linear-gradient(to bottom, rgba(255,255,255,1) 0%,rgba(220,220,220,1) 20%,rgba(255,255,255,1) 100%); /* W3C */ + border-radius: 27px; + -moz-border-radius: 27px; + box-shadow: 1px 1px 3px rgba(0,0,0,0.3); + cursor: pointer; +} + +#irs-active-slider, .irs-slider:hover { + background: #FFF; +} + +.irs-min, .irs-max { + color: #333; + font-size: 12px; line-height: 1.333; + text-shadow: none; + top: 0; + padding: 1px 5px; + background: rgba(0,0,0,0.1); + border-radius: 3px; + -moz-border-radius: 3px; +} + +.lt-ie9 .irs-min, .lt-ie9 .irs-max { + background: #ccc; +} + +.irs-from, .irs-to, .irs-single { + color: #fff; + font-size: 14px; line-height: 1.333; + text-shadow: none; + padding: 1px 5px; + background: #428bca; + border-radius: 3px; + -moz-border-radius: 3px; +} +.lt-ie9 .irs-from, .lt-ie9 .irs-to, .lt-ie9 .irs-single { + background: #999; +} + +.irs-grid { + height: 27px; +} +.irs-grid-pol { + opacity: 0.5; + background: #428bca; +} +.irs-grid-pol.small { + background: #999; +} + +.irs-grid-text { + bottom: 5px; + color: #99a4ac; +} + +.irs-disabled { +} diff --git a/css/ion.rangeSlider.skinModern.css b/css/ion.rangeSlider.skinModern.css new file mode 100644 index 0000000..b0bf5d1 --- /dev/null +++ b/css/ion.rangeSlider.skinModern.css @@ -0,0 +1,116 @@ +/* Ion.RangeSlider, Modern Skin +// css version 2.0.0 +// © Denis Ineshin, 2014 https://github.com/IonDen +// ===================================================================================================================*/ + +/* ===================================================================================================================== +// Skin details */ + +.irs-line-mid, +.irs-line-left, +.irs-line-right, +.irs-bar, +.irs-bar-edge, +.irs-slider { + background: url(../img/sprite-skin-modern.png) repeat-x; +} + +.irs { + height: 50px; +} +.irs-with-grid { + height: 70px; +} +.irs-line { + height: 6px; top: 25px; +} + .irs-line-left { + height: 6px; + background-position: 0 -30px; + } + .irs-line-mid { + height: 6px; + background-position: 0 0; + } + .irs-line-right { + height: 6px; + background-position: 100% -30px; + } + +.irs-bar { + height: 6px; top: 25px; + background-position: 0 -60px; +} + .irs-bar-edge { + top: 25px; + height: 6px; width: 6px; + background-position: 0 -90px; + } + +.irs-shadow { + height: 5px; top: 25px; + background: #000; + opacity: 0.25; +} +.lt-ie9 .irs-shadow { + filter: alpha(opacity=25); +} + +.irs-slider { + width: 11px; height: 18px; + top: 31px; + background-position: 0 -120px; +} +#irs-active-slider, .irs-slider:hover { + background-position: 0 -150px; +} + +.irs-min, .irs-max { + color: #999; + font-size: 10px; line-height: 1.333; + text-shadow: none; + top: 0; padding: 1px 3px; + background: #e1e4e9; + -moz-border-radius: 4px; + border-radius: 4px; +} + +.irs-from, .irs-to, .irs-single { + color: #fff; + font-size: 10px; line-height: 1.333; + text-shadow: none; + padding: 1px 5px; + background: #20b426; + -moz-border-radius: 4px; + border-radius: 4px; +} +.irs-from:after, .irs-to:after, .irs-single:after { + position: absolute; display: block; content: ""; + bottom: -6px; left: 50%; + width: 0; height: 0; + margin-left: -3px; + overflow: hidden; + border: 3px solid transparent; + border-top-color: #20b426; +} + +.irs-grid { + height: 34px; +} +.irs-grid-pol { + background: #c0c0c0; +} +.irs-grid-text { + bottom: 12px; + color: #c0c0c0; +} + +.irs-disable-mask { + +} +.irs-disabled { + +} +.lt-ie9 .irs-disabled { + +} diff --git a/css/ion.rangeSlider.skinNice.css b/css/ion.rangeSlider.skinNice.css index d74bc11..670c151 100644 --- a/css/ion.rangeSlider.skinNice.css +++ b/css/ion.rangeSlider.skinNice.css @@ -1,6 +1,6 @@ /* Ion.RangeSlider, Nice Skin -// css version 1.9.2 -// © 2013-2014 Denis Ineshin | IonDen.com +// css version 2.0.0 +// © Denis Ineshin, 2014 https://github.com/IonDen // ===================================================================================================================*/ /* ===================================================================================================================== @@ -9,7 +9,8 @@ .irs-line-mid, .irs-line-left, .irs-line-right, -.irs-diapason, +.irs-bar, +.irs-bar-edge, .irs-slider { background: url(../img/sprite-skin-nice.png) repeat-x; } @@ -36,18 +37,32 @@ background-position: 100% -30px; } -.irs-diapason { +.irs-bar { height: 8px; top: 25px; background-position: 0 -60px; } + .irs-bar-edge { + top: 25px; + height: 8px; width: 11px; + background-position: 0 -90px; + } + +.irs-shadow { + height: 1px; top: 34px; + background: #000; + opacity: 0.15; +} +.lt-ie9 .irs-shadow { + filter: alpha(opacity=15); +} .irs-slider { width: 22px; height: 22px; top: 17px; - background-position: 0 -90px; + background-position: 0 -120px; } #irs-active-slider, .irs-slider:hover { - background-position: 0 -120px; + background-position: 0 -150px; } .irs-min, .irs-max { @@ -56,6 +71,7 @@ text-shadow: none; top: 0; padding: 1px 3px; background: rgba(0,0,0,0.1); + -moz-border-radius: 3px; border-radius: 3px; } .lt-ie9 .irs-min, .lt-ie9 .irs-max { @@ -68,6 +84,7 @@ text-shadow: none; padding: 1px 5px; background: rgba(0,0,0,0.3); + -moz-border-radius: 3px; border-radius: 3px; } .lt-ie9 .irs-from, .lt-ie9 .irs-to, .lt-ie9 .irs-single { diff --git a/css/ion.rangeSlider.skinSimple.css b/css/ion.rangeSlider.skinSimple.css index 38d1dfb..04d9494 100644 --- a/css/ion.rangeSlider.skinSimple.css +++ b/css/ion.rangeSlider.skinSimple.css @@ -1,6 +1,6 @@ /* Ion.RangeSlider, Simple Skin -// css version 1.9.2 -// © 2013-2014 Denis Ineshin | IonDen.com +// css version 2.0.0 +// © Denis Ineshin, 2014 https://github.com/IonDen // ===================================================================================================================*/ /* ===================================================================================================================== @@ -9,7 +9,8 @@ .irs-line-mid, .irs-line-left, .irs-line-right, -.irs-diapason, +.irs-bar, +.irs-bar-edge, .irs-slider { background: url(../img/sprite-skin-simple.png) repeat-x; } @@ -36,18 +37,32 @@ background-position: 100% -30px; } -.irs-diapason { +.irs-bar { height: 6px; top: 25px; background-position: 0 -60px; } + .irs-bar-edge { + top: 25px; + height: 6px; width: 7px; + background-position: 0 -90px; + } + +.irs-shadow { + height: 1px; top: 34px; + background: #000; + opacity: 0.75; +} +.lt-ie9 .irs-shadow { + filter: alpha(opacity=75); +} .irs-slider { width: 8px; height: 15px; top: 21px; - background-position: 0 -90px; + background-position: 0 -120px; } #irs-active-slider, .irs-slider:hover { - background-position: 0 -120px; + background-position: 0 -150px; } .irs-min, .irs-max { @@ -56,6 +71,7 @@ text-shadow: none; top: 0; padding: 1px 3px; background: rgba(0,0,0,0.1); + -moz-border-radius: 3px; border-radius: 3px; } .lt-ie9 .irs-min, .lt-ie9 .irs-max { @@ -68,6 +84,7 @@ text-shadow: none; padding: 1px 5px; background: rgba(255,255,255,0.8); + -moz-border-radius: 3px; border-radius: 3px; } .lt-ie9 .irs-from, .lt-ie9 .irs-to, .lt-ie9 .irs-single { diff --git a/css/normalize.css b/css/normalize.css new file mode 100644 index 0000000..46f646a --- /dev/null +++ b/css/normalize.css @@ -0,0 +1,427 @@ +/*! normalize.css v3.0.2 | MIT License | git.io/normalize */ + +/** + * 1. Set default font family to sans-serif. + * 2. Prevent iOS text size adjust after orientation change, without disabling + * user zoom. + */ + +html { + font-family: sans-serif; /* 1 */ + -ms-text-size-adjust: 100%; /* 2 */ + -webkit-text-size-adjust: 100%; /* 2 */ +} + +/** + * Remove default margin. + */ + +body { + margin: 0; +} + +/* HTML5 display definitions + ========================================================================== */ + +/** + * Correct `block` display not defined for any HTML5 element in IE 8/9. + * Correct `block` display not defined for `details` or `summary` in IE 10/11 + * and Firefox. + * Correct `block` display not defined for `main` in IE 11. + */ + +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +main, +menu, +nav, +section, +summary { + display: block; +} + +/** + * 1. Correct `inline-block` display not defined in IE 8/9. + * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera. + */ + +audio, +canvas, +progress, +video { + display: inline-block; /* 1 */ + vertical-align: baseline; /* 2 */ +} + +/** + * Prevent modern browsers from displaying `audio` without controls. + * Remove excess height in iOS 5 devices. + */ + +audio:not([controls]) { + display: none; + height: 0; +} + +/** + * Address `[hidden]` styling not present in IE 8/9/10. + * Hide the `template` element in IE 8/9/11, Safari, and Firefox < 22. + */ + +[hidden], +template { + display: none; +} + +/* Links + ========================================================================== */ + +/** + * Remove the gray background color from active links in IE 10. + */ + +a { + background-color: transparent; +} + +/** + * Improve readability when focused and also mouse hovered in all browsers. + */ + +a:active, +a:hover { + outline: 0; +} + +/* Text-level semantics + ========================================================================== */ + +/** + * Address styling not present in IE 8/9/10/11, Safari, and Chrome. + */ + +abbr[title] { + border-bottom: 1px dotted; +} + +/** + * Address style set to `bolder` in Firefox 4+, Safari, and Chrome. + */ + +b, +strong { + font-weight: bold; +} + +/** + * Address styling not present in Safari and Chrome. + */ + +dfn { + font-style: italic; +} + +/** + * Address variable `h1` font-size and margin within `section` and `article` + * contexts in Firefox 4+, Safari, and Chrome. + */ + +h1 { + font-size: 2em; + margin: 0.67em 0; +} + +/** + * Address styling not present in IE 8/9. + */ + +mark { + background: #ff0; + color: #000; +} + +/** + * Address inconsistent and variable font size in all browsers. + */ + +small { + font-size: 80%; +} + +/** + * Prevent `sub` and `sup` affecting `line-height` in all browsers. + */ + +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sup { + top: -0.5em; +} + +sub { + bottom: -0.25em; +} + +/* Embedded content + ========================================================================== */ + +/** + * Remove border when inside `a` element in IE 8/9/10. + */ + +img { + border: 0; +} + +/** + * Correct overflow not hidden in IE 9/10/11. + */ + +svg:not(:root) { + overflow: hidden; +} + +/* Grouping content + ========================================================================== */ + +/** + * Address margin not present in IE 8/9 and Safari. + */ + +figure { + margin: 1em 40px; +} + +/** + * Address differences between Firefox and other browsers. + */ + +hr { + -moz-box-sizing: content-box; + box-sizing: content-box; + height: 0; +} + +/** + * Contain overflow in all browsers. + */ + +pre { + overflow: auto; +} + +/** + * Address odd `em`-unit font size rendering in all browsers. + */ + +code, +kbd, +pre, +samp { + font-family: monospace, monospace; + font-size: 1em; +} + +/* Forms + ========================================================================== */ + +/** + * Known limitation: by default, Chrome and Safari on OS X allow very limited + * styling of `select`, unless a `border` property is set. + */ + +/** + * 1. Correct color not being inherited. + * Known issue: affects color of disabled elements. + * 2. Correct font properties not being inherited. + * 3. Address margins set differently in Firefox 4+, Safari, and Chrome. + */ + +button, +input, +optgroup, +select, +textarea { + color: inherit; /* 1 */ + font: inherit; /* 2 */ + margin: 0; /* 3 */ +} + +/** + * Address `overflow` set to `hidden` in IE 8/9/10/11. + */ + +button { + overflow: visible; +} + +/** + * Address inconsistent `text-transform` inheritance for `button` and `select`. + * All other form control elements do not inherit `text-transform` values. + * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera. + * Correct `select` style inheritance in Firefox. + */ + +button, +select { + text-transform: none; +} + +/** + * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` + * and `video` controls. + * 2. Correct inability to style clickable `input` types in iOS. + * 3. Improve usability and consistency of cursor style between image-type + * `input` and others. + */ + +button, +html input[type="button"], /* 1 */ +input[type="reset"], +input[type="submit"] { + -webkit-appearance: button; /* 2 */ + cursor: pointer; /* 3 */ +} + +/** + * Re-set default cursor for disabled elements. + */ + +button[disabled], +html input[disabled] { + cursor: default; +} + +/** + * Remove inner padding and border in Firefox 4+. + */ + +button::-moz-focus-inner, +input::-moz-focus-inner { + border: 0; + padding: 0; +} + +/** + * Address Firefox 4+ setting `line-height` on `input` using `!important` in + * the UA stylesheet. + */ + +input { + line-height: normal; +} + +/** + * It's recommended that you don't attempt to style these elements. + * Firefox's implementation doesn't respect box-sizing, padding, or width. + * + * 1. Address box sizing set to `content-box` in IE 8/9/10. + * 2. Remove excess padding in IE 8/9/10. + */ + +input[type="checkbox"], +input[type="radio"] { + box-sizing: border-box; /* 1 */ + padding: 0; /* 2 */ +} + +/** + * Fix the cursor style for Chrome's increment/decrement buttons. For certain + * `font-size` values of the `input`, it causes the cursor style of the + * decrement button to change from `default` to `text`. + */ + +input[type="number"]::-webkit-inner-spin-button, +input[type="number"]::-webkit-outer-spin-button { + height: auto; +} + +/** + * 1. Address `appearance` set to `searchfield` in Safari and Chrome. + * 2. Address `box-sizing` set to `border-box` in Safari and Chrome + * (include `-moz` to future-proof). + */ + +input[type="search"] { + -webkit-appearance: textfield; /* 1 */ + -moz-box-sizing: content-box; + -webkit-box-sizing: content-box; /* 2 */ + box-sizing: content-box; +} + +/** + * Remove inner padding and search cancel button in Safari and Chrome on OS X. + * Safari (but not Chrome) clips the cancel button when the search input has + * padding (and `textfield` appearance). + */ + +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} + +/** + * Define consistent border, margin, and padding. + */ + +fieldset { + border: 1px solid #c0c0c0; + margin: 0 2px; + padding: 0.35em 0.625em 0.75em; +} + +/** + * 1. Correct `color` not being inherited in IE 8/9/10/11. + * 2. Remove padding so people aren't caught out if they zero out fieldsets. + */ + +legend { + border: 0; /* 1 */ + padding: 0; /* 2 */ +} + +/** + * Remove default vertical scrollbar in IE 8/9/10/11. + */ + +textarea { + overflow: auto; +} + +/** + * Don't inherit the `font-weight` (applied by a rule above). + * NOTE: the default cannot safely be changed in Chrome and Safari on OS X. + */ + +optgroup { + font-weight: bold; +} + +/* Tables + ========================================================================== */ + +/** + * Remove most spacing between table cells. + */ + +table { + border-collapse: collapse; + border-spacing: 0; +} + +td, +th { + padding: 0; +} diff --git a/css/normalize.min.css b/css/normalize.min.css deleted file mode 100644 index a783c53..0000000 --- a/css/normalize.min.css +++ /dev/null @@ -1,50 +0,0 @@ -/*! normalize.css v1.0.1 | MIT License | git.io/normalize */ -article,aside,details,figcaption,figure,footer,header,hgroup,nav,section,summary{display:block} -audio,canvas,video{display:inline-block;*display:inline;*zoom:1} -audio:not([controls]){display:none;height:0} -[hidden]{display:none} -html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%} -html,button,input,select,textarea{font-family:sans-serif} -body{margin:0} -a:focus{outline:thin dotted} -a:active,a:hover{outline:0} -h1{font-size:2em;margin:.67em 0} -h2{font-size:1.5em;margin:.83em 0} -h3{font-size:1.17em;margin:1em 0} -h4{font-size:1em;margin:1.33em 0} -h5{font-size:.83em;margin:1.67em 0} -h6{font-size:.75em;margin:2.33em 0} -abbr[title]{border-bottom:1px dotted} -b,strong{font-weight:bold} -blockquote{margin:1em 40px} -dfn{font-style:italic} -mark{background:#ff0;color:#000} -p,pre{margin:1em 0} -code,kbd,pre,samp{font-family:monospace,serif;_font-family:'courier new',monospace;font-size:1em} -pre{white-space:pre;white-space:pre-wrap;word-wrap:break-word} -q{quotes:none} -q:before,q:after{content:'';content:none} -small{font-size:80%} -sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline} -sup{top:-0.5em} -sub{bottom:-0.25em} -dl,menu,ol,ul{margin:1em 0} -dd{margin:0 0 0 40px} -menu,ol,ul{padding:0 0 0 40px} -nav ul,nav ol{list-style:none;list-style-image:none} -img{border:0;-ms-interpolation-mode:bicubic} -svg:not(:root){overflow:hidden} -figure{margin:0} -form{margin:0} -fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:.35em .625em .75em} -legend{border:0;padding:0;white-space:normal;*margin-left:-7px} -button,input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle} -button,input{line-height:normal} -button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer;*overflow:visible} -button[disabled],input[disabled]{cursor:default} -input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0;*height:13px;*width:13px} -input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box} -input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none} -button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0} -textarea{overflow:auto;vertical-align:top} -table{border-collapse:collapse;border-spacing:0} \ No newline at end of file diff --git a/img/sprite-skin-flat.png b/img/sprite-skin-flat.png index 3055db77f53a769b1f81971af56edfe6e78dde8f..0f11c7cb5dfa4ad54ac603fd2fc6afadea63efa3 100644 GIT binary patch delta 290 zcmaFBw1H`Yc>NX@W(Ed^hS~lEaktaqI0hMLs4&fwqfjtP2z?3@TW{Bm6yVxy}k& zSV{7GhM!IOe2>%aqTj!3mpvyaI5xGc;$*02=$Wz3_Ugkc=WK88yIZx%-TGU~cP{09 z%O?wH*&Jt@zv)1xR>1;B28oYe>W)n;oI`zYCXKPqETZOo4 zPBATCd7zPvA>qQao15O+{yuY`5qep_nzlrzG=twH?y z7AOJK$iSdg`ekD6S=0Bg9-p~)Y|Urg-PKz@PT0Kef}-ptMO)Jy)tv^vm8T;g)!xi doyiBv|6sh=Dt;-h=9&=5I8RqUmvv4FO#rrLh+hBz diff --git a/img/sprite-skin-modern.png b/img/sprite-skin-modern.png new file mode 100644 index 0000000000000000000000000000000000000000..c9060f2756791db4fcfebaa02bf1ca6b55ea7b5c GIT binary patch literal 505 zcmeAS@N?(olHy`uVBq!ia0y~yU}OQZw{S26N!RQ}KY^5efKP}kkbeF4!|8KZ4jewE zutn{{)&t1GKBslo~gD1;ZZ#p(z z@*vO%&XOR%UgJ#RdWmfsBPlU3IxN|2Okl z%v*U%k30S9`_hAq`-Gw{tPBcP>sDyu_`lT26KEO`tS`E0mz5!ZTQyht__jXXwU&Dn zoz7)z6`$YuRyEeEVmin(3=AK%=GSxq^(obKgZT^xxc^pGZ=YScd4bo3XgDmXZa&C;#!PXXKZ5R^|-!BiE#{LB!T6-}Z;+jJNX*W(EcZ*X%_<;sN%7tVtLM0nT1V-W79 z9eZXkTiZK*9+2BJZSIQoTW2m=^Z);UAb0A56@4@2|7T(O^7ZSTJ9qy4`SbSe+w0e_ z&tJLm|IM5KgMuc{TWXoq!defsO{65qFPLHfrBgqeVsFnma`2a%Gwbhn`zP+xl6dxv zfr0Ubr;B4q#jUru1B(|Kh_pQvX3lW97}X@?aOMAhW%H)gwY%ruy!maJ?fc@Vy7wjg zCglsbxXV0kXbxGy(I~)?sFs!_uACh^Z??Sd`MI^#QO1HmJHgZ$s_?^fK*i|=~V zfBm)N=GWPpyI(K7lso&FfY#G(Zr^S>-w<;HCgD)^mj640`12OJjQ84pA$eXQBoum^k zeNnqQ^Y??=7q_STO!4wRc)vAROKWNF^Yqx&My+qI{A9oD`M7IEbG`bDmy6P8msNd9 zlIYUx3%lPF@zw5CyOz|l``Q=NBx^!K79Vm?)V!tgFRgxsTl0QTm)T2{TlVX;``s^k za8zRLa>1MT-BRp(Pi$RrIIT0+m|dgqlK-Y%Z>{gQ?pqtWu66gUeAprrvi;Jj y_@39t1wFObR%||^vTY`_hYg$i zi2er!{TC4U&&T(lm-jyp&wmC6ncJJ?fWens666=mz{bYN;^ge&<{lQ;-Z^vDqW#xz z+`e=7)0dyWKpsQ~S1w<=c>dg(QzuUxJ9^~sp@RqZ?>o3DH$83lfyWQQYJdOw^&6(? z-P^YlCrp@lto$a>HYR>g7srr_xVJY0{VxYdw12Gk?`BBu5j03Rek?($LSla71PN2- zq(?j!J#OqR{V%s09oc&P@+OO~$7VcWo%8(qvbUj=_lc`7uY8i&(CAmV%I?>zenXbF zh8GS?^B12vDIxq@`I7UqPiN#S*J=2rm9_(|1OtaJPapqONRYRaeEIq3@6DGd%-!qb zGcCPwwT#qr&6IPgYGE((R6f6YySwhdy*+j{f|`~EGmkBLZ@zd>&*j3LFB_gjh8@e8 z?Bj3gd*tGE>k4a_xtc+d5jQ#84hTpvO;PIQGclA(-FbShim<3pN*DXx{Bt|^{8;0p zxAMmt3(qg}VVW9Nwm#ju^=Yd+*TlfYb^D^?SN$&DYPZ}WR64pWXLVrcglE^w-}>)< z{h2FZ>Bi*xjh9zwSQOscxc}vnjZVgQx3r$U_pvblve>N4T)t~l_kIh!Z=DsrJ~TKZ zY}?xFucudCyB!x8(KG4Ew>Ym;-a>Z-ik4rH>@}*~>7`s5x$J^Y-k+TYc{*Aqn|-4* zzWe!A$(xAffuReuGB8&&S z*K~qB5jsoDcj_{);H4`sg}mJR@afY6{Wn^7_wM+nx63j7<-^iU51_303ZUfQ+pUH6 sKsnjCSl-?BYcGXlt}=n@24!V?27U8=_x^tMP6rw5>FVdQ&MBb@0IhXYe*gdg diff --git a/img/sprite-skin-simple.png b/img/sprite-skin-simple.png index 3b7647d36a5191bb594441d2ebbf138526ec608b..0dc5e68ed807c752c81445f37409790dd71ecfae 100644 GIT binary patch delta 344 zcmV-e0jK_f1Lgvd7k{(_0{{R3fSXVF0000gP)t-s0000=o}DRnh2D%X4lqCwI!hHr zTNg)RmTg4(s7qtKyilj5K$xdCj;D}&C`C`N1b)GiE zYu;RO_e4?GXfdZ~5yvoL%K$-3UqLHx0dr42V;4RH2R>Z~K5YkHJv$y9TV5UOX}K=< zdJKN8@OJh&Gacvv#*!evUfG*!s)o< z|J`kOSk{XaGIW*Hz2~^>r)6qfoOh?_=`8N)CQ*G%K+Oyc0V^%--+jLDuD|$YZEZet z_4>Wj_vOC6f8bi~>!&7P5Be@gQd#-&)S*eOs{Zpbx5%)9btn8falp$&z>!7J1ws7q zI{97?B)#s-cdxoK$w<%pPaTvx6q+~?1W5Y7LFU7yi~i@H1aUlF{an^LB{Ts5$)k%g diff --git a/ion-rangeSlider.jquery.json b/ion-rangeSlider.jquery.json index 3554646..02224be 100644 --- a/ion-rangeSlider.jquery.json +++ b/ion-rangeSlider.jquery.json @@ -1,6 +1,6 @@ { "name": "ion-rangeSlider", - "version": "1.9.3", + "version": "2.0.0", "title": "Ion.RangeSlider", "description": "Cool, comfortable and easily customizable range slider with many options and skin support", "keywords": [ @@ -13,6 +13,7 @@ "interface", "diapason", "ui", + "noui", "skins" ], "author": { @@ -29,8 +30,8 @@ "homepage": "https://github.com/IonDen/ion.rangeSlider", "docs": "https://github.com/IonDen/ion.rangeSlider/blob/master/readme.md", "demo": "http://ionden.com/a/plugins/ion.rangeSlider/en.html", - "download": "http://ionden.com/a/plugins/ion.rangeSlider/ion.rangeSlider-1.9.3.zip", + "download": "http://ionden.com/a/plugins/ion.rangeSlider/ion.rangeSlider-2.0.0.zip", "dependencies": { - "jquery": ">=1.9" + "jquery": ">=1.8" } } \ No newline at end of file diff --git a/js/ion.rangeSlider.js b/js/ion.rangeSlider.js index 2f80f17..e60cd94 100644 --- a/js/ion.rangeSlider.js +++ b/js/ion.rangeSlider.js @@ -1,19 +1,21 @@ // Ion.RangeSlider -// version 1.9.3 Build: 176 -// © 2013-2014 Denis Ineshin | IonDen.com +// version 2.0.0 Build: 270 +// © Denis Ineshin, 2014 https://github.com/IonDen // -// Project page: http://ionden.com/a/plugins/ion.rangeSlider/ +// Project page: http://ionden.com/a/plugins/ion.rangeSlider/en.html // GitHub page: https://github.com/IonDen/ion.rangeSlider // // Released under MIT licence: // http://ionden.com/a/plugins/licence-en.html // ===================================================================================================================== -(function ($, document, window, navigator) { +;(function ($, document, window, navigator, undefined) { "use strict"; - var plugin_count = 0, - current; + // ================================================================================================================= + // Service + + var plugin_count = 0; var is_old_ie = (function () { var n = navigator.userAgent, @@ -23,1171 +25,1600 @@ v = r.exec(n).toString(); v = v.split(" ")[1]; if (v < 9) { + $("html").addClass("lt-ie9"); return true; } } return false; - }()); + } ()); + var is_touch = (('ontouchstart' in window) || (navigator.msMaxTouchPoints > 0)); - var testNumber = function (num) { - if (typeof num === "number") { - if (isNaN(num)) { - return null; + + + // ================================================================================================================= + // Template + + var base_html = + '' + + '' + + '01' + + '000' + + '' + + '' + + ''; + + var single_html = + '' + + '' + + ''; + + var double_html = + '' + + '' + + '' + + ''; + + var disable_html = + ''; + + + + // ================================================================================================================= + // Core + + var IonRangeSlider = function (input, options, plugin_count) { + this.VERSION = "2.0.0"; + this.input = input; + this.plugin_count = plugin_count; + this.current_plugin = 0; + this.calc_count = 0; + this.old_from = 0; + this.old_to = 0; + this.raf_id = null; + this.dragging = false; + this.force_redraw = false; + this.is_key = false; + this.is_update = false; + this.is_start = true; + this.is_active = false; + + this.$cache = { + win: $(window), + body: $(document.body), + input: $(input), + cont: null, + rs: null, + min: null, + max: null, + from: null, + to: null, + single: null, + bar: null, + line: null, + s_single: null, + s_from: null, + s_to: null, + shad_single: null, + shad_from: null, + shad_to: null, + grid: null, + grid_labels: [] + }; + + // get config data attributes + var $inp = this.$cache.input; + var data = { + min: $inp.data("min"), + max: $inp.data("max"), + from: $inp.data("from"), + to: $inp.data("to"), + step: $inp.data("step"), + + values: $inp.data("values"), + + type: $inp.data("type"), + + from_fixed: $inp.data("fromFixed"), + from_min: $inp.data("fromMin"), + from_max: $inp.data("fromMax"), + from_shadow: $inp.data("fromShadow"), + + to_fixed: $inp.data("toFixed"), + to_min: $inp.data("toMin"), + to_max: $inp.data("toMax"), + to_shadow: $inp.data("toShadow"), + + prettify_enabled: $inp.data("prettifyEnabled"), + prettify_separator: $inp.data("prettifySeparator"), + + force_edges: $inp.data("forceEdges"), + + keyboard: $inp.data("keyboard"), + keyboard_step: $inp.data("keyboardStep"), + + grid: $inp.data("grid"), + grid_margin: $inp.data("gridMargin"), + grid_num: $inp.data("gridNum"), + grid_snap: $inp.data("gridSnap"), + + hide_min_max: $inp.data("hideMinMax"), + hide_from_to: $inp.data("hideFromTo"), + + prefix: $inp.data("prefix"), + postfix: $inp.data("postfix"), + max_postfix: $inp.data("maxPostfix"), + decorate_both: $inp.data("decorateBoth"), + values_separator: $inp.data("valuesSeparator"), + + disable: $inp.data("disable") + }; + data.values = data.values && data.values.split(","); + options = $.extend(data, options); + + // get config from options + this.options = $.extend({ + min: 10, + max: 100, + from: null, + to: null, + step: 1, + + values: [], + p_values: [], + + type: "single", + + from_fixed: false, + from_min: null, + from_max: null, + from_shadow: false, + + to_fixed: false, + to_min: null, + to_max: null, + to_shadow: false, + + prettify_enabled: true, + prettify_separator: " ", + prettify: null, + + force_edges: false, + + keyboard: false, + keyboard_step: 5, + + grid: false, + grid_margin: true, + grid_num: 4, + grid_snap: false, + + hide_min_max: false, + hide_from_to: false, + + prefix: "", + postfix: "", + max_postfix: "", + decorate_both: true, + values_separator: " — ", + + disable: false, + + onStart: null, + onChange: null, + onFinish: null, + onUpdate: null + }, options); + + this.validate(); + + this.result = { + input: this.$cache.input, + slider: null, + + min: this.options.min, + max: this.options.max, + + from: this.options.from, + from_percent: 0, + from_value: null, + + to: this.options.to, + to_percent: 0, + to_value: null + }; + + this.coords = { + // left + x_gap: 0, + x_pointer: 0, + + // width + w_rs: 0, + w_rs_old: 0, + w_handle: 0, + + // percents + p_gap: 0, + p_step: 0, + p_pointer: 0, + p_handle: 0, + p_single: 0, + p_single_real: 0, + p_from: 0, + p_from_real: 0, + p_to: 0, + p_to_real: 0, + p_bar_x: 0, + p_bar_w: 0, + + // grid + grid_gap: 0, + big_num: 0, + big: [], + big_w: [], + big_p: [], + big_x: [] + }; + + this.labels = { + // width + w_min: 0, + w_max: 0, + w_from: 0, + w_to: 0, + w_single: 0, + + // percents + p_min: 0, + p_max: 0, + p_from: 0, + p_from_left: 0, + p_to: 0, + p_to_left: 0, + p_single: 0, + p_single_left: 0 + }; + + this.init(); + }; + + IonRangeSlider.prototype = { + init: function (is_update) { + this.coords.p_step = this.options.step / ((this.options.max - this.options.min) / 100); + this.target = "base"; + + this.toggleInput(); + this.append(); + this.setMinMax(); + + if (is_update) { + this.force_redraw = true; + this.calc(true); + + if (this.options.onUpdate && typeof this.options.onUpdate === "function") { + this.options.onUpdate(this.result); + } } else { - return num; + this.force_redraw = true; + this.calc(true); + + if (this.options.onStart && typeof this.options.onStart === "function") { + this.options.onStart(this.result); + } } - } else { - num = parseFloat(num); - if (isNaN(num)) { - return null; + + this.raf_id = requestAnimationFrame(this.updateScene.bind(this)); + }, + + append: function () { + var container_html = ''; + this.$cache.input.before(container_html); + this.$cache.cont = this.$cache.input.prev(); + this.result.slider = this.$cache.cont; + + this.$cache.cont.html(base_html); + this.$cache.rs = this.$cache.cont.find(".irs"); + this.$cache.min = this.$cache.cont.find(".irs-min"); + this.$cache.max = this.$cache.cont.find(".irs-max"); + this.$cache.from = this.$cache.cont.find(".irs-from"); + this.$cache.to = this.$cache.cont.find(".irs-to"); + this.$cache.single = this.$cache.cont.find(".irs-single"); + this.$cache.bar = this.$cache.cont.find(".irs-bar"); + this.$cache.line = this.$cache.cont.find(".irs-line"); + this.$cache.grid = this.$cache.cont.find(".irs-grid"); + + if (this.options.type === "single") { + this.$cache.cont.append(single_html); + this.$cache.s_single = this.$cache.cont.find(".single"); + this.$cache.from[0].style.visibility = "hidden"; + this.$cache.to[0].style.visibility = "hidden"; + this.$cache.shad_single = this.$cache.cont.find(".shadow-single"); } else { - return num; + this.$cache.cont.append(double_html); + this.$cache.s_from = this.$cache.cont.find(".from"); + this.$cache.s_to = this.$cache.cont.find(".to"); + this.$cache.shad_from = this.$cache.cont.find(".shadow-from"); + this.$cache.shad_to = this.$cache.cont.find(".shadow-to"); } - } - }; - var methods = { - init: function (options) { - - // irs = ion range slider css prefix - var baseHTML = - '' + - '' + - '01' + - '000' + - '' + - ''; - - var singleHTML = - ''; - - var doubleHTML = - '' + - '' + - ''; - - var disableHTML = - ''; - - - - return this.each(function () { - var settings = $.extend({ - min: null, - max: null, - from: null, - to: null, - type: "single", - step: null, - prefix: "", - postfix: "", - maxPostfix: "", - hasGrid: false, - gridMargin: 0, - hideMinMax: false, - hideFromTo: false, - prettify: true, - disable: false, - values: null, - onLoad: null, - onChange: null, - onFinish: null - }, options); - - - - var slider = $(this), - self = this, - allow_values = false, - value_array = null; - - if (slider.data("isActive")) { - return; - } - slider.data("isActive", true); + if (this.options.hide_from_to) { + this.$cache.from[0].style.display = "none"; + this.$cache.to[0].style.display = "none"; + this.$cache.single[0].style.display = "none"; + } - plugin_count += 1; - this.plugin_count = plugin_count; + this.appendGrid(); + if (this.options.disable) { + this.appendDisableMask(); + } else { + this.$cache.cont.removeClass("irs-disabled"); + this.bindEvents(); + } + }, + appendDisableMask: function () { + this.$cache.cont.append(disable_html); + this.$cache.cont.addClass("irs-disabled"); + }, - // check default values - if (slider.prop("value")) { - value_array = slider.prop("value").split(";"); - } + remove: function () { + this.$cache.cont.remove(); + this.$cache.cont = null; - if (settings.type === "single") { + this.$cache.input.off("keydown.irs_" + this.plugin_count); - if (value_array && value_array.length > 1) { + if (is_touch) { - if (typeof settings.min !== "number") { - settings.min = parseFloat(value_array[0]); - } else { - if (typeof settings.from !== "number") { - settings.from = parseFloat(value_array[0]); - } - } + this.$cache.body.off("touchmove.irs_" + this.plugin_count); + this.$cache.win.off("touchend.irs_" + this.plugin_count); - if (typeof settings.max !== "number") { - settings.max = parseFloat(value_array[1]); - } + } else { - } else if (value_array && value_array.length === 1) { + this.$cache.body.off("mousemove.irs_" + this.plugin_count); + this.$cache.win.off("mouseup.irs_" + this.plugin_count); - if (typeof settings.from !== "number") { - settings.from = parseFloat(value_array[0]); - } + if (is_old_ie) { + this.$cache.body.off("mouseup.irs_" + this.plugin_count); + this.$cache.body.off("mouseleave.irs_" + this.plugin_count); + } - } + } - } else if (settings.type === "double") { + this.$cache.grid_labels = []; + this.coords.big = []; + this.coords.big_w = []; + this.coords.big_p = []; + this.coords.big_x = []; - if (value_array && value_array.length > 1) { + cancelAnimationFrame(this.raf_id); + }, - if (typeof settings.min !== "number") { - settings.min = parseFloat(value_array[0]); - } else { - if (typeof settings.from !== "number") { - settings.from = parseFloat(value_array[0]); - } - } + bindEvents: function () { + if (is_touch) { - if (typeof settings.max !== "number") { - settings.max = parseFloat(value_array[1]); - } else { - if (typeof settings.to !== "number") { - settings.to = parseFloat(value_array[1]); - } - } + this.$cache.body.on("touchmove.irs_" + this.plugin_count, this.pointerMove.bind(this)); + this.$cache.win.on("touchend.irs_" + this.plugin_count, this.pointerUp.bind(this)); - } else if (value_array && value_array.length === 1) { + this.$cache.line.on("touchstart.irs_" + this.plugin_count, this.pointerClick.bind(this, "click")); + this.$cache.bar.on("touchstart.irs_" + this.plugin_count, this.pointerClick.bind(this, "click")); - if (typeof settings.min !== "number") { - settings.min = parseFloat(value_array[0]); - } else { - if (typeof settings.from !== "number") { - settings.from = parseFloat(value_array[0]); - } - } + if (this.options.type === "single") { + this.$cache.s_single.on("touchstart.irs_" + this.plugin_count, this.pointerDown.bind(this, "single")); + this.$cache.shad_single.on("touchstart.irs_" + this.plugin_count, this.pointerClick.bind(this, "click")); + } else { + this.$cache.s_from.on("touchstart.irs_" + this.plugin_count, this.pointerDown.bind(this, "from")); + this.$cache.s_to.on("touchstart.irs_" + this.plugin_count, this.pointerDown.bind(this, "to")); + this.$cache.shad_from.on("touchstart.irs_" + this.plugin_count, this.pointerClick.bind(this, "click")); + this.$cache.shad_to.on("touchstart.irs_" + this.plugin_count, this.pointerClick.bind(this, "click")); + } - } + } else { + if (this.options.keyboard) { + this.$cache.input.on("keydown.irs_" + this.plugin_count, this.key.bind(this, "keyboard")); } + this.$cache.body.on("mousemove.irs_" + this.plugin_count, this.pointerMove.bind(this)); + this.$cache.win.on("mouseup.irs_" + this.plugin_count, this.pointerUp.bind(this)); - - // extend from data-* - if (typeof slider.data("min") === "number") { - settings.min = parseFloat(slider.data("min")); - } - if (typeof slider.data("max") === "number") { - settings.max = parseFloat(slider.data("max")); + if (is_old_ie) { + this.$cache.body.on("mouseup.irs_" + this.plugin_count, this.pointerUp.bind(this)); + this.$cache.body.on("mouseleave.irs_" + this.plugin_count, this.pointerUp.bind(this)); } - if (typeof slider.data("from") === "number") { - settings.from = parseFloat(slider.data("from")); + + this.$cache.line.on("mousedown.irs_" + this.plugin_count, this.pointerClick.bind(this, "click")); + this.$cache.bar.on("mousedown.irs_" + this.plugin_count, this.pointerClick.bind(this, "click")); + + if (this.options.type === "single") { + this.$cache.s_single.on("mousedown.irs_" + this.plugin_count, this.pointerDown.bind(this, "single")); + this.$cache.shad_single.on("mousedown.irs_" + this.plugin_count, this.pointerClick.bind(this, "click")); + } else { + this.$cache.s_from.on("mousedown.irs_" + this.plugin_count, this.pointerDown.bind(this, "from")); + this.$cache.s_to.on("mousedown.irs_" + this.plugin_count, this.pointerDown.bind(this, "to")); + this.$cache.shad_from.on("mousedown.irs_" + this.plugin_count, this.pointerClick.bind(this, "click")); + this.$cache.shad_to.on("mousedown.irs_" + this.plugin_count, this.pointerClick.bind(this, "click")); } - if (typeof slider.data("to") === "number") { - settings.to = parseFloat(slider.data("to")); + + } + }, + + pointerMove: function (e) { + if (!this.dragging) { + return; + } + var e_base = is_touch ? e.originalEvent.touches[0] : e; + this.coords.x_pointer = e_base.pageX - this.coords.x_gap; + + this.calc(); + }, + + pointerUp: function (e) { + if (this.current_plugin !== this.plugin_count) { + return; + } + + if (this.is_active) { + this.is_active = false; + } else { + return; + } + + var is_function = this.options.onFinish && typeof this.options.onFinish === "function", + is_original = $.contains(this.$cache.cont[0], e.target) || this.dragging; + + if (is_function && is_original) { + this.options.onFinish(this.result); + } + + this.force_redraw = true; + this.dragging = false; + + if (is_old_ie) { + $("*").prop("unselectable", false); + } + }, + + pointerDown: function (target, e) { + e.preventDefault(); + var e_base = is_touch ? e.originalEvent.touches[0] : e; + if (e.button === 2) { + return; + } + + this.current_plugin = this.plugin_count; + this.target = target; + + this.is_active = true; + this.dragging = true; + + this.coords.x_gap = this.$cache.rs.offset().left; + this.coords.x_pointer = e_base.pageX - this.coords.x_gap; + + this.calcPointer(); + + switch (target) { + case "single": + this.coords.p_gap = this.toFixed(this.coords.p_pointer - this.coords.p_single); + break; + case "from": + this.coords.p_gap = this.toFixed(this.coords.p_pointer - this.coords.p_from); + this.$cache.s_from.addClass("type_last"); + this.$cache.s_to.removeClass("type_last"); + break; + case "to": + this.coords.p_gap = this.toFixed(this.coords.p_pointer - this.coords.p_to); + this.$cache.s_to.addClass("type_last"); + this.$cache.s_from.removeClass("type_last"); + break; + } + + if (is_old_ie) { + $("*").prop("unselectable", true); + } + + this.$cache.input.trigger("focus"); + }, + + pointerClick: function (target, e) { + e.preventDefault(); + var e_base = is_touch ? e.originalEvent.touches[0] : e; + if (e.button === 2) { + return; + } + + this.current_plugin = this.plugin_count; + this.target = target; + + this.coords.x_gap = this.$cache.rs.offset().left; + this.coords.x_pointer = +(e_base.pageX - this.coords.x_gap).toFixed(); + + this.force_redraw = true; + this.calc(); + + this.$cache.input.trigger("focus"); + }, + + key: function (target, e) { + if (this.current_plugin !== this.plugin_count || e.altKey || e.ctrlKey || e.shiftKey || e.metaKey) { + return; + } + + switch (e.which) { + case 83: // W + case 65: // A + case 40: // DOWN + case 37: // LEFT + e.preventDefault(); + this.moveByKey(false); + break; + + case 87: // S + case 68: // D + case 38: // UP + case 39: // RIGHT + e.preventDefault(); + this.moveByKey(true); + break; + } + + return true; + }, + + // Move by key beta + // TODO: refactor than have plenty of time + moveByKey: function (right) { + var p = this.coords.p_pointer; + + if (right) { + p += this.options.keyboard_step; + } else { + p -= this.options.keyboard_step; + } + + this.coords.x_pointer = this.toFixed(this.coords.w_rs / 100 * p); + this.is_key = true; + this.calc(); + }, + + setMinMax: function () { + if (this.options.hide_min_max) { + this.$cache.min[0].style.display = "none"; + this.$cache.max[0].style.display = "none"; + return; + } + + if (this.options.values.length) { + this.$cache.min.html(this.decorate(this.options.p_values[this.options.min])); + this.$cache.max.html(this.decorate(this.options.p_values[this.options.max])); + } else { + this.$cache.min.html(this.decorate(this._prettify(this.options.min), this.options.min)); + this.$cache.max.html(this.decorate(this._prettify(this.options.max), this.options.max)); + } + + this.labels.w_min = this.$cache.min.outerWidth(false); + this.labels.w_max = this.$cache.max.outerWidth(false); + }, + + + + // ============================================================================================================= + // Calculations + + calc: function (update) { + this.calc_count++; + + if (this.calc_count === 10 || update) { + this.calc_count = 0; + this.coords.w_rs = this.$cache.rs.outerWidth(false); + if (this.options.type === "single") { + this.coords.w_handle = this.$cache.s_single.outerWidth(false); + } else { + this.coords.w_handle = this.$cache.s_from.outerWidth(false); } - if (slider.data("step")) { - settings.step = parseFloat(slider.data("step")); + } + + if (!this.coords.w_rs) { + return; + } + + this.calcPointer(); + + this.coords.p_handle = this.toFixed(this.coords.w_handle / this.coords.w_rs * 100); + var real_width = 100 - this.coords.p_handle, + real_x = this.toFixed(this.coords.p_pointer - this.coords.p_gap); + + if (this.target === "click") { + real_x = this.toFixed(this.coords.p_pointer - (this.coords.p_handle / 2)); + this.target = this.chooseHandle(real_x); + } + + if (real_x < 0) { + real_x = 0; + } else if (real_x > real_width) { + real_x = real_width; + } + + switch (this.target) { + case "base": + var w = (this.options.max - this.options.min) / 100, + f = (this.result.from - this.options.min) / w, + t = (this.result.to - this.options.min) / w; + + this.coords.p_single_real = this.toFixed(f); + this.coords.p_from_real = this.toFixed(f); + this.coords.p_to_real = this.toFixed(t); + + this.coords.p_single_real = this.checkDiapason(this.coords.p_single_real, this.options.from_min, this.options.from_max); + this.coords.p_from_real = this.checkDiapason(this.coords.p_from_real, this.options.from_min, this.options.from_max); + this.coords.p_to_real = this.checkDiapason(this.coords.p_to_real, this.options.to_min, this.options.to_max); + + this.coords.p_single = this.toFixed(f - (this.coords.p_handle / 100 * f)); + this.coords.p_from = this.toFixed(f - (this.coords.p_handle / 100 * f)); + this.coords.p_to = this.toFixed(t - (this.coords.p_handle / 100 * t)); + + this.target = null; + + break; + + case "single": + if (this.options.from_fixed) { + break; + } + + this.coords.p_single_real = this.calcWithStep(real_x / real_width * 100); + this.coords.p_single_real = this.checkDiapason(this.coords.p_single_real, this.options.from_min, this.options.from_max); + this.coords.p_single = this.toFixed(this.coords.p_single_real / 100 * real_width); + + break; + + case "from": + if (this.options.from_fixed) { + break; + } + + this.coords.p_from_real = this.calcWithStep(real_x / real_width * 100); + if (this.coords.p_from_real > this.coords.p_to_real) { + this.coords.p_from_real = this.coords.p_to_real; + } + this.coords.p_from_real = this.checkDiapason(this.coords.p_from_real, this.options.from_min, this.options.from_max); + this.coords.p_from = this.toFixed(this.coords.p_from_real / 100 * real_width); + + break; + + case "to": + if (this.options.to_fixed) { + break; + } + + this.coords.p_to_real = this.calcWithStep(real_x / real_width * 100); + if (this.coords.p_to_real < this.coords.p_from_real) { + this.coords.p_to_real = this.coords.p_from_real; + } + this.coords.p_to_real = this.checkDiapason(this.coords.p_to_real, this.options.to_min, this.options.to_max); + this.coords.p_to = this.toFixed(this.coords.p_to_real / 100 * real_width); + + break; + } + + if (this.options.type === "single") { + this.coords.p_bar_x = (this.coords.p_handle / 2); + this.coords.p_bar_w = this.coords.p_single; + + this.result.from_percent = this.coords.p_single_real; + this.result.from = this.calcReal(this.coords.p_single_real); + if (this.options.values.length) { + this.result.from_value = this.options.values[this.result.from]; } - if (slider.data("type")) { - settings.type = slider.data("type"); + } else { + this.coords.p_bar_x = this.toFixed(this.coords.p_from + (this.coords.p_handle / 2)); + this.coords.p_bar_w = this.toFixed(this.coords.p_to - this.coords.p_from); + + this.result.from_percent = this.coords.p_from_real; + this.result.from = this.calcReal(this.coords.p_from_real); + this.result.to_percent = this.coords.p_to_real; + this.result.to = this.calcReal(this.coords.p_to_real); + if (this.options.values.length) { + this.result.from_value = this.options.values[this.result.from]; + this.result.to_value = this.options.values[this.result.to]; } - if (slider.data("prefix")) { - settings.prefix = slider.data("prefix"); + } + + this.calcMinMax(); + this.calcLabels(); + }, + + calcPointer: function () { + if (!this.coords.w_rs) { + this.coords.p_pointer = 0; + return; + } + + if (this.coords.x_pointer < 0) { + this.coords.x_pointer = 0; + } else if (this.coords.x_pointer > this.coords.w_rs) { + this.coords.x_pointer = this.coords.w_rs; + } + + this.coords.p_pointer = this.toFixed(this.coords.x_pointer / this.coords.w_rs * 100); + }, + + chooseHandle: function (real_x) { + if (this.options.type === "single") { + return "single"; + } else { + var m_point = this.coords.p_from_real + ((this.coords.p_to_real - this.coords.p_from_real) / 2); + if (real_x >= m_point) { + return "to"; + } else { + return "from"; + } + } + }, + + calcMinMax: function () { + if (!this.coords.w_rs) { + return; + } + + this.labels.p_min = this.labels.w_min / this.coords.w_rs * 100; + this.labels.p_max = this.labels.w_max / this.coords.w_rs * 100; + }, + + calcLabels: function () { + if (!this.coords.w_rs || this.options.hide_from_to) { + return; + } + + if (this.options.type === "single") { + + this.labels.w_single = this.$cache.single.outerWidth(false); + this.labels.p_single = this.labels.w_single / this.coords.w_rs * 100; + this.labels.p_single_left = this.coords.p_single + (this.coords.p_handle / 2) - (this.labels.p_single / 2); + this.labels.p_single_left = this.checkEdges(this.labels.p_single_left, this.labels.p_single); + + } else { + + this.labels.w_from = this.$cache.from.outerWidth(false); + this.labels.p_from = this.labels.w_from / this.coords.w_rs * 100; + this.labels.p_from_left = this.coords.p_from + (this.coords.p_handle / 2) - (this.labels.p_from / 2); + this.labels.p_from_left = this.toFixed(this.labels.p_from_left); + this.labels.p_from_left = this.checkEdges(this.labels.p_from_left, this.labels.p_from); + + this.labels.w_to = this.$cache.to.outerWidth(false); + this.labels.p_to = this.labels.w_to / this.coords.w_rs * 100; + this.labels.p_to_left = this.coords.p_to + (this.coords.p_handle / 2) - (this.labels.p_to / 2); + this.labels.p_to_left = this.toFixed(this.labels.p_to_left); + this.labels.p_to_left = this.checkEdges(this.labels.p_to_left, this.labels.p_to); + + this.labels.w_single = this.$cache.single.outerWidth(false); + this.labels.p_single = this.labels.w_single / this.coords.w_rs * 100; + this.labels.p_single_left = ((this.labels.p_from_left + this.labels.p_to_left + this.labels.p_to) / 2) - (this.labels.p_single / 2); + this.labels.p_single_left = this.toFixed(this.labels.p_single_left); + this.labels.p_single_left = this.checkEdges(this.labels.p_single_left, this.labels.p_single); + + } + }, + + + + // ============================================================================================================= + // Drawings + + updateScene: function () { + this.drawHandles(); + + this.raf_id = requestAnimationFrame(this.updateScene.bind(this)); + }, + + drawHandles: function () { + this.coords.w_rs = this.$cache.rs.outerWidth(false); + + if (this.coords.w_rs !== this.coords.w_rs_old) { + this.target = "base"; + } + + if (this.coords.w_rs !== this.coords.w_rs_old || this.force_redraw) { + this.setMinMax(); + this.calc(true); + this.drawLabels(); + if (this.options.grid) { + this.calcGridMargin(); + this.calcGridLabels(); } - if (slider.data("postfix")) { - settings.postfix = slider.data("postfix"); + this.force_redraw = true; + this.coords.w_rs_old = this.coords.w_rs; + this.drawShadow(); + } + + if (!this.coords.w_rs) { + return; + } + + if (!this.dragging && !this.force_redraw && !this.is_key) { + return; + } + + if (this.old_from !== this.result.from || this.old_to !== this.result.to || this.force_redraw || this.is_key) { + + this.drawLabels(); + + this.$cache.bar[0].style.left = this.coords.p_bar_x + "%"; + this.$cache.bar[0].style.width = this.coords.p_bar_w + "%"; + + if (this.options.type === "single") { + this.$cache.s_single[0].style.left = this.coords.p_single + "%"; + + this.$cache.single[0].style.left = this.labels.p_single_left + "%"; + + if (this.options.values.length) { + this.$cache.input.prop("value", this.result.from_value); + this.$cache.input.data("from", this.result.from_value); + } else { + this.$cache.input.prop("value", this.result.from); + this.$cache.input.data("from", this.result.from); + } + } else { + this.$cache.s_from[0].style.left = this.coords.p_from + "%"; + this.$cache.s_to[0].style.left = this.coords.p_to + "%"; + + if (this.old_from !== this.result.from || this.force_redraw) { + this.$cache.from[0].style.left = this.labels.p_from_left + "%"; + } + if (this.old_to !== this.result.to || this.force_redraw) { + this.$cache.to[0].style.left = this.labels.p_to_left + "%"; + } + + this.$cache.single[0].style.left = this.labels.p_single_left + "%"; + + if (this.options.values.length) { + this.$cache.input.prop("value", this.result.from_value + ";" + this.result.to_value); + this.$cache.input.data("from", this.result.from_value); + this.$cache.input.data("to", this.result.to_value); + } else { + this.$cache.input.prop("value", this.result.from + ";" + this.result.to); + this.$cache.input.data("from", this.result.from); + this.$cache.input.data("to", this.result.to); + } + } + this.$cache.input.trigger("change"); + + this.old_from = this.result.from; + this.old_to = this.result.to; + + var is_function = this.options.onChange && typeof this.options.onChange === "function"; + if (is_function && !this.is_update && !this.is_start) { + this.options.onChange(this.result); } - if (slider.data("maxpostfix")) { - settings.maxPostfix = slider.data("maxpostfix"); + this.is_update = false; + } + + this.is_start = false; + this.is_key = false; + this.force_redraw = false; + }, + + drawLabels: function () { + var values_num = this.options.values.length, + p_values = this.options.p_values, + text_single, + text_from, + text_to; + + if (this.options.hide_from_to) { + return; + } + + if (this.options.type === "single") { + + if (values_num) { + text_single = this.decorate(p_values[this.result.from]); + this.$cache.single.html(text_single); + } else { + text_single = this.decorate(this._prettify(this.result.from), this.result.from); + this.$cache.single.html(text_single); } - if (slider.data("hasgrid")) { - settings.hasGrid = slider.data("hasgrid"); + + this.calcLabels(); + + if (this.labels.p_single_left < this.labels.p_min + 1) { + this.$cache.min[0].style.visibility = "hidden"; + } else { + this.$cache.min[0].style.visibility = "visible"; } - if (slider.data("gridmargin")) { - settings.gridMargin = +slider.data("gridmargin"); + + if (this.labels.p_single_left + this.labels.p_single > 100 - this.labels.p_max - 1) { + this.$cache.max[0].style.visibility = "hidden"; + } else { + this.$cache.max[0].style.visibility = "visible"; } - if (slider.data("hideminmax")) { - settings.hideMinMax = slider.data("hideminmax"); + + } else { + + if (values_num) { + + if (this.options.decorate_both) { + text_single = this.decorate(p_values[this.result.from]); + text_single += this.options.values_separator; + text_single += this.decorate(p_values[this.result.to]); + } else { + text_single = this.decorate(p_values[this.result.from] + this.options.values_separator + p_values[this.result.to]); + } + text_from = this.decorate(p_values[this.result.from]); + text_to = this.decorate(p_values[this.result.to]); + + this.$cache.single.html(text_single); + this.$cache.from.html(text_from); + this.$cache.to.html(text_to); + + } else { + + if (this.options.decorate_both) { + text_single = this.decorate(this._prettify(this.result.from)); + text_single += this.options.values_separator; + text_single += this.decorate(this._prettify(this.result.to)); + } else { + text_single = this.decorate(this._prettify(this.result.from) + this.options.values_separator + this._prettify(this.result.to), this.result.from); + } + text_from = this.decorate(this._prettify(this.result.from), this.result.from); + text_to = this.decorate(this._prettify(this.result.to), this.result.to); + + this.$cache.single.html(text_single); + this.$cache.from.html(text_from); + this.$cache.to.html(text_to); + } - if (slider.data("hidefromto")) { - settings.hideFromTo = slider.data("hidefromto"); + + this.calcLabels(); + + var min = Math.min(this.labels.p_single_left, this.labels.p_from_left), + single_left = this.labels.p_single_left + this.labels.p_single, + to_left = this.labels.p_to_left + this.labels.p_to, + max = Math.max(single_left, to_left); + + if (this.labels.p_from_left + this.labels.p_from >= this.labels.p_to_left) { + this.$cache.from[0].style.visibility = "hidden"; + this.$cache.to[0].style.visibility = "hidden"; + this.$cache.single[0].style.visibility = "visible"; + + if (this.result.from === this.result.to) { + this.$cache.from[0].style.visibility = "visible"; + this.$cache.single[0].style.visibility = "hidden"; + max = to_left; + } else { + this.$cache.from[0].style.visibility = "hidden"; + this.$cache.single[0].style.visibility = "visible"; + max = Math.max(single_left, to_left); + } + } else { + this.$cache.from[0].style.visibility = "visible"; + this.$cache.to[0].style.visibility = "visible"; + this.$cache.single[0].style.visibility = "hidden"; } - if (slider.data("prettify")) { - settings.prettify = slider.data("prettify"); + + if (min < this.labels.p_min + 1) { + this.$cache.min[0].style.visibility = "hidden"; + } else { + this.$cache.min[0].style.visibility = "visible"; + } + + if (max > 100 - this.labels.p_max - 1) { + this.$cache.max[0].style.visibility = "hidden"; + } else { + this.$cache.max[0].style.visibility = "visible"; + } + + } + }, + + drawShadow: function () { + var o = this.options, + c = this.$cache, + from_min, + from_max, + to_min, + to_max; + + if (o.type === "single") { + if (o.from_shadow && (o.from_min || o.from_max)) { + from_min = this.calcPercent(o.from_min || o.min); + from_max = this.calcPercent(o.from_max || o.max) - from_min; + from_min = this.toFixed(from_min - (this.coords.p_handle / 100 * from_min)); + from_max = this.toFixed(from_max - (this.coords.p_handle / 100 * from_max)); + from_min = from_min + (this.coords.p_handle / 2); + + c.shad_single[0].style.display = "block"; + c.shad_single[0].style.left = from_min + "%"; + c.shad_single[0].style.width = from_max + "%"; + } else { + c.shad_single[0].style.display = "none"; } - if (slider.data("disable")) { - settings.disable = slider.data("disable"); + } else { + if (o.from_shadow && (o.from_min || o.from_max)) { + from_min = this.calcPercent(o.from_min || o.min); + from_max = this.calcPercent(o.from_max || o.max) - from_min; + from_min = this.toFixed(from_min - (this.coords.p_handle / 100 * from_min)); + from_max = this.toFixed(from_max - (this.coords.p_handle / 100 * from_max)); + from_min = from_min + (this.coords.p_handle / 2); + + c.shad_from[0].style.display = "block"; + c.shad_from[0].style.left = from_min + "%"; + c.shad_from[0].style.width = from_max + "%"; + } else { + c.shad_from[0].style.display = "none"; } - if (slider.data("values")) { - settings.values = slider.data("values").split(","); + + if (o.to_shadow && (o.to_min || o.to_max)) { + to_min = this.calcPercent(o.to_min || o.min); + to_max = this.calcPercent(o.to_max || o.max) - to_min; + to_min = this.toFixed(to_min - (this.coords.p_handle / 100 * to_min)); + to_max = this.toFixed(to_max - (this.coords.p_handle / 100 * to_max)); + to_min = to_min + (this.coords.p_handle / 2); + + c.shad_to[0].style.display = "block"; + c.shad_to[0].style.left = to_min + "%"; + c.shad_to[0].style.width = to_max + "%"; + } else { + c.shad_to[0].style.display = "none"; } + } + }, - // Set Min and Max if no - settings.min = testNumber(settings.min); - if (!settings.min && settings.min !== 0) { - settings.min = 10; - } + // ============================================================================================================= + // Service methods - settings.max = testNumber(settings.max); - if (!settings.max && settings.max !== 0) { - settings.max = 100; - } + toggleInput: function () { + this.$cache.input.toggleClass("irs-hidden-input"); + }, + calcPercent: function (num) { + var w = (this.options.max - this.options.min) / 100, + percent = (num - this.options.min) / w; + return this.toFixed(percent); + }, - // Set values - if (Object.prototype.toString.call(settings.values) !== "[object Array]") { - settings.values = null; - } - if (settings.values && settings.values.length > 0) { - settings.min = 0; - settings.max = settings.values.length - 1; - settings.step = 1; - allow_values = true; - } + calcReal: function (percent) { + var min = this.options.min, + max = this.options.max, + abs = 0; + + if (min < 0) { + abs = Math.abs(min); + min = min + abs; + max = max + abs; + } + + var number = ((max - min) / 100 * percent) + min, + string = this.options.step.toString().split(".")[1]; + + if (string) { + number = +number.toFixed(string.length); + } else { + number = number / this.options.step; + number = number * this.options.step; + number = +number.toFixed(0); + } + if (abs) { + number -= abs; + } + if (number < this.options.min) { + number = this.options.min; + } else if (number > this.options.max) { + number = this.options.max; + } + + if (string) { + return +number.toFixed(string.length); + } else { + return this.toFixed(number); + } + }, + + calcWithStep: function (percent) { + var rounded = Math.round(percent / this.coords.p_step) * this.coords.p_step; + + if (rounded > 100) { + rounded = 100; + } + if (percent === 100) { + rounded = 100; + } + + return this.toFixed(rounded); + }, - // Set From and To if no - settings.from = testNumber(settings.from); - if (!settings.from && settings.from !== 0) { - settings.from = settings.min; + checkDiapason: function (p_num, min, max) { + if (!min && !max) { + return p_num; + } + + var num = this.calcReal(p_num); + + if (typeof min === "number" && num < min) { + num = min; + } + + if (typeof max === "number" && num > max) { + num = max; + } + + return this.calcPercent(num); + }, + + toFixed: function (num) { + num = num.toFixed(5); + return +num; + }, + + _prettify: function (num) { + if (!this.options.prettify_enabled) { + return num; + } + + if (this.options.prettify && typeof this.options.prettify === "function") { + return this.options.prettify(num); + } else { + return this.prettify(num); + } + }, + + prettify: function (num) { + var n = num.toString(); + return n.replace(/(\d{1,3}(?=(?:\d\d\d)+(?!\d)))/g, "$1" + this.options.prettify_separator); + }, + + checkEdges: function (left, width) { + if (!this.options.force_edges) { + return this.toFixed(left); + } + + if (left < 0) { + left = 0; + } else if (left > 100 - width) { + left = 100 - width; + } + + return this.toFixed(left); + }, + + validate: function () { + var o = this.options, + r = this.result, + v = o.values, + pv = o.p_values, + vl = v.length, + value, + i; + + if (o.max <= o.min) { + if (o.min) { + o.max = o.min * 2; + } else { + o.max = o.min + 1; } + o.step = 1; + } + + if (vl) { + o.min = 0; + o.max = vl - 1; + o.step = 1; + o.grid_num = o.max; + o.grid_snap = true; + + for (i = 0; i < vl; i++) { + value = +v[i]; + + if (!isNaN(value)) { + v[i] = value; + value = this._prettify(value); + } else { + value = v[i]; + } - settings.to = testNumber(settings.to); - if (!settings.to && settings.to !== 0) { - settings.to = settings.max; + pv.push(value); } + } + if (typeof o.from !== "number" || isNaN(o.from)) { + o.from = o.min; + } - // Set step - settings.step = testNumber(settings.step); - if (!settings.step) { - settings.step = 1; - } + if (typeof o.to !== "number" || isNaN(o.from)) { + o.to = o.max; + } + + if (o.from < o.min || o.from > o.max) { + o.from = o.min; + } + + if (o.to > o.max || o.to < o.min) { + o.to = o.max; + } + + if (o.from > o.to) { + o.from = o.to; + } + + if (typeof o.step !== "number" || isNaN(o.step) || !o.step || o.step < 0) { + o.step = 1; + } + + if (typeof o.keyboard_step !== "number" || isNaN(o.keyboard_step) || !o.keyboard_step || o.keyboard_step < 0) { + o.keyboard_step = 5; + } + + if (o.from_min && o.from < o.from_min) { + o.from = o.from_min; + } + if (o.from_max && o.from > o.from_max) { + o.from = o.from_max; + } + if (o.to_min && o.to < o.to_min) { + o.to = o.to_min; + } - // fix diapason - if (settings.from < settings.min) { - settings.from = settings.min; + if (o.to_max && o.from > o.to_max) { + o.to = o.to_max; + } + + if (r) { + if (r.min !== o.min) { + r.min = o.min; } - if (settings.from > settings.max) { - settings.from = settings.min; + + if (r.max !== o.max) { + r.max = o.max; } - if (settings.to < settings.min) { - settings.to = settings.max; + if (r.from < r.min || r.from > r.max) { + r.from = o.from; } - if (settings.to > settings.max) { - settings.to = settings.max; + + if (r.to < r.min || r.to > r.max) { + r.to = o.to; } + } + }, + + decorate: function (num, original) { + var decorated = "", + o = this.options; - if (settings.type === "double") { - if (settings.from > settings.to) { - settings.from = settings.to; + if (o.prefix) { + decorated += o.prefix; + } + + decorated += num; + + if (o.max_postfix) { + if (o.values.length && num === o.p_values[o.max]) { + decorated += o.max_postfix; + if (o.postfix) { + decorated += " "; } - if (settings.to < settings.from) { - settings.to = settings.from; + } else if (original === o.max) { + decorated += o.max_postfix; + if (o.postfix) { + decorated += " "; } } + } + if (o.postfix) { + decorated += o.postfix; + } - var prettify = function (num) { - var n = num.toString(); - if (settings.prettify) { - n = n.replace(/(\d{1,3}(?=(?:\d\d\d)+(?!\d)))/g, "$1 "); - } - return n; - }; - - - var containerHTML = ''; - slider[0].style.display = "none"; - slider.before(containerHTML); - - var $container = slider.prev(), - $body = $(document.body), - $window = $(window), - $rangeSlider, - $fieldMin, - $fieldMax, - $fieldFrom, - $fieldTo, - $fieldSingle, - $singleSlider, - $fromSlider, - $toSlider, - $activeSlider, - $diapason, - $grid; - - var allowDrag = false, - is_slider_active = false, - is_first_start = true, - numbers = {}; - - var mouseX = 0, - fieldMinWidth = 0, - fieldMaxWidth = 0, - normalWidth = 0, - fullWidth = 0, - sliderWidth = 0, - width = 0, - left = 0, - right = 0, - minusX = 0, - stepFloat = 0; - - - if (parseInt(settings.step, 10) !== parseFloat(settings.step)) { - stepFloat = settings.step.toString().split(".")[1]; - stepFloat = Math.pow(10, stepFloat.length); - } + return decorated; + }, + updateFrom: function () { + this.result.from = this.options.from; + this.result.from_percent = this.calcPercent(this.result.from); + if (this.options.values) { + this.result.from_value = this.options.values[this.result.from]; + } + }, + updateTo: function () { + this.result.to = this.options.to; + this.result.to_percent = this.calcPercent(this.result.to); + if (this.options.values) { + this.result.to_value = this.options.values[this.result.to]; + } + }, - // public methods - this.updateData = function (options) { - $.extend(settings, options); - removeHTML(); - }; - this.removeSlider = function () { - $container.find("*").off(); - $window.off("mouseup.irs" + self.plugin_count); - $body.off("mouseup.irs" + self.plugin_count); - $body.off("mouseleave.irs" + self.plugin_count); - $body.off("mousemove.irs" + self.plugin_count); - $container.html("").remove(); - slider.data("isActive", false); - slider.show(); - }; - - - - - - // private methods - var removeHTML = function () { - $container.find("*").off(); - $window.off("mouseup.irs" + self.plugin_count); - $body.off("mouseup.irs" + self.plugin_count); - $body.off("mouseleave.irs" + self.plugin_count); - $body.off("mousemove.irs" + self.plugin_count); - $container.html(""); - - placeHTML(); - }; - var placeHTML = function () { - $container.html(baseHTML); - $rangeSlider = $container.find(".irs"); - - $fieldMin = $rangeSlider.find(".irs-min"); - $fieldMax = $rangeSlider.find(".irs-max"); - $fieldFrom = $rangeSlider.find(".irs-from"); - $fieldTo = $rangeSlider.find(".irs-to"); - $fieldSingle = $rangeSlider.find(".irs-single"); - $grid = $container.find(".irs-grid"); - - if (settings.hideFromTo) { - $fieldFrom[0].style.visibility = "hidden"; - $fieldTo[0].style.visibility = "hidden"; - $fieldSingle[0].style.visibility = "hidden"; - } - if (!settings.hideFromTo) { - $fieldFrom[0].style.visibility = "visible"; - $fieldTo[0].style.visibility = "visible"; - $fieldSingle[0].style.visibility = "visible"; - } + updateResult: function (options) { + this.result.min = this.options.min; + this.result.max = this.options.max; - if (settings.hideMinMax) { - $fieldMin[0].style.visibility = "hidden"; - $fieldMax[0].style.visibility = "hidden"; + if (options) { - fieldMinWidth = 0; - fieldMaxWidth = 0; - } - if (!settings.hideMinMax) { - $fieldMin[0].style.visibility = "visible"; - $fieldMax[0].style.visibility = "visible"; - - if (settings.values) { - $fieldMin.html(settings.prefix + settings.values[0] + settings.postfix); - $fieldMax.html(settings.prefix + settings.values[settings.values.length - 1] + settings.maxPostfix + settings.postfix); - } else { - $fieldMin.html(settings.prefix + prettify(settings.min) + settings.postfix); - $fieldMax.html(settings.prefix + prettify(settings.max) + settings.maxPostfix + settings.postfix); - } - - fieldMinWidth = $fieldMin.outerWidth(false); - fieldMaxWidth = $fieldMax.outerWidth(false); - } + if (options.from) { + this.updateFrom(); + } - bindEvents(); - }; - - var bindEvents = function () { - if (settings.type === "single") { - $rangeSlider.append(singleHTML); - - $singleSlider = $rangeSlider.find(".single"); - - $singleSlider.on("mousedown", function (e) { - e.preventDefault(); - e.stopPropagation(); - - calcDimensions(e, $(this), null); - - allowDrag = true; - is_slider_active = true; - current = self.plugin_count; - - if (is_old_ie) { - $("*").prop("unselectable", true); - } - }); - if (is_touch) { - $singleSlider.on("touchstart", function (e) { - e.preventDefault(); - e.stopPropagation(); - - calcDimensions(e.originalEvent.touches[0], $(this), null); - - allowDrag = true; - is_slider_active = true; - current = self.plugin_count; - }); - } - - } else if (settings.type === "double") { - $rangeSlider.append(doubleHTML); - - $fromSlider = $rangeSlider.find(".from"); - $toSlider = $rangeSlider.find(".to"); - $diapason = $rangeSlider.find(".irs-diapason"); - - setDiapason(); - - $fromSlider.on("mousedown", function (e) { - e.preventDefault(); - e.stopPropagation(); - - $(this).addClass("last"); - $toSlider.removeClass("last"); - calcDimensions(e, $(this), "from"); - - allowDrag = true; - is_slider_active = true; - current = self.plugin_count; - - if (is_old_ie) { - $("*").prop("unselectable", true); - } - }); - $toSlider.on("mousedown", function (e) { - e.preventDefault(); - e.stopPropagation(); - - $(this).addClass("last"); - $fromSlider.removeClass("last"); - calcDimensions(e, $(this), "to"); - - allowDrag = true; - is_slider_active = true; - current = self.plugin_count; - - if (is_old_ie) { - $("*").prop("unselectable", true); - } - }); - - if (is_touch) { - $fromSlider.on("touchstart", function (e) { - e.preventDefault(); - e.stopPropagation(); - - $(this).addClass("last"); - $toSlider.removeClass("last"); - calcDimensions(e.originalEvent.touches[0], $(this), "from"); - - allowDrag = true; - is_slider_active = true; - current = self.plugin_count; - }); - $toSlider.on("touchstart", function (e) { - e.preventDefault(); - e.stopPropagation(); - - $(this).addClass("last"); - $fromSlider.removeClass("last"); - calcDimensions(e.originalEvent.touches[0], $(this), "to"); - - allowDrag = true; - is_slider_active = true; - current = self.plugin_count; - }); - } - - if (settings.to === settings.max) { - $fromSlider.addClass("last"); - } - } + if (options.to) { + this.updateTo(); + } - var mouseup = function () { - if (current !== self.plugin_count) { - return; - } - - if (allowDrag) { - is_slider_active = false; - allowDrag = false; - $activeSlider.removeAttr("id"); - $activeSlider = null; - if (settings.type === "double") { - setDiapason(); - } - getNumbers(); - - if (is_old_ie) { - $("*").prop("unselectable", false); - } - } - }; - - $window.on("mouseup.irs" + self.plugin_count, function () { - mouseup(); - }); - - if (is_old_ie) { - $body.on("mouseleave.irs" + self.plugin_count, function () { - mouseup(); - }); - } + } else { + this.updateFrom(); + this.updateTo(); - $body.on("mousemove.irs" + self.plugin_count, function (e) { - if (allowDrag) { - mouseX = e.pageX; - dragSlider(); - } - }); - - $container.on("mousedown", function () { - current = self.plugin_count; - }); - - $container.on("mouseup", function (e) { - if (current !== self.plugin_count) { - return; - } - - if (allowDrag || settings.disable) { - return; - } - - moveByClick(e.pageX); - }); - - if (is_touch) { - $window.on("touchend", function () { - if (allowDrag) { - is_slider_active = false; - allowDrag = false; - $activeSlider.removeAttr("id"); - $activeSlider = null; - if (settings.type === "double") { - setDiapason(); - } - getNumbers(); - } - }); - $window.on("touchmove", function (e) { - if (allowDrag) { - mouseX = e.originalEvent.touches[0].pageX; - dragSlider(); - } - }); - } + } + }, - getSize(); - setNumbers(); - if (settings.hasGrid) { - setGrid(); - } - if (settings.disable) { - setMask(); - } else { - removeMask(); - } - }; - var getSize = function () { - normalWidth = $rangeSlider.width(); - if ($singleSlider) { - sliderWidth = $singleSlider.width(); - } else { - sliderWidth = $fromSlider.width(); - } - fullWidth = normalWidth - sliderWidth; - }; + // ============================================================================================================= + // Grid - var calcDimensions = function (e, currentSlider, whichSlider) { - getSize(); + appendGrid: function () { + if (!this.options.grid) { + return; + } - is_first_start = false; - $activeSlider = currentSlider; - $activeSlider.prop("id", "irs-active-slider"); + var o = this.options, + i, z, - var _x1 = $activeSlider.offset().left, - _x2 = e.pageX - _x1; - minusX = _x1 + _x2 - $activeSlider.position().left; + total = o.max - o.min, + big_num = o.grid_num, + big_p = 0, + big_w = 0, - if (settings.type === "single") { + small_max = 4, + local_small_max, + small_p, + small_w = 0, - width = $rangeSlider.width() - sliderWidth; + result, + html = ''; - } else if (settings.type === "double") { - if (whichSlider === "from") { - left = 0; - right = parseInt($toSlider.css("left"), 10); - } else { - left = parseInt($fromSlider.css("left"), 10); - right = $rangeSlider.width() - sliderWidth; - } - } - }; - - var setDiapason = function () { - var _w = $fromSlider.width(), - _x = $.data($fromSlider[0], "x") || parseInt($fromSlider[0].style.left, 10) || $fromSlider.position().left, - _width = $.data($toSlider[0], "x") || parseInt($toSlider[0].style.left, 10) || $toSlider.position().left, - x = _x + (_w / 2), - w = _width - _x; - $diapason[0].style.left = x + "px"; - $diapason[0].style.width = w + "px"; - }; - - var dragSlider = function (manual_x) { - var x_pure = mouseX - minusX, - x; - - if (manual_x) { - x_pure = manual_x; - } else { - x_pure = mouseX - minusX; - } + this.calcGridMargin(); - if (settings.type === "single") { + if (o.grid_snap) { + big_num = total / o.step; + big_p = this.toFixed(o.step / (total / 100)); + } else { + big_p = this.toFixed(100 / big_num); + } - if (x_pure < 0) { - x_pure = 0; - } - if (x_pure > width) { - x_pure = width; - } + if (big_num > 4) { + small_max = 3; + } + if (big_num > 7) { + small_max = 2; + } + if (big_num > 14) { + small_max = 1; + } + if (big_num > 28) { + small_max = 0; + } - } else if (settings.type === "double") { + for (i = 0; i < big_num + 1; i++) { + local_small_max = small_max; - if (x_pure < left) { - x_pure = left; - } - if (x_pure > right) { - x_pure = right; - } - setDiapason(); + big_w = this.toFixed(big_p * i); + if (big_w > 100) { + big_w = 100; + local_small_max -= 2; + if (local_small_max < 0) { + local_small_max = 0; } + } + this.coords.big[i] = big_w; - $.data($activeSlider[0], "x", x_pure); - getNumbers(); - - x = Math.round(x_pure); - $activeSlider[0].style.left = x + "px"; - }; - - var getNumbers = function () { - var nums = { - input: slider, - slider: $container, - min: settings.min, - max: settings.max, - fromNumber: 0, - toNumber: 0, - fromPers: 0, - toPers: 0, - fromX: 0, - fromX_pure: 0, - toX: 0, - toX_pure: 0 - }; - var diapason = settings.max - settings.min, _from, _to; - - if (settings.type === "single") { - - nums.fromX = $.data($singleSlider[0], "x") || parseInt($singleSlider[0].style.left, 10) || $singleSlider.position().left; - nums.fromPers = nums.fromX / fullWidth * 100; - _from = (diapason / 100 * nums.fromPers) + settings.min; - nums.fromNumber = Math.round(_from / settings.step) * settings.step; - if (nums.fromNumber < settings.min) { - nums.fromNumber = settings.min; - } - if (nums.fromNumber > settings.max) { - nums.fromNumber = settings.max; - } - - if (stepFloat) { - nums.fromNumber = parseInt(nums.fromNumber * stepFloat, 10) / stepFloat; - } - - if (allow_values) { - nums.fromValue = settings.values[nums.fromNumber]; - } - - } else if (settings.type === "double") { - - nums.fromX = $.data($fromSlider[0], "x") || parseInt($fromSlider[0].style.left, 10) || $fromSlider.position().left; - nums.fromPers = nums.fromX / fullWidth * 100; - _from = (diapason / 100 * nums.fromPers) + settings.min; - nums.fromNumber = Math.round(_from / settings.step) * settings.step; - if (nums.fromNumber < settings.min) { - nums.fromNumber = settings.min; - } - - nums.toX = $.data($toSlider[0], "x") || parseInt($toSlider[0].style.left, 10) || $toSlider.position().left; - nums.toPers = nums.toX / fullWidth * 100; - _to = (diapason / 100 * nums.toPers) + settings.min; - nums.toNumber = Math.round(_to / settings.step) * settings.step; - if (nums.toNumber > settings.max) { - nums.toNumber = settings.max; - } - - if (stepFloat) { - nums.fromNumber = parseInt(nums.fromNumber * stepFloat, 10) / stepFloat; - nums.toNumber = parseInt(nums.toNumber * stepFloat, 10) / stepFloat; - } - - if (allow_values) { - nums.fromValue = settings.values[nums.fromNumber]; - nums.toValue = settings.values[nums.toNumber]; - } + small_p = (big_w - (big_p * (i - 1))) / (local_small_max + 1); + for (z = 1; z <= local_small_max; z++) { + if (big_w === 0) { + break; } - numbers = nums; - setFields(); - }; - - var setNumbers = function () { - var nums = { - input: slider, - slider: $container, - min: settings.min, - max: settings.max, - fromNumber: settings.from, - toNumber: settings.to, - fromPers: 0, - toPers: 0, - fromX: 0, - fromX_pure: 0, - toX: 0, - toX_pure: 0 - }; - var diapason = settings.max - settings.min; - - if (settings.type === "single") { - - nums.fromPers = (diapason !== 0) ? (nums.fromNumber - settings.min) / diapason * 100 : 0; - nums.fromX_pure = fullWidth / 100 * nums.fromPers; - nums.fromX = Math.round(nums.fromX_pure); - $singleSlider[0].style.left = nums.fromX + "px"; - $.data($singleSlider[0], "x", nums.fromX_pure); - - } else if (settings.type === "double") { - - nums.fromPers = (diapason !== 0) ? (nums.fromNumber - settings.min) / diapason * 100 : 0; - nums.fromX_pure = fullWidth / 100 * nums.fromPers; - nums.fromX = Math.round(nums.fromX_pure); - $fromSlider[0].style.left = nums.fromX + "px"; - $.data($fromSlider[0], "x", nums.fromX_pure); - - nums.toPers = (diapason !== 0) ? (nums.toNumber - settings.min) / diapason * 100 : 1; - nums.toX_pure = fullWidth / 100 * nums.toPers; - nums.toX = Math.round(nums.toX_pure); - $toSlider[0].style.left = nums.toX + "px"; - $.data($toSlider[0], "x", nums.toX_pure); - - setDiapason(); + small_w = this.toFixed(big_w - (small_p * z)); - } + html += ''; + } - numbers = nums; - setFields(); - }; - - var moveByClick = function (page_x) { - is_first_start = false; - - var x = page_x - $container.offset().left, - d = numbers.toX - numbers.fromX, - zero_point = numbers.fromX + (d / 2); - - left = 0; - width = $rangeSlider.width() - sliderWidth; - right = $rangeSlider.width() - sliderWidth; - - if (settings.type === "single") { - $activeSlider = $singleSlider; - $activeSlider.prop("id", "irs-active-slider"); - dragSlider(x); - } else if (settings.type === "double") { - if (x <= zero_point) { - $activeSlider = $fromSlider; - } else { - $activeSlider = $toSlider; - } - $activeSlider.prop("id", "irs-active-slider"); - dragSlider(x); - setDiapason(); - } + html += ''; - $activeSlider.removeAttr("id"); - $activeSlider = null; - }; - - var setFields = function () { - var _from, _fromW, _fromX, - _to, _toW, _toX, - _single, _singleW, _singleX, - _slW = (sliderWidth / 2), - maxPostfix = ""; - - if (settings.type === "single") { - - if (numbers.fromNumber === settings.max) { - maxPostfix = settings.maxPostfix; - } else { - maxPostfix = ""; - } - - $fieldFrom[0].style.display = "none"; - $fieldTo[0].style.display = "none"; - - if (allow_values) { - _single = - settings.prefix + - settings.values[numbers.fromNumber] + - maxPostfix + - settings.postfix; - } else { - _single = - settings.prefix + - prettify(numbers.fromNumber) + - maxPostfix + - settings.postfix; - } - - $fieldSingle.html(_single); - - _singleW = $fieldSingle.outerWidth(false); - _singleX = numbers.fromX - (_singleW / 2) + _slW; - if (_singleX < 0) { - _singleX = 0; - } - if (_singleX > normalWidth - _singleW) { - _singleX = normalWidth - _singleW; - } - $fieldSingle[0].style.left = _singleX + "px"; - - if (!settings.hideMinMax && !settings.hideFromTo) { - if (_singleX < fieldMinWidth) { - $fieldMin[0].style.display = "none"; - } else { - $fieldMin[0].style.display = "block"; - } - - if (_singleX + _singleW > normalWidth - fieldMaxWidth) { - $fieldMax[0].style.display = "none"; - } else { - $fieldMax[0].style.display = "block"; - } - } - - slider.prop("value", parseFloat(numbers.fromNumber)); - - } else if (settings.type === "double") { - - if (numbers.fromNumber === settings.max) { - maxPostfix = settings.maxPostfix; - } else { - maxPostfix = ""; - } - - if (numbers.toNumber === settings.max) { - maxPostfix = settings.maxPostfix; - } else { - maxPostfix = ""; - } - - if (allow_values) { - _from = - settings.prefix + - settings.values[numbers.fromNumber] + - settings.postfix; - - _to = - settings.prefix + - settings.values[numbers.toNumber] + - maxPostfix + - settings.postfix; - - if (numbers.fromNumber !== numbers.toNumber) { - _single = - settings.prefix + - settings.values[numbers.fromNumber] + - " — " + settings.prefix + - settings.values[numbers.toNumber] + - maxPostfix + - settings.postfix; - } else { - _single = - settings.prefix + - settings.values[numbers.fromNumber] + - maxPostfix + - settings.postfix; - } - } else { - _from = - settings.prefix + - prettify(numbers.fromNumber) + - settings.postfix; - - _to = - settings.prefix + - prettify(numbers.toNumber) + - maxPostfix + - settings.postfix; - - if (numbers.fromNumber !== numbers.toNumber) { - _single = - settings.prefix + - prettify(numbers.fromNumber) + - " — " + settings.prefix + - prettify(numbers.toNumber) + - maxPostfix + - settings.postfix; - } else { - _single = - settings.prefix + - prettify(numbers.fromNumber) + - maxPostfix + - settings.postfix; - } - } - - $fieldFrom.html(_from); - $fieldTo.html(_to); - $fieldSingle.html(_single); - - _fromW = $fieldFrom.outerWidth(false); - _fromX = numbers.fromX - (_fromW / 2) + _slW; - if (_fromX < 0) { - _fromX = 0; - } - if (_fromX > normalWidth - _fromW) { - _fromX = normalWidth - _fromW; - } - $fieldFrom[0].style.left = _fromX + "px"; - - _toW = $fieldTo.outerWidth(false); - _toX = numbers.toX - (_toW / 2) + _slW; - if (_toX < 0) { - _toX = 0; - } - if (_toX > normalWidth - _toW) { - _toX = normalWidth - _toW; - } - $fieldTo[0].style.left = _toX + "px"; - - _singleW = $fieldSingle.outerWidth(false); - _singleX = numbers.fromX + ((numbers.toX - numbers.fromX) / 2) - (_singleW / 2) + _slW; - if (_singleX < 0) { - _singleX = 0; - } - if (_singleX > normalWidth - _singleW) { - _singleX = normalWidth - _singleW; - } - $fieldSingle[0].style.left = _singleX + "px"; - - if (_fromX + _fromW < _toX) { - $fieldSingle[0].style.display = "none"; - $fieldFrom[0].style.display = "block"; - $fieldTo[0].style.display = "block"; - } else { - $fieldSingle[0].style.display = "block"; - $fieldFrom[0].style.display = "none"; - $fieldTo[0].style.display = "none"; - } - - if (!settings.hideMinMax && !settings.hideFromTo) { - if (_singleX < fieldMinWidth || _fromX < fieldMinWidth) { - $fieldMin[0].style.display = "none"; - } else { - $fieldMin[0].style.display = "block"; - } - - if (_singleX + _singleW > normalWidth - fieldMaxWidth || _toX + _toW > normalWidth - fieldMaxWidth) { - $fieldMax[0].style.display = "none"; - } else { - $fieldMax[0].style.display = "block"; - } - } - - slider.prop("value", parseFloat(numbers.fromNumber) + ";" + parseFloat(numbers.toNumber)); + result = this.calcReal(big_w); + if (o.values.length) { + result = o.p_values[result]; + } else { + result = this._prettify(result); + } - } + html += '' + result + ''; + } + this.coords.big_num = Math.ceil(big_num + 1); - settings.from = numbers.fromNumber; - settings.to = numbers.toNumber; - callbacks(); - }; - var callbacks = function () { - // trigger onFinish function - if (typeof settings.onFinish === "function" && !is_slider_active && !is_first_start) { - settings.onFinish.call(this, numbers); - } + this.$cache.cont.addClass("irs-with-grid"); + this.$cache.grid.html(html); + this.cacheGridLabels(); + }, - // trigger onChange function - if (typeof settings.onChange === "function" && !is_first_start) { - settings.onChange.call(this, numbers); - } + cacheGridLabels: function () { + var $label, i, + num = this.coords.big_num; - // trigger onLoad function - if (typeof settings.onLoad === "function" && !is_slider_active && is_first_start) { - settings.onLoad.call(this, numbers); - is_first_start = false; - } - }; + for (i = 0; i < num; i++) { + $label = this.$cache.grid.find(".js-grid-text-" + i); + this.$cache.grid_labels.push($label); + } + this.calcGridLabels(); + }, - var setGrid = function () { - $container.addClass("irs-with-grid"); + calcGridLabels: function () { + var i, label, start = [], finish = [], + num = this.coords.big_num; - var i, - text = '', - step = 0, - tStep = 0, - gridHTML = '', - smNum = 20, - bigNum = 4, - cont_width = normalWidth - (settings.gridMargin * 2); + for (i = 0; i < num; i++) { + this.coords.big_w[i] = this.$cache.grid_labels[i].outerWidth(false); + this.coords.big_p[i] = this.toFixed(this.coords.big_w[i] / this.coords.w_rs * 100); + this.coords.big_x[i] = this.toFixed(this.coords.big_p[i] / 2); + start[i] = this.toFixed(this.coords.big[i] - this.coords.big_x[i]); + finish[i] = this.toFixed(start[i] + this.coords.big_p[i]); + } + if (this.options.force_edges) { + if (start[0] < this.coords.grid_gap) { + start[0] = this.coords.grid_gap; + finish[0] = this.toFixed(start[0] + this.coords.big_p[0]); - for (i = 0; i <= smNum; i += 1) { - step = Math.floor(cont_width / smNum * i); + this.coords.big_x[0] = this.coords.grid_gap; + } - if (step >= cont_width) { - step = cont_width - 1; - } - gridHTML += ''; - } - for (i = 0; i <= bigNum; i += 1) { - step = Math.floor(cont_width / bigNum * i); - - if (step >= cont_width) { - step = cont_width - 1; - } - gridHTML += ''; - - if (stepFloat) { - text = (settings.min + ((settings.max - settings.min) / bigNum * i)); - text = (text / settings.step) * settings.step; - text = parseInt(text * stepFloat, 10) / stepFloat; - } else { - text = Math.round(settings.min + ((settings.max - settings.min) / bigNum * i)); - text = Math.round(text / settings.step) * settings.step; - text = prettify(text); - } - - if (allow_values) { - if (settings.hideMinMax) { - text = Math.round(settings.min + ((settings.max - settings.min) / bigNum * i)); - text = Math.round(text / settings.step) * settings.step; - if (i === 0 || i === bigNum) { - text = settings.values[text]; - } else { - text = ""; - } - } else { - text = ""; - } - } - - if (i === 0) { - tStep = step; - gridHTML += '' + text + ''; - } else if (i === bigNum) { - tStep = step - 100; - gridHTML += '' + text + ''; - } else { - tStep = step - 50; - gridHTML += '' + text + ''; - } - } + if (finish[num - 1] > 100 - this.coords.grid_gap) { + finish[num - 1] = 100 - this.coords.grid_gap; + start[num - 1] = this.toFixed(finish[num - 1] - this.coords.big_p[num - 1]); - $grid.html(gridHTML); - $grid[0].style.left = settings.gridMargin + "px"; - }; + this.coords.big_x[num - 1] = this.toFixed(this.coords.big_p[num - 1] - this.coords.grid_gap); + } + } + this.calcGridCollision(2, start, finish); + this.calcGridCollision(4, start, finish); + for (i = 0; i < num; i++) { + label = this.$cache.grid_labels[i][0]; + label.style.marginLeft = -this.coords.big_x[i] + "%"; + } + }, - // Disable state - var setMask = function () { - $container.addClass("irs-disabled"); - $container.append(disableHTML); - }; + // Collisions Calc Beta + // TODO: Refactor then have plenty of time + calcGridCollision: function (step, start, finish) { + var i, next_i, label, + num = this.coords.big_num; - var removeMask = function () { - $container.removeClass("irs-disabled"); - $container.find(".irs-disable-mask").remove(); - }; + for (i = 0; i < num; i += step) { + next_i = i + (step / 2); + if (next_i >= num) { + break; + } + label = this.$cache.grid_labels[next_i][0]; + if (finish[i] <= start[next_i]) { + label.style.visibility = "visible"; + } else { + label.style.visibility = "hidden"; + } + } + }, - placeHTML(); - }); + calcGridMargin: function () { + if (!this.options.grid_margin) { + return; + } + + this.coords.w_rs = this.$cache.rs.outerWidth(false); + if (!this.coords.w_rs) { + return; + } + + if (this.options.type === "single") { + this.coords.w_handle = this.$cache.s_single.outerWidth(false); + } else { + this.coords.w_handle = this.$cache.s_from.outerWidth(false); + } + this.coords.p_handle = this.toFixed(this.coords.w_handle / this.coords.w_rs * 100); + this.coords.grid_gap = this.toFixed((this.coords.p_handle / 2) - 0.1); + + this.$cache.grid[0].style.width = this.toFixed(100 - this.coords.p_handle) + "%"; + this.$cache.grid[0].style.left = this.coords.grid_gap + "%"; }, + + + + // ============================================================================================================= + // Public methods + update: function (options) { - return this.each(function () { - this.updateData(options); - }); + this.is_update = true; + this.options = $.extend(this.options, options); + this.validate(); + this.updateResult(options); + + this.toggleInput(); + this.remove(); + this.init(true); }, - remove: function () { - return this.each(function () { - this.removeSlider(); - }); + + reset: function () { + this.updateResult(); + this.update(); + }, + + destroy: function () { + this.toggleInput(); + $.data(this.input, "ionRangeSlider", null); + + this.remove(); + this.input = null; + this.options = null; } }; - $.fn.ionRangeSlider = function (method) { - if (methods[method]) { - return methods[method].apply(this, Array.prototype.slice.call(arguments, 1)); - } else if (typeof method === 'object' || !method) { - return methods.init.apply(this, arguments); - } else { - $.error('Method ' + method + ' does not exist for jQuery.ionRangeSlider'); - } + $.fn.ionRangeSlider = function (options) { + return this.each(function() { + if (!$.data(this, "ionRangeSlider")) { + $.data(this, "ionRangeSlider", new IonRangeSlider(this, options, plugin_count++)); + } + }); }; -}(jQuery, document, window, navigator)); + + + // ================================================================================================================= + // http://paulirish.com/2011/requestanimationframe-for-smart-animating/ + // http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating + + // requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel + + // MIT license + + (function() { + var lastTime = 0; + var vendors = ['ms', 'moz', 'webkit', 'o']; + for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { + window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame']; + window.cancelAnimationFrame = window[vendors[x]+'CancelAnimationFrame'] + || window[vendors[x]+'CancelRequestAnimationFrame']; + } + + if (!window.requestAnimationFrame) + window.requestAnimationFrame = function(callback, element) { + var currTime = new Date().getTime(); + var timeToCall = Math.max(0, 16 - (currTime - lastTime)); + var id = window.setTimeout(function() { callback(currTime + timeToCall); }, + timeToCall); + lastTime = currTime + timeToCall; + return id; + }; + + if (!window.cancelAnimationFrame) + window.cancelAnimationFrame = function(id) { + clearTimeout(id); + }; + }()); + +} (jQuery, document, window, navigator)); diff --git a/js/ion.rangeSlider.min.js b/js/ion.rangeSlider.min.js index a866d04..bb48b87 100644 --- a/js/ion.rangeSlider.min.js +++ b/js/ion.rangeSlider.min.js @@ -1,27 +1,57 @@ -// Ion.RangeSlider | version 1.9.3 | https://github.com/IonDen/ion.rangeSlider -(function(c,ea,aa,M){var ba=0,r,N=function(){var c=M.userAgent,a=/msie\s\d+/i;return 0c)?!0:!1}(),X="ontouchstart"in aa||0a.max&&(a.from=a.min);a.toa.max&&(a.to=a.max);"double"===a.type&&(a.from>a.to&&(a.from=a.to),a.to';e[0].style.display="none";e.before(g);var n=e.prev(),C=c(ea.body),P=c(aa),p,D,E,A,B,w,x,m,s,q,H,Y, -v=!1,y=!1,J=!0,f={},U=0,Q=0,R=0,t=0,F=0,G=0,V=0,S=0,T=0,Z=0,u=0;parseInt(a.step,10)!==parseFloat(a.step)&&(u=a.step.toString().split(".")[1],u=Math.pow(10,u.length));this.updateData=function(b){c.extend(a,b);n.find("*").off();P.off("mouseup.irs"+l.plugin_count);C.off("mouseup.irs"+l.plugin_count);C.off("mouseleave.irs"+l.plugin_count);C.off("mousemove.irs"+l.plugin_count);n.html("");M()};this.removeSlider=function(){n.find("*").off();P.off("mouseup.irs"+l.plugin_count);C.off("mouseup.irs"+l.plugin_count); -C.off("mouseleave.irs"+l.plugin_count);C.off("mousemove.irs"+l.plugin_count);n.html("").remove();e.data("isActive",!1);e.show()};var M=function(){n.html('01000');p= -n.find(".irs");D=p.find(".irs-min");E=p.find(".irs-max");A=p.find(".irs-from");B=p.find(".irs-to");w=p.find(".irs-single");Y=n.find(".irs-grid");a.hideFromTo&&(A[0].style.visibility="hidden",B[0].style.visibility="hidden",w[0].style.visibility="hidden");a.hideFromTo||(A[0].style.visibility="visible",B[0].style.visibility="visible",w[0].style.visibility="visible");a.hideMinMax&&(D[0].style.visibility="hidden",E[0].style.visibility="hidden",R=Q=0);a.hideMinMax||(D[0].style.visibility="visible",E[0].style.visibility= -"visible",a.values?(D.html(a.prefix+a.values[0]+a.postfix),E.html(a.prefix+a.values[a.values.length-1]+a.maxPostfix+a.postfix)):(D.html(a.prefix+z(a.min)+a.postfix),E.html(a.prefix+z(a.max)+a.maxPostfix+a.postfix)),Q=D.outerWidth(!1),R=E.outerWidth(!1));ga()},ga=function(){if("single"===a.type){if(p.append(''),x=p.find(".single"),x.on("mousedown",function(a){a.preventDefault();a.stopPropagation();K(a,c(this),null);y=v=!0;r=l.plugin_count;N&&c("*").prop("unselectable", -!0)}),X)x.on("touchstart",function(a){a.preventDefault();a.stopPropagation();K(a.originalEvent.touches[0],c(this),null);y=v=!0;r=l.plugin_count})}else"double"===a.type&&(p.append(''),m=p.find(".from"),s=p.find(".to"),H=p.find(".irs-diapason"),L(),m.on("mousedown",function(a){a.preventDefault();a.stopPropagation();c(this).addClass("last");s.removeClass("last");K(a,c(this),"from");y=v=!0;r=l.plugin_count; -N&&c("*").prop("unselectable",!0)}),s.on("mousedown",function(a){a.preventDefault();a.stopPropagation();c(this).addClass("last");m.removeClass("last");K(a,c(this),"to");y=v=!0;r=l.plugin_count;N&&c("*").prop("unselectable",!0)}),X&&(m.on("touchstart",function(a){a.preventDefault();a.stopPropagation();c(this).addClass("last");s.removeClass("last");K(a.originalEvent.touches[0],c(this),"from");y=v=!0;r=l.plugin_count}),s.on("touchstart",function(a){a.preventDefault();a.stopPropagation();c(this).addClass("last"); -m.removeClass("last");K(a.originalEvent.touches[0],c(this),"to");y=v=!0;r=l.plugin_count})),a.to===a.max&&m.addClass("last"));var b=function(){r===l.plugin_count&&v&&(v=y=!1,q.removeAttr("id"),q=null,"double"===a.type&&L(),$(),N&&c("*").prop("unselectable",!1))};P.on("mouseup.irs"+l.plugin_count,function(){b()});if(N)C.on("mouseleave.irs"+l.plugin_count,function(){b()});C.on("mousemove.irs"+l.plugin_count,function(a){v&&(U=a.pageX,W())});n.on("mousedown",function(){r=l.plugin_count});n.on("mouseup", -function(b){if(r===l.plugin_count&&!v&&!a.disable){b=b.pageX;J=!1;b-=n.offset().left;var h=f.fromX+(f.toX-f.fromX)/2;S=0;V=p.width()-G;T=p.width()-G;"single"===a.type?(q=x,q.prop("id","irs-active-slider"),W(b)):"double"===a.type&&(q=b<=h?m:s,q.prop("id","irs-active-slider"),W(b),L());q.removeAttr("id");q=null}});X&&(P.on("touchend",function(){v&&(v=y=!1,q.removeAttr("id"),q=null,"double"===a.type&&L(),$())}),P.on("touchmove",function(a){v&&(U=a.originalEvent.touches[0].pageX,W())}));ca();ha();a.hasGrid&& -ia();a.disable?(n.addClass("irs-disabled"),n.append('')):(n.removeClass("irs-disabled"),n.find(".irs-disable-mask").remove())},ca=function(){t=p.width();G=x?x.width():m.width();F=t-G},K=function(b,d,h){ca();J=!1;q=d;q.prop("id","irs-active-slider");d=q.offset().left;Z=d+(b.pageX-d)-q.position().left;"single"===a.type?V=p.width()-G:"double"===a.type&&("from"===h?(S=0,T=parseInt(s.css("left"),10)):(S=parseInt(m.css("left"),10),T=p.width()-G))},L=function(){var a= -m.width(),d=c.data(m[0],"x")||parseInt(m[0].style.left,10)||m.position().left,h=(c.data(s[0],"x")||parseInt(s[0].style.left,10)||s.position().left)-d;H[0].style.left=d+a/2+"px";H[0].style.width=h+"px"},W=function(b){var d=U-Z,d=b?b:U-Z;"single"===a.type?(0>d&&(d=0),d>V&&(d=V)):"double"===a.type&&(dT&&(d=T),L());c.data(q[0],"x",d);$();b=Math.round(d);q[0].style.left=b+"px"},$=function(){var b={input:e,slider:n,min:a.min,max:a.max,fromNumber:0,toNumber:0,fromPers:0,toPers:0,fromX:0,fromX_pure:0, -toX:0,toX_pure:0},d=a.max-a.min,h;"single"===a.type?(b.fromX=c.data(x[0],"x")||parseInt(x[0].style.left,10)||x.position().left,b.fromPers=b.fromX/F*100,h=d/100*b.fromPers+a.min,b.fromNumber=Math.round(h/a.step)*a.step,b.fromNumbera.max&&(b.fromNumber=a.max),u&&(b.fromNumber=parseInt(b.fromNumber*u,10)/u),I&&(b.fromValue=a.values[b.fromNumber])):"double"===a.type&&(b.fromX=c.data(m[0],"x")||parseInt(m[0].style.left,10)||m.position().left,b.fromPers=b.fromX/ -F*100,h=d/100*b.fromPers+a.min,b.fromNumber=Math.round(h/a.step)*a.step,b.fromNumbera.max&&(b.toNumber=a.max),u&&(b.fromNumber=parseInt(b.fromNumber*u,10)/u,b.toNumber=parseInt(b.toNumber*u,10)/u),I&&(b.fromValue=a.values[b.fromNumber],b.toValue=a.values[b.toNumber]));f=b;da()},ha=function(){var b={input:e, -slider:n,min:a.min,max:a.max,fromNumber:a.from,toNumber:a.to,fromPers:0,toPers:0,fromX:0,fromX_pure:0,toX:0,toX_pure:0},d=a.max-a.min;"single"===a.type?(b.fromPers=0!==d?(b.fromNumber-a.min)/d*100:0,b.fromX_pure=F/100*b.fromPers,b.fromX=Math.round(b.fromX_pure),x[0].style.left=b.fromX+"px",c.data(x[0],"x",b.fromX_pure)):"double"===a.type&&(b.fromPers=0!==d?(b.fromNumber-a.min)/d*100:0,b.fromX_pure=F/100*b.fromPers,b.fromX=Math.round(b.fromX_pure),m[0].style.left=b.fromX+"px",c.data(m[0],"x",b.fromX_pure), -b.toPers=0!==d?(b.toNumber-a.min)/d*100:1,b.toX_pure=F/100*b.toPers,b.toX=Math.round(b.toX_pure),s[0].style.left=b.toX+"px",c.data(s[0],"x",b.toX_pure),L());f=b;da()},da=function(){var b,d,h,c,g,k;k=G/2;h="";"single"===a.type?(h=f.fromNumber===a.max?a.maxPostfix:"",A[0].style.display="none",B[0].style.display="none",h=I?a.prefix+a.values[f.fromNumber]+h+a.postfix:a.prefix+z(f.fromNumber)+h+a.postfix,w.html(h),g=w.outerWidth(!1),k=f.fromX-g/2+k,0>k&&(k=0),k>t-g&&(k=t-g),w[0].style.left=k+"px",a.hideMinMax|| -a.hideFromTo||(D[0].style.display=kt-R?"none":"block"),e.prop("value",parseFloat(f.fromNumber))):"double"===a.type&&(h=f.toNumber===a.max?a.maxPostfix:"",I?(b=a.prefix+a.values[f.fromNumber]+a.postfix,d=a.prefix+a.values[f.toNumber]+h+a.postfix,h=f.fromNumber!==f.toNumber?a.prefix+a.values[f.fromNumber]+" \u2014 "+a.prefix+a.values[f.toNumber]+h+a.postfix:a.prefix+a.values[f.fromNumber]+h+a.postfix):(b=a.prefix+z(f.fromNumber)+a.postfix,d=a.prefix+z(f.toNumber)+ -h+a.postfix,h=f.fromNumber!==f.toNumber?a.prefix+z(f.fromNumber)+" \u2014 "+a.prefix+z(f.toNumber)+h+a.postfix:a.prefix+z(f.fromNumber)+h+a.postfix),A.html(b),B.html(d),w.html(h),b=A.outerWidth(!1),d=f.fromX-b/2+k,0>d&&(d=0),d>t-b&&(d=t-b),A[0].style.left=d+"px",h=B.outerWidth(!1),c=f.toX-h/2+k,0>c&&(c=0),c>t-h&&(c=t-h),B[0].style.left=c+"px",g=w.outerWidth(!1),k=f.fromX+(f.toX-f.fromX)/2-g/2+k,0>k&&(k=0),k>t-g&&(k=t-g),w[0].style.left=k+"px",d+bt-R||c+h>t-R?"none":"block"),e.prop("value",parseFloat(f.fromNumber)+";"+parseFloat(f.toNumber)));a.from=f.fromNumber;a.to=f.toNumber;ja()},ja=function(){"function"!==typeof a.onFinish||y||J||a.onFinish.call(this,f);"function"!==typeof a.onChange||J||a.onChange.call(this,f);"function"===typeof a.onLoad&& -!y&&J&&(a.onLoad.call(this,f),J=!1)},ia=function(){n.addClass("irs-with-grid");var b,d="",c=0,c=0,e="",f=t-2*a.gridMargin;for(b=0;20>=b;b+=1)c=Math.floor(f/20*b),c>=f&&(c=f-1),e+='';for(b=0;4>=b;b+=1)c=Math.floor(f/4*b),c>=f&&(c=f-1),e+='',u?(d=a.min+(a.max-a.min)/4*b,d=d/a.step*a.step,d=parseInt(d*u,10)/u):(d=Math.round(a.min+(a.max-a.min)/4*b),d=Math.round(d/a.step)*a.step,d=z(d)), -I&&(a.hideMinMax?(d=Math.round(a.min+(a.max-a.min)/4*b),d=Math.round(d/a.step)*a.step,d=0===b||4===b?a.values[d]:""):d=""),0===b?e+=''+d+"":4===b?(c-=100,e+=''+d+""):(c-=50,e+=''+d+"");Y.html(e);Y[0].style.left=a.gridMargin+"px"};M()}})},update:function(c){return this.each(function(){this.updateData(c)})}, -remove:function(){return this.each(function(){this.removeSlider()})}};c.fn.ionRangeSlider=function(r){if(H[r])return H[r].apply(this,Array.prototype.slice.call(arguments,1));if("object"!==typeof r&&r)c.error("Method "+r+" does not exist for jQuery.ionRangeSlider");else return H.init.apply(this,arguments)}})(jQuery,document,window,navigator); +// Ion.RangeSlider | version 2.0.0 | https://github.com/IonDen/ion.rangeSlider +(function(e,r,f,p,t){var s=0,n=function(){var a=p.userAgent,b=/msie\s\d+/i;return 0a)?(e("html").addClass("lt-ie9"),!0):!1}(),k="ontouchstart"in f||0');this.$cache.cont=this.$cache.input.prev();this.result.slider=this.$cache.cont;this.$cache.cont.html('01000'); +this.$cache.rs=this.$cache.cont.find(".irs");this.$cache.min=this.$cache.cont.find(".irs-min");this.$cache.max=this.$cache.cont.find(".irs-max");this.$cache.from=this.$cache.cont.find(".irs-from");this.$cache.to=this.$cache.cont.find(".irs-to");this.$cache.single=this.$cache.cont.find(".irs-single");this.$cache.bar=this.$cache.cont.find(".irs-bar");this.$cache.line=this.$cache.cont.find(".irs-line");this.$cache.grid=this.$cache.cont.find(".irs-grid");"single"===this.options.type?(this.$cache.cont.append(''), +this.$cache.s_single=this.$cache.cont.find(".single"),this.$cache.from[0].style.visibility="hidden",this.$cache.to[0].style.visibility="hidden",this.$cache.shad_single=this.$cache.cont.find(".shadow-single")):(this.$cache.cont.append(''),this.$cache.s_from=this.$cache.cont.find(".from"),this.$cache.s_to=this.$cache.cont.find(".to"),this.$cache.shad_from= +this.$cache.cont.find(".shadow-from"),this.$cache.shad_to=this.$cache.cont.find(".shadow-to"));this.options.hide_from_to&&(this.$cache.from[0].style.display="none",this.$cache.to[0].style.display="none",this.$cache.single[0].style.display="none");this.appendGrid();this.options.disable?this.appendDisableMask():(this.$cache.cont.removeClass("irs-disabled"),this.bindEvents())},appendDisableMask:function(){this.$cache.cont.append('');this.$cache.cont.addClass("irs-disabled")}, +remove:function(){this.$cache.cont.remove();this.$cache.cont=null;this.$cache.input.off("keydown.irs_"+this.plugin_count);k?(this.$cache.body.off("touchmove.irs_"+this.plugin_count),this.$cache.win.off("touchend.irs_"+this.plugin_count)):(this.$cache.body.off("mousemove.irs_"+this.plugin_count),this.$cache.win.off("mouseup.irs_"+this.plugin_count),n&&(this.$cache.body.off("mouseup.irs_"+this.plugin_count),this.$cache.body.off("mouseleave.irs_"+this.plugin_count)));this.$cache.grid_labels=[];this.coords.big= +[];this.coords.big_w=[];this.coords.big_p=[];this.coords.big_x=[];cancelAnimationFrame(this.raf_id)},bindEvents:function(){if(k)this.$cache.body.on("touchmove.irs_"+this.plugin_count,this.pointerMove.bind(this)),this.$cache.win.on("touchend.irs_"+this.plugin_count,this.pointerUp.bind(this)),this.$cache.line.on("touchstart.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.bar.on("touchstart.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),"single"===this.options.type? +(this.$cache.s_single.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,"single")),this.$cache.shad_single.on("touchstart.irs_"+this.plugin_count,this.pointerClick.bind(this,"click"))):(this.$cache.s_from.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,"from")),this.$cache.s_to.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,"to")),this.$cache.shad_from.on("touchstart.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.shad_to.on("touchstart.irs_"+ +this.plugin_count,this.pointerClick.bind(this,"click")));else{if(this.options.keyboard)this.$cache.input.on("keydown.irs_"+this.plugin_count,this.key.bind(this,"keyboard"));this.$cache.body.on("mousemove.irs_"+this.plugin_count,this.pointerMove.bind(this));this.$cache.win.on("mouseup.irs_"+this.plugin_count,this.pointerUp.bind(this));n&&(this.$cache.body.on("mouseup.irs_"+this.plugin_count,this.pointerUp.bind(this)),this.$cache.body.on("mouseleave.irs_"+this.plugin_count,this.pointerUp.bind(this))); +this.$cache.line.on("mousedown.irs_"+this.plugin_count,this.pointerClick.bind(this,"click"));this.$cache.bar.on("mousedown.irs_"+this.plugin_count,this.pointerClick.bind(this,"click"));"single"===this.options.type?(this.$cache.s_single.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"single")),this.$cache.shad_single.on("mousedown.irs_"+this.plugin_count,this.pointerClick.bind(this,"click"))):(this.$cache.s_from.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"from")), +this.$cache.s_to.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"to")),this.$cache.shad_from.on("mousedown.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.shad_to.on("mousedown.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")))}},pointerMove:function(a){this.dragging&&(this.coords.x_pointer=(k?a.originalEvent.touches[0]:a).pageX-this.coords.x_gap,this.calc())},pointerUp:function(a){if(this.current_plugin===this.plugin_count&&this.is_active){this.is_active= +!1;var b=this.options.onFinish&&"function"===typeof this.options.onFinish;a=e.contains(this.$cache.cont[0],a.target)||this.dragging;if(b&&a)this.options.onFinish(this.result);this.force_redraw=!0;this.dragging=!1;n&&e("*").prop("unselectable",!1)}},pointerDown:function(a,b){b.preventDefault();var c=k?b.originalEvent.touches[0]:b;if(2!==b.button){this.current_plugin=this.plugin_count;this.target=a;this.dragging=this.is_active=!0;this.coords.x_gap=this.$cache.rs.offset().left;this.coords.x_pointer= +c.pageX-this.coords.x_gap;this.calcPointer();switch(a){case "single":this.coords.p_gap=this.toFixed(this.coords.p_pointer-this.coords.p_single);break;case "from":this.coords.p_gap=this.toFixed(this.coords.p_pointer-this.coords.p_from);this.$cache.s_from.addClass("type_last");this.$cache.s_to.removeClass("type_last");break;case "to":this.coords.p_gap=this.toFixed(this.coords.p_pointer-this.coords.p_to),this.$cache.s_to.addClass("type_last"),this.$cache.s_from.removeClass("type_last")}n&&e("*").prop("unselectable", +!0);this.$cache.input.trigger("focus")}},pointerClick:function(a,b){b.preventDefault();var c=k?b.originalEvent.touches[0]:b;2!==b.button&&(this.current_plugin=this.plugin_count,this.target=a,this.coords.x_gap=this.$cache.rs.offset().left,this.coords.x_pointer=+(c.pageX-this.coords.x_gap).toFixed(),this.force_redraw=!0,this.calc(),this.$cache.input.trigger("focus"))},key:function(a,b){if(!(this.current_plugin!==this.plugin_count||b.altKey||b.ctrlKey||b.shiftKey||b.metaKey)){switch(b.which){case 83:case 65:case 40:case 37:b.preventDefault(); +this.moveByKey(!1);break;case 87:case 68:case 38:case 39:b.preventDefault(),this.moveByKey(!0)}return!0}},moveByKey:function(a){var b=this.coords.p_pointer,b=a?b+this.options.keyboard_step:b-this.options.keyboard_step;this.coords.x_pointer=this.toFixed(this.coords.w_rs/100*b);this.is_key=!0;this.calc()},setMinMax:function(){this.options.hide_min_max?(this.$cache.min[0].style.display="none",this.$cache.max[0].style.display="none"):(this.options.values.length?(this.$cache.min.html(this.decorate(this.options.p_values[this.options.min])), +this.$cache.max.html(this.decorate(this.options.p_values[this.options.max]))):(this.$cache.min.html(this.decorate(this._prettify(this.options.min),this.options.min)),this.$cache.max.html(this.decorate(this._prettify(this.options.max),this.options.max))),this.labels.w_min=this.$cache.min.outerWidth(!1),this.labels.w_max=this.$cache.max.outerWidth(!1))},calc:function(a){this.calc_count++;if(10===this.calc_count||a)this.calc_count=0,this.coords.w_rs=this.$cache.rs.outerWidth(!1),this.coords.w_handle= +"single"===this.options.type?this.$cache.s_single.outerWidth(!1):this.$cache.s_from.outerWidth(!1);if(this.coords.w_rs){this.calcPointer();this.coords.p_handle=this.toFixed(this.coords.w_handle/this.coords.w_rs*100);a=100-this.coords.p_handle;var b=this.toFixed(this.coords.p_pointer-this.coords.p_gap);"click"===this.target&&(b=this.toFixed(this.coords.p_pointer-this.coords.p_handle/2),this.target=this.chooseHandle(b));0>b?b=0:b>a&&(b=a);switch(this.target){case "base":b=(this.options.max-this.options.min)/ +100;a=(this.result.from-this.options.min)/b;b=(this.result.to-this.options.min)/b;this.coords.p_single_real=this.toFixed(a);this.coords.p_from_real=this.toFixed(a);this.coords.p_to_real=this.toFixed(b);this.coords.p_single_real=this.checkDiapason(this.coords.p_single_real,this.options.from_min,this.options.from_max);this.coords.p_from_real=this.checkDiapason(this.coords.p_from_real,this.options.from_min,this.options.from_max);this.coords.p_to_real=this.checkDiapason(this.coords.p_to_real,this.options.to_min, +this.options.to_max);this.coords.p_single=this.toFixed(a-this.coords.p_handle/100*a);this.coords.p_from=this.toFixed(a-this.coords.p_handle/100*a);this.coords.p_to=this.toFixed(b-this.coords.p_handle/100*b);this.target=null;break;case "single":if(this.options.from_fixed)break;this.coords.p_single_real=this.calcWithStep(b/a*100);this.coords.p_single_real=this.checkDiapason(this.coords.p_single_real,this.options.from_min,this.options.from_max);this.coords.p_single=this.toFixed(this.coords.p_single_real/ +100*a);break;case "from":if(this.options.from_fixed)break;this.coords.p_from_real=this.calcWithStep(b/a*100);this.coords.p_from_real>this.coords.p_to_real&&(this.coords.p_from_real=this.coords.p_to_real);this.coords.p_from_real=this.checkDiapason(this.coords.p_from_real,this.options.from_min,this.options.from_max);this.coords.p_from=this.toFixed(this.coords.p_from_real/100*a);break;case "to":if(this.options.to_fixed)break;this.coords.p_to_real=this.calcWithStep(b/a*100);this.coords.p_to_realthis.coords.x_pointer?this.coords.x_pointer=0:this.coords.x_pointer>this.coords.w_rs&&(this.coords.x_pointer=this.coords.w_rs),this.coords.p_pointer=this.toFixed(this.coords.x_pointer/this.coords.w_rs*100)):this.coords.p_pointer=0},chooseHandle:function(a){return"single"===this.options.type?"single":a>=this.coords.p_from_real+(this.coords.p_to_real-this.coords.p_from_real)/2?"to":"from"},calcMinMax:function(){this.coords.w_rs&&(this.labels.p_min= +this.labels.w_min/this.coords.w_rs*100,this.labels.p_max=this.labels.w_max/this.coords.w_rs*100)},calcLabels:function(){this.coords.w_rs&&!this.options.hide_from_to&&("single"===this.options.type?(this.labels.w_single=this.$cache.single.outerWidth(!1),this.labels.p_single=this.labels.w_single/this.coords.w_rs*100,this.labels.p_single_left=this.coords.p_single+this.coords.p_handle/2-this.labels.p_single/2):(this.labels.w_from=this.$cache.from.outerWidth(!1),this.labels.p_from=this.labels.w_from/this.coords.w_rs* +100,this.labels.p_from_left=this.coords.p_from+this.coords.p_handle/2-this.labels.p_from/2,this.labels.p_from_left=this.toFixed(this.labels.p_from_left),this.labels.p_from_left=this.checkEdges(this.labels.p_from_left,this.labels.p_from),this.labels.w_to=this.$cache.to.outerWidth(!1),this.labels.p_to=this.labels.w_to/this.coords.w_rs*100,this.labels.p_to_left=this.coords.p_to+this.coords.p_handle/2-this.labels.p_to/2,this.labels.p_to_left=this.toFixed(this.labels.p_to_left),this.labels.p_to_left=this.checkEdges(this.labels.p_to_left, +this.labels.p_to),this.labels.w_single=this.$cache.single.outerWidth(!1),this.labels.p_single=this.labels.w_single/this.coords.w_rs*100,this.labels.p_single_left=(this.labels.p_from_left+this.labels.p_to_left+this.labels.p_to)/2-this.labels.p_single/2,this.labels.p_single_left=this.toFixed(this.labels.p_single_left)),this.labels.p_single_left=this.checkEdges(this.labels.p_single_left,this.labels.p_single))},updateScene:function(){this.drawHandles();this.raf_id=requestAnimationFrame(this.updateScene.bind(this))}, +drawHandles:function(){this.coords.w_rs=this.$cache.rs.outerWidth(!1);this.coords.w_rs!==this.coords.w_rs_old&&(this.target="base");if(this.coords.w_rs!==this.coords.w_rs_old||this.force_redraw)this.setMinMax(),this.calc(!0),this.drawLabels(),this.options.grid&&(this.calcGridMargin(),this.calcGridLabels()),this.force_redraw=!0,this.coords.w_rs_old=this.coords.w_rs,this.drawShadow();if(this.coords.w_rs&&(this.dragging||this.force_redraw||this.is_key)){if(this.old_from!==this.result.from||this.old_to!== +this.result.to||this.force_redraw||this.is_key){this.drawLabels();this.$cache.bar[0].style.left=this.coords.p_bar_x+"%";this.$cache.bar[0].style.width=this.coords.p_bar_w+"%";if("single"===this.options.type)this.$cache.s_single[0].style.left=this.coords.p_single+"%",this.$cache.single[0].style.left=this.labels.p_single_left+"%",this.options.values.length?(this.$cache.input.prop("value",this.result.from_value),this.$cache.input.data("from",this.result.from_value)):(this.$cache.input.prop("value",this.result.from), +this.$cache.input.data("from",this.result.from));else{this.$cache.s_from[0].style.left=this.coords.p_from+"%";this.$cache.s_to[0].style.left=this.coords.p_to+"%";if(this.old_from!==this.result.from||this.force_redraw)this.$cache.from[0].style.left=this.labels.p_from_left+"%";if(this.old_to!==this.result.to||this.force_redraw)this.$cache.to[0].style.left=this.labels.p_to_left+"%";this.$cache.single[0].style.left=this.labels.p_single_left+"%";this.options.values.length?(this.$cache.input.prop("value", +this.result.from_value+";"+this.result.to_value),this.$cache.input.data("from",this.result.from_value),this.$cache.input.data("to",this.result.to_value)):(this.$cache.input.prop("value",this.result.from+";"+this.result.to),this.$cache.input.data("from",this.result.from),this.$cache.input.data("to",this.result.to))}this.$cache.input.trigger("change");this.old_from=this.result.from;this.old_to=this.result.to;if(this.options.onChange&&"function"===typeof this.options.onChange&&!this.is_update&&!this.is_start)this.options.onChange(this.result); +this.is_update=!1}this.force_redraw=this.is_key=this.is_start=!1}},drawLabels:function(){var a=this.options.values.length,b=this.options.p_values,c;if(!this.options.hide_from_to)if("single"===this.options.type)a=a?this.decorate(b[this.result.from]):this.decorate(this._prettify(this.result.from),this.result.from),this.$cache.single.html(a),this.calcLabels(),this.$cache.min[0].style.visibility=this.labels.p_single_left100-this.labels.p_max-1?"hidden":"visible";else{a?(this.options.decorate_both?(a=this.decorate(b[this.result.from]),a+=this.options.values_separator,a+=this.decorate(b[this.result.to])):a=this.decorate(b[this.result.from]+this.options.values_separator+b[this.result.to]),c=this.decorate(b[this.result.from]),b=this.decorate(b[this.result.to])):(this.options.decorate_both?(a=this.decorate(this._prettify(this.result.from)),a+=this.options.values_separator,a+=this.decorate(this._prettify(this.result.to))): +a=this.decorate(this._prettify(this.result.from)+this.options.values_separator+this._prettify(this.result.to),this.result.from),c=this.decorate(this._prettify(this.result.from),this.result.from),b=this.decorate(this._prettify(this.result.to),this.result.to));this.$cache.single.html(a);this.$cache.from.html(c);this.$cache.to.html(b);this.calcLabels();b=Math.min(this.labels.p_single_left,this.labels.p_from_left);a=this.labels.p_single_left+this.labels.p_single;c=this.labels.p_to_left+this.labels.p_to; +var d=Math.max(a,c);this.labels.p_from_left+this.labels.p_from>=this.labels.p_to_left?(this.$cache.from[0].style.visibility="hidden",this.$cache.to[0].style.visibility="hidden",this.$cache.single[0].style.visibility="visible",this.result.from===this.result.to?(this.$cache.from[0].style.visibility="visible",this.$cache.single[0].style.visibility="hidden",d=c):(this.$cache.from[0].style.visibility="hidden",this.$cache.single[0].style.visibility="visible",d=Math.max(a,c))):(this.$cache.from[0].style.visibility= +"visible",this.$cache.to[0].style.visibility="visible",this.$cache.single[0].style.visibility="hidden");this.$cache.min[0].style.visibility=b100-this.labels.p_max-1?"hidden":"visible"}},drawShadow:function(){var a=this.options,b=this.$cache,c,d;"single"===a.type?a.from_shadow&&(a.from_min||a.from_max)?(c=this.calcPercent(a.from_min||a.min),d=this.calcPercent(a.from_max||a.max)-c,c=this.toFixed(c-this.coords.p_handle/100* +c),d=this.toFixed(d-this.coords.p_handle/100*d),c+=this.coords.p_handle/2,b.shad_single[0].style.display="block",b.shad_single[0].style.left=c+"%",b.shad_single[0].style.width=d+"%"):b.shad_single[0].style.display="none":(a.from_shadow&&(a.from_min||a.from_max)?(c=this.calcPercent(a.from_min||a.min),d=this.calcPercent(a.from_max||a.max)-c,c=this.toFixed(c-this.coords.p_handle/100*c),d=this.toFixed(d-this.coords.p_handle/100*d),c+=this.coords.p_handle/2,b.shad_from[0].style.display="block",b.shad_from[0].style.left= +c+"%",b.shad_from[0].style.width=d+"%"):b.shad_from[0].style.display="none",a.to_shadow&&(a.to_min||a.to_max)?(c=this.calcPercent(a.to_min||a.min),a=this.calcPercent(a.to_max||a.max)-c,c=this.toFixed(c-this.coords.p_handle/100*c),a=this.toFixed(a-this.coords.p_handle/100*a),c+=this.coords.p_handle/2,b.shad_to[0].style.display="block",b.shad_to[0].style.left=c+"%",b.shad_to[0].style.width=a+"%"):b.shad_to[0].style.display="none")},toggleInput:function(){this.$cache.input.toggleClass("irs-hidden-input")}, +calcPercent:function(a){return this.toFixed((a-this.options.min)/((this.options.max-this.options.min)/100))},calcReal:function(a){var b=this.options.min,c=this.options.max,d=0;0>b&&(d=Math.abs(b),b+=d,c+=d);a=(c-b)/100*a+b;(b=this.options.step.toString().split(".")[1])?a=+a.toFixed(b.length):(a/=this.options.step,a*=this.options.step,a=+a.toFixed(0));d&&(a-=d);athis.options.max&&(a=this.options.max);return b?+a.toFixed(b.length):this.toFixed(a)},calcWithStep:function(a){var b= +Math.round(a/this.coords.p_step)*this.coords.p_step;100c&&(a=c);return this.calcPercent(a)},toFixed:function(a){a=a.toFixed(5);return+a},_prettify:function(a){return this.options.prettify_enabled?this.options.prettify&&"function"===typeof this.options.prettify?this.options.prettify(a):this.prettify(a):a},prettify:function(a){return a.toString().replace(/(\d{1,3}(?=(?:\d\d\d)+(?!\d)))/g, +"$1"+this.options.prettify_separator)},checkEdges:function(a,b){if(!this.options.force_edges)return this.toFixed(a);0>a?a=0:a>100-b&&(a=100-b);return this.toFixed(a)},validate:function(){var a=this.options,b=this.result,c=a.values,d=a.p_values,e=c.length,g,h;a.max<=a.min&&(a.max=a.min?2*a.min:a.min+1,a.step=1);if(e)for(a.min=0,a.max=e-1,a.step=1,a.grid_num=a.max,a.grid_snap=!0,h=0;ha.max)a.from=a.min;if(a.to>a.max||a.toa.to&&(a.from=a.to);if("number"!==typeof a.step||isNaN(a.step)||!a.step||0>a.step)a.step=1;if("number"!==typeof a.keyboard_step||isNaN(a.keyboard_step)||!a.keyboard_step||0>a.keyboard_step)a.keyboard_step=5;a.from_min&&a.froma.from_max&&(a.from=a.from_max);a.to_min&&a.toa.to_max&&(a.to=a.to_max);if(b){b.min!==a.min&&(b.min=a.min);b.max!==a.max&&(b.max=a.max);if(b.fromb.max)b.from=a.from;if(b.tob.max)b.to=a.to}},decorate:function(a,b){var c="",d=this.options;d.prefix&&(c+=d.prefix);c+=a;d.max_postfix&&(d.values.length&&a===d.p_values[d.max]?(c+=d.max_postfix,d.postfix&&(c+=" ")):b===d.max&&(c+=d.max_postfix,d.postfix&&(c+=" ")));d.postfix&&(c+=d.postfix);return c},updateFrom:function(){this.result.from=this.options.from;this.result.from_percent= +this.calcPercent(this.result.from);this.options.values&&(this.result.from_value=this.options.values[this.result.from])},updateTo:function(){this.result.to=this.options.to;this.result.to_percent=this.calcPercent(this.result.to);this.options.values&&(this.result.to_value=this.options.values[this.result.to])},updateResult:function(a){this.result.min=this.options.min;this.result.max=this.options.max;a?(a.from&&this.updateFrom(),a.to&&this.updateTo()):(this.updateFrom(),this.updateTo())},appendGrid:function(){if(this.options.grid){var a= +this.options,b,c;b=a.max-a.min;var d=a.grid_num,e=0,g=0,h=4,f,k,l=0,m="";this.calcGridMargin();a.grid_snap?(d=b/a.step,e=this.toFixed(a.step/(b/100))):e=this.toFixed(100/d);4f&&(f=0));this.coords.big[b]=g;k=(g-e*(b-1))/(f+1);for(c=1;c<=f&&0!==g;c++)l=this.toFixed(g-k*c),m+='';m+=''; +l=this.calcReal(g);l=a.values.length?a.p_values[l]:this._prettify(l);m+=''+l+""}this.coords.big_num=Math.ceil(d+1);this.$cache.cont.addClass("irs-with-grid");this.$cache.grid.html(m);this.cacheGridLabels()}},cacheGridLabels:function(){var a,b,c=this.coords.big_num;for(b=0;b100-this.coords.grid_gap&&(c[d-1]=100-this.coords.grid_gap,b[d-1]=this.toFixed(c[d-1]-this.coords.big_p[d-1]),this.coords.big_x[d-1]=this.toFixed(this.coords.big_p[d-1]-this.coords.grid_gap)));this.calcGridCollision(2,b,c);this.calcGridCollision(4,b,c);for(a=0;a=f)break;g=this.$cache.grid_labels[e][0];g.style.visibility= +c[d]<=b[e]?"visible":"hidden"}},calcGridMargin:function(){this.options.grid_margin&&(this.coords.w_rs=this.$cache.rs.outerWidth(!1),this.coords.w_rs&&(this.coords.w_handle="single"===this.options.type?this.$cache.s_single.outerWidth(!1):this.$cache.s_from.outerWidth(!1),this.coords.p_handle=this.toFixed(this.coords.w_handle/this.coords.w_rs*100),this.coords.grid_gap=this.toFixed(this.coords.p_handle/2-.1),this.$cache.grid[0].style.width=this.toFixed(100-this.coords.p_handle)+"%",this.$cache.grid[0].style.left= +this.coords.grid_gap+"%"))},update:function(a){this.is_update=!0;this.options=e.extend(this.options,a);this.validate();this.updateResult(a);this.toggleInput();this.remove();this.init(!0)},reset:function(){this.updateResult();this.update()},destroy:function(){this.toggleInput();e.data(this.input,"ionRangeSlider",null);this.remove();this.options=this.input=null}};e.fn.ionRangeSlider=function(a){return this.each(function(){e.data(this,"ionRangeSlider")||e.data(this,"ionRangeSlider",new q(this,a,s++))})}; +(function(){for(var a=0,b=["ms","moz","webkit","o"],c=0;c", + "homepage": "http://ionden.com/a/plugins/ion.rangeSlider/en.html", + "repository": { + "type": "git", + "url": "https://github.com/IonDen/ion.rangeSlider" + }, + "bugs": { + "url": "https://github.com/IonDen/ion.rangeSlider/issues" + }, + "license": "MIT", + + "spm": { + "main": "js/ion.rangeSlider.js" + } +} \ No newline at end of file diff --git a/readme.md b/readme.md index 668b4b8..37eac34 100644 --- a/readme.md +++ b/readme.md @@ -1,12 +1,10 @@ -_Hello, developers. Version 2.0 is coming soon. Please don't do any pull requests until 2.0 release._ - -# Ion.Range Slider 1.9.3 +# Ion.Range Slider 2.0.0 > English description | Описание на русском -Easy and light range slider Project page and demos - -Download: ion.rangeSlider-1.9.3.zip +Easy and light range slider +* Project page and demos +* Download ion.rangeSlider-2.0.0.zip *** @@ -16,27 +14,41 @@ Download: MIT licence. +* With this plugin you will be able to build beautiful range sliders, like this: + +![ion.rangeSlider](http://ionden.com/a/plugins/ion.rangeSlider/static/img/ion-range-slider.png) ## Key features -* Skin support. (3 skins included and PSD for skin creation) +* Skin support. (5 skins included and PSD for skin creation) * Any number of sliders at one page without conflicts and big performance problems * Two slider types single (1 slider) and double (2 sliders) * Support of negative and fractional values -* Ability to edit step -* Support of custom values diapason (See months example) -* Automatically generated grid +* Ability to set custom step and snap grid to step +* Support of custom values diapason +* Customisable grid of values * Ability to disable UI elements (min and max, current value, grid) * Postfixes and prefixes for you numbers ($20, 20 € etc.) * Additional postfix for maximum value (eg. $0 — $100+) -* Ability to prettify large numbers (eg. 10000000 -> 10 000 000) +* Ability to prettify large numbers (eg. 10000000 -> 10 000 000 or 10.000.000) * Slider writes it's value right into input value field. This makes it easy to use in any html form * Any slider value can be set through input data-attribute (eg. data-min="10") * Slider supports disable param. You can set it true to make slider inactive -* Slider supports external methods (update and remove) to control it after creation -* For advanced users slider has callbacks (onLoad, onChange, onFinish). Slider paste all it's params to callback first argument as object +* Slider supports external methods (update, reset and remove) to control it after creation +* For advanced users slider has callbacks (onStart, onChange, onFinish, onUpdate). Slider paste all it's params to callback first argument as object +* Slider supports date and time + + +## Demos + +* Basic demo +* Advanced demo +* Interactions demo + ## Dependencies -* jQuery 1.9+ + +* jQuery 1.8.x+ + ## Usage @@ -45,18 +57,19 @@ Add the following libraries to the page: * ion.rangeSlider.min.js Add the following stylesheets to the page: -* normalize.min.css (If not already present) +* normalize.css (optional) * ion.rangeSlider.css -Plus, a skin for the slider. Two skins are included: -* ion.rangeSlider.skinNice.css -* ion.rangeSlider.skinSimple.css +Plus, a skin for the slider. 5 skins are included. Choose one: +* ion.rangeSlider.skinFlat.css + sprite-skin-flat.png +* ion.rangeSlider.skinHTML5.css + no images +* ion.rangeSlider.skinModern.css + sprite-skin-modern.png +* ion.rangeSlider.skinNice.css + sprite-skin-nice.png +* ion.rangeSlider.skinSimple.css + sprite-skin-simple.png -Don't forget about skin image sprite: -* sprite-skin-simple.png - Simple skin -* sprite-skin-nice.png - Nice skin Or use the included PSD file and design a custom skin. + ## Install with bower * bower install ionrangeslider @@ -75,217 +88,364 @@ $("#example_id").ionRangeSlider(); ``` +## Demo for juniors + +If your are new person in web development and you are not sure how to correctly install the plugin to your web-page, please download +this demo example + + +## Migrating from 1.x to 2.x +* All params (except functions) are lowercase now: param_name, not paramName +* Same param names was changed: hasGrid → grid, onLoad → onStart +* Callbacks data object format was changed. Example: fromNumber → from +* Slider now writes it's result to value attribute and also to data-from and data-to attributes + + +## Experiments playground + + ## Settings - - + + + - - + + - + + + - + - + + - + - + + - + - + + - + - + + - - + + - + + - - - - + + + + + + - - - - + + + + + + - - - - + + + + + - - + + + + + + + + - + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + - + - + + - + - + + - - + + + + + + + + - + + + - - - + + + + + + + + + + - -
PropertyDefaultOptionDefaultsType Description
type
type
data-type
"single"Optional property, will select slider type from two options: single - for single range slider, or double - for double range sliderstringChoose slider type, could be single - for one handle, or double four two handles
minmin
data-min
10Optional property, automatically set from the value attribute of base input. For example: if value="10;100", it will be 10numberSet slider minimum value
maxmax
data-max
100Optional property, automatically set from the value attribute of base input. For example: if value="10;100", it will be 100numberSet slider maximum value
fromfrom
data-from
minOptional property, on default has the same value as min. overwrite default FROM settingnumberSet start position for left handle (or for single handle)
toto
data-to
maxOptional property, on default has the same value as max. overwrite default TO settingnumberSet start position for right handle
step
step
data-step
1Optional property, set slider step valuenumberSet sliders step. Always > 0. Could be fractional.
prefix-Optional property, set prefix text to all values. For example: "$" will convert "100" in to "$100"
values
data-values
[]arraySet up your own array of possible slider values. They could be numbers or strings. If the values array is set up, min, max and step param, are no longer can be changed.
postfix-Optional property, set postfix text to all values. For example: " €" will convert "100" in to "100 €"
from_fixed
data-from-fixed
falsebooleanFix position of left (or single) handle.
maxPostfix-Optional property, set postfix text to maximum value. For example: maxPostfix - "+" will convert "100" to "100+"
from_min
data-from-min
minnumberSet minimum limit for left handle.
hasGrid
from_max
data-from-max
maxnumberSet the maximum limit for left handle
from_shadow
data-from-shadow
falseOptional property, enables grid at the bottom of the slider (it adds 20px height and this can be customised through CSS)booleanHighlight the limits for left handle
gridMargin0Optional property, enables margin between slider corner and grid
to_fixed
data-to-fixed
falsebooleanFix position of right handle.
to_min
data-to-min
minnumberSet the minimum limit for right handle
to_max
data-to-max
maxnumberSet the maximum limit for right handle
to_shadow
data-to-shadow
falsebooleanHighlight the limits for right handle
hideMinMaxprettify_enabled
data-prettify-enabled
truebooleanImprove readability of long numbers. 10000000 → 10 000 000
prettify_separator
data-prettify-separator
" "stringSet up your own separator for long numbers. 10 000, 10.000, 10-000 и т.п.
prettify
nullfunctionSet up your own prettify function. Can be anything. For example, you can set up unix time as slider values and than transform them to cool looking dates.
force_edges
data-force-edges
falsebooleanSlider will be always inside it's container.
keyboard
data-keyboard
falseOptional property, disables Min and Max fields.booleanActivates keyboard controls. Move left: ←, ↓, A, S. Move right: →, ↑, W, D.
keyboard_step
data-keyboard-step
5numberMovement step, than controling from keyboard. In percents.
hideFromTogrid
data-grid
falseOptional property, disables From an To fields.booleanEnables grid of values.
prettifygrid_margin
data-grid-margin
trueOptional property, allow to separate large numbers with spaces, eg. 10 000 than 10000booleanSet left and right grid borders.
disable
grid_num
data-grid-num
4numberNumber of grid units.
grid_snap
data-grid-snap
falseDisables the sliderbooleanSnap grid to sliders step (step param). If activated, grid_num will not be used.
valuesnullArray of custom values: [a, b, c] etc.hide_min_max
data-hide-min-max
falsebooleanHides min and max labels
hide_from_to
data-hide-from-to
falsebooleanHide from and to lables
+ + prefix
data-prefix
+ — + string + Set prefix for values. Will be set up right before the number: $100 + + + postfix
data-postfix
+ — + string + Set postfix for values. Will be set up right after the number: 100k + + + max_postfix
data-max-postfix
+ — + string + Special postfix, used only for maximum value. Will be showed after handle will reach maximum right position. For example 0 — 100+ + + + decorate_both
data-decorate-both
+ true + boolean + Used for "double" type and only if prefix or postfix was set up. Determine how to decorate close values. For example: $10k — $100k or $10 — 100k + + + values_separator
data-values-separator
+ " — " + string + Set your own separator for close values. Used for "double" type. Default: 10 — 100. Or you may set: 10 to 100, 10 + 100, 10 → 100 etc. + -## Callbacks + + disable
data-disable
+ false + boolean + Locks slider and makes it inactive. + - - - - - + + + + - - - - - + + + + - - - + + + + - - - - + + + + +
PropertyDefaultDescriptiononStart
nullfunctionCallback. Is called on slider start.
onLoad-Triggered once, after slider loaded and each time after slider updated via method Update.onChange
nullfunctionCallback. IS called on each values change.
onChange-Triggered live as the slider value is changed. Returns object with all slider valuesonFinish
nullfunctionCallback. Is called than user releases handle.
onFinish-Triggered once, after slider work is done. Returns object with all slider values
onUpdate
nullfunctionCallback. Is called than slider is modified by external methods update or reset.
-## Description of data passed to callbacks -Each callback have object with slider data as a first argument: +## Description of data passed to callbacks (onChange and etc.) +Result is object type and passed to callback as first argument: ```javascript Obj: { "input": object, // jQuery-link to input - "slider": object, // jQuery-link to slider container - "min": 10, // MIN value - "max": 20, // MAX value - "fromNumber": 10, // FROM value - "toNumber": 20, // TO value - "fromPers": 25, // FROM value in percents - "toPers": 75, // TO value in percents - "fromX": 100, // x-coordinate of FROM-slider in pixels - "toX": 200 // x-coordinate of TO-slider in pixels + "slider": object, // jQuery-link to sliders container + "min": 0, // MIN value + "max": 1000, // MAX values + "from": 100, // FROM value + "from_percent": 10, // FROM value in percents + "from_value": 0, // FROM index in values array (if used) + "to": 900, // TO value + "to_percent": 90, // TO value in percents + "to_value": 0 // TO index in values array (if used) } ``` ## Creating slider (all params) An example of a customised slider: ```javascript -$("#someID").ionRangeSlider({ - min: 10, // min value - max: 100, // max value - from: 30, // overwrite default FROM setting - to: 80, // overwrite default TO setting - type: "single", // slider type - step: 10, // slider step - prefix: "$", // prefix value - postfix: " €", // postfix value - maxPostfix: "+", // postfix to maximum value - hasGrid: true, // enable grid - gridMargin: 7, // margin between slider corner and grid - hideMinMax: true, // hide Min and Max fields - hideFromTo: true, // hide From and To fields - prettify: true, // separate large numbers with space, eg. 10 000 - disable: false, // disable slider - values: ["a", "b", "c"], // array of custom values - onLoad: function (obj) { // callback is called after slider load and update - console.log(obj); - }, - onChange: function (obj) { // callback is called on every slider change - console.log(obj); - }, - onFinish: function (obj) { // callback is called on slider action is finished - console.log(obj); - } +$("#example").ionRangeSlider({ + min: 0, + max: 10000, + from: 1000, + to: 9000, + type: 'double', + prefix: "$", + grid: true, + grid_num: 10 }); ``` You can also initialise slider with data-* attributes of input tag: ```html -data-from="30" // default FROM setting -data-to="70" // default TO setting -data-type="double" // slider type -data-step="10" // slider step -data-prefix="$" // prefix value -data-postfix=" €" // postfix value -data-maxpostfix="+" // postfix to maximum value -data-hasgrid="true" // enable grid -data-gridmargin="7" // set grid margin -data-hideminmax="true" // hide Min and Max fields -data-hidefromto="true" // hide From and To fields -data-prettify="false" // don't use spaces in large numbers, eg. 10000 than 10 000 -data-values="a,b,c" // comma separated predefined slider values +data-min="0" +data-max="10000" +data-from="1000" +data-to="9000" +data-type="double" +data-prefix="$" +data-grid="true" +data-grid-num="10" ``` ## Public methods -Slider update, method update: +To use public methods, at first you must save slider instance to variable: ```javascript -$("#someID").ionRangeSlider("update", { - min: 20, // change min value - max: 90, // change max value - from: 40, // change default FROM setting - to: 70, // change default TO setting - step: 5 // change slider step +// Launch plugin +$("#range").ionRangeSlider({ + type: "double", + min: 0, + max: 1000, + from: 200, + to: 500, + grid: true }); + +// Saving it's instance to var +var slider = $("#range").data("ionRangeSlider"); + +// Fire public method +slider.reset(); ``` -Slider remove, method remove: +There are 3 public methods: ```javascript -$("#someID").ionRangeSlider("remove"); +// UPDATE - updates slider to any new values +slider.update({ + from: 300, + to: 400 +}); + +// RESET - reset slider to it's first values +slider.reset(); + +// DESTROY - destroys slider and restores original input field +slider.destroy(); ``` +## One more look on demos + +* Basic demo +* Advanced demo +* Interactions demo + +All plugins options are covered in demos. + + ## Update history +* 2.0.0: November 08, 2014 - New API, lot's of bug fixes and improvements. * 1.9.3: August 06, 2014 - Bower support added * 1.9.2: August 04, 2014 - New param gridMargin. Resolved some issues: #89, #94, #96, #97, #98, #103 * 1.9.1: April 15, 2014 - Fixed some bugs: #81, #82, #85 @@ -303,4 +463,4 @@ $("#someID").ionRangeSlider("remove"); * June 06, 2013 - new public methods and some code optimisations * June 06, 2013 - some small css updates * April 30, 2013 - new method onFinish -* February 15, 2013 - new feature to set slider settings through data-* attributes of input tag +* February 15, 2013 - new feature to set slider settings through data-* attributes of input tag \ No newline at end of file diff --git a/readme.ru.md b/readme.ru.md index eafa0b2..ed74521 100644 --- a/readme.ru.md +++ b/readme.ru.md @@ -1,10 +1,10 @@ -# Ion.Range Slider 1.9.3 +# Ion.Range Slider 2.0.0 > English description | Описание на русском -Удобный легкий слайдер диапазонов. Страница проекта и демо - -Скачать: ion.rangeSlider-1.9.3.zip +Удобный легкий слайдер диапазонов +* Страница проекта и демо +* Download ion.rangeSlider-2.0.0.zip *** @@ -15,27 +15,40 @@ * Плагин поддерживает устройства с touch-экраном (iPhone, iPad, Nexus, etc.) * Репозиторий на GitHub * Плагин свободно распространяется на условиях лицензии MIT +* Используюя этот плагин, вы сможете создавать крутейшие слайдеры диапазонов, такие как этот: + +![ion.rangeSlider](http://ionden.com/a/plugins/ion.rangeSlider/static/img/ion-range-slider.png) ## Ключевые особенности -* Поддержка скинов. (3 скина в комплекте и PSD для изготовления собственных) +* Поддержка скинов. (5 скина в комплекте и PSD для изготовления собственных) * Неограниченное кол-во слайдеров на одной странице без существенных потерь производительности и конфликтов между ними * Два режима работы с 1 или 2 ползунками * Поддержка отрицательных и дробных значений -* Возможность редактировать шаг -* Поддержка собственного диапазона значений (см. пример с месяцами) -* Автоматически генерируемая сетка +* Возможность редактировать шаг и привязывать сетку к шагу +* Можно использовать собственный массив значений для слайдера +* Настраиваемая сетка значений * Отключаемые элементы интерфейса (мин. и макс. значение, текущие значение, сетка) * Постфиксы и префиксы для указания единиц измерения ($20, 20 € и т.п.) * Дополнительный постфикс для максимального значения (например $0 — $100+) -* Воможнось улучшить читабельность больших цифр (например 10000000 -> 10 000 000) +* Воможнось улучшить читабельность больших цифр (например 10000000 -> 10 000 000 или 10.000.000) * Слайдер пишет свое значение прямо в value исходного поля input, что позволяет вставить сладер прямо внутрь любой формы * Любой параметр слайдера можно так же задать через data-атрибут (например data-min="10") * Слайдер поддерживает параметр disabled, позволяет делать слайдер неактивным -* Слайдер поддерживает внешние методы (update и remove), позволяющие управлять слайдером уже после создания -* Для продвинутых пользователей есть поддержка функций обратного вызова (onLoad, onChange, onFinish). Слайдер передает свои значения в эти функции первым аргументом в виде объекта +* Слайдер поддерживает внешние методы (update, reset и remove), позволяющие управлять слайдером уже после создания +* Для продвинутых пользователей есть поддержка колбэков (onStart, onChange, onFinish, onUpdate). Слайдер передает свои значения в эти функции первым аргументом в виде объекта +* Слайдер поддерживает работу с датой и временем + + +## Демо + +* Базовые настройки +* Расширенные настройки +* Взаимодействия + ## Зависимости -* jQuery 1.9+ + +* jQuery 1.8.x+ ## Использование @@ -45,16 +58,16 @@ * ion.rangeSlider.min.js Подключаем стили: -* normalize.min.css (желательно, если он у вас еще не подключен) +* normalize.css (желательно, если он у вас еще не подключен) * ion.rangeSlider.css -Не забываем про скин. 2 скина включены в архив: -* ion.rangeSlider.skinNice.css -* ion.rangeSlider.skinSimple.css - -Не забудьте подключить картинку-спрайт скина: -* sprite-skin-simple.png - простецкий скин -* sprite-skin-nice.png - приличный скин +Не забываем про скин. 5 скинов включены в архив. Выберите один: +* ion.rangeSlider.skinFlat.css + sprite-skin-flat.png +* ion.rangeSlider.skinHTML5.css + без картинок +* ion.rangeSlider.skinModern.css + sprite-skin-modern.png +* ion.rangeSlider.skinNice.css + sprite-skin-nice.png +* ion.rangeSlider.skinSimple.css + sprite-skin-simple.png + Либо воспользуйтесь вложенным в архив PSD файлом, и нарисуйте собственный скин (не забудьте модифицировать размеры элементов в CSS файле) @@ -67,7 +80,7 @@ Создаем базовое поле input type="text": ```html - + ``` Чтобы запустить слайдер, вызовите ionRangeSlider для нужного элемента: @@ -75,6 +88,21 @@ $("#example_id").ionRangeSlider(); ``` +## Демо для новичков +Если вы новичок в веб разработке и не уверены как правильно подключить этот плагин на вашу страницу, то скачайте вот +этот демо пример + + +## Миграция с версии 1.x на 2.x +* Все параметры (кроме функций) теперь записываются так: param_name, а не paramName +* Изменились названия некоторых параметров: hasGrid → grid, onLoad → onStart +* Изменился формат объекта с данными слайдера, возвращаемый в колбэки. Например: fromNumber → from +* Слайдер теперь постоянно записывает свои значения в поле value и в атрибуты data-from и data-to + + +## Площадка для эксперементов с плагином + + ## Настройка @@ -82,210 +110,342 @@ $("#example_id").ionRangeSlider(); + - - + + - + + + - + - + + - + - + + - + - + + - + - + + - - + + - + + - - - - + + + + + + - - - - + + + + + + - - - - + + + + + - - + + + + + + + + - + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + - + - + + - + - + + - - + + + + + + + + - + + + - - - + + + + + + + + + + - -
Атрибут По умолчаниюТип Описание
type
type
data-type
"single"Не обязательный параметр, позволяет выбрать тип слайдера, может принимать значение single - для одиночного слайдера или double - для двойного слайдераstringПозволяет выбрать тип слайдера, может принимать значение single - для одиночного слайдера или double - для двойного слайдера
minmin
data-min
10Не обязательный параметр, автоматически устанавливается из атрибута value базового поля input. Например если value="10;100", то примет значение 10numberОбозначает минимальное возможное значение слайдера.
maxmax
data-max
100Не обязательный параметр, автоматически устанавливается из атрибута value базового поля input. Например если value="10;100", то примет значение 100numberОбозначает максимальное возможное значение слайдера.
fromfrom
data-from
minНе обязательный параметр, по умолчанию равен значению min. Позволяет задать стартовую позицию слайдера "ОТ"numberПозволяет задать стартовую позицию левого ползунка (или единственного ползунка)
toto
data-to
maxНе обязательный параметр, по умолчанию равен значению max. Позволяет задать стартовую позицию слайдера "ДО"numberПозволяет задать стартовую позицию правого ползунка
step
step
data-step
1Не обязательный параметр, задает шаг слайдераnumberЗадает шаг движения ползунков. Всегда больше нуля. Может быть дробным.
prefix-Не обязательный параметр, добавляет текст до всех значений. Например prefix - "$" модифицирует значение "100" в "$100"
values
data-values
[]arrayПереопределяет значения слайдера, значениями взятыми из массива values. Параметры min, max, step переопределяются автоматически.
postfix-Не обязательный параметр, добавляет текст после всех значений. Например postfix - " €" модифицирует значение "100" в "100 €"
from_fixed
data-from-fixed
falsebooleanФиксирует позицию левого ползунка (или единственного ползунка).
maxPostfix-Не обязательный параметр, добавляет для максимального значения. Например maxPostfix - "+" модифицирует значение "100" в "100+"
from_min
data-from-min
minnumberОграничивает минимальную позицию левого ползунка.
hasGrid
from_max
data-from-max
maxnumberОграничивает максимальную позицию левого ползунка.
from_shadow
data-from-shadow
falseНе обязательный параметр, включает сетку ниже слайдера (высота увеличивается на 20px и это можно настроить через CSS)booleanПодсвечивает ограничения наложенные на левый ползунок.
gridMargin0Не обязательный параметр, устанавливает отсуп от края сетки до края слайдера
to_fixed
data-to-fixed
falsebooleanФиксирует позицию правого ползунка.
to_min
data-to-min
minnumberОграничивает минимальную позицию правого ползунка.
to_max
data-to-max
maxnumberОграничивает максимальную позицию правого ползунка.
to_shadow
data-to-shadow
falsebooleanПодсвечивает ограничения наложенные на правый ползунок.
hideMinMaxprettify_enabled
data-prettify-enabled
truebooleanУлучшает внешний вид длинных цифр. 10000000 → 10 000 000
prettify_separator
data-prettify-separator
" "stringПозволяет выбирать разделитель для улучшения читаемости длинных цифр. 10 000, 10.000, 10-000 и т.п.
prettify
nullfunctionСобственная функция для постобработки значений слайдера. Позволяет делать с цифрами всё что угодно, например приобразовывать в даты и время.
force_edges
data-force-edges
falseНе обязательный параметр, отключает поля Min и MaxbooleanЗаставляет слайдер всегда оставаться внутри границ своего контейнера.
keyboard
data-keyboard
falsebooleanАктивирует управление слайдером с помощью клавиатуры. Влево: &larr, &darr, A, S. Вправо: &rarr, &uarr, W, D.
keyboard_step
data-keyboard-step
5numberШаг движения ползунка при управлении с клавиатуры. Задается в процентах.
hideFromTogrid
data-grid
falseНе обязательный параметр, отключает поля From и TobooleanВключает отображение сетки значений.
prettifygrid_margin
data-grid-margin
trueНе обязательный параметр, позволяет разделять длинные цифры пробелами, например 10 000 вместо 10000booleanВыравнивает сетку по крайним позициям ползунков, либо по границам контейнера.
disable
grid_num
data-grid-num
4numberКоличество ячеек в сетке.
grid_snap
data-grid-snap
falseВизуально отключает слайдерbooleanПривязка сетки к шагу слайдера (параметр step). Если активирован, то параметр grid_num не учитывается.
valuesnullМассив предустановленных значений: [a, b, c] и т.п.hide_min_max
data-hide-min-max
falsebooleanПрячет лейблы "min" и "max"
hide_from_to
data-hide-from-to
falsebooleanПрячет лейблы "from" и "to"
+ + prefix
data-prefix
+ — + string + Отобразить префикс для значений слайдера. Будет отображен перед цифрой, например $100. + + + postfix
data-postfix
+ — + string + Отобразить постфикс для значений слайдера. Будет отображен после цифры, например 100 руб. + + + max_postfix
data-max-postfix
+ — + string + Отобразить дополнительный постфикс для максимального значения слайдера. Будет отображен если один из ползунков достигнет крайнего правого значения. Например 0 — 100+ + + + decorate_both
data-decorate-both
+ true + boolean + Используется для типа "double", в случае если задан prefix и/или postfix. Определяет, как декорировать близко расположенные значения.
Например: $10k — $100k или же $10 — 100k + + + values_separator
data-values-separator
+ " — " + string + Разделитель для близко расположенных значений. Используется для типа "double". Например: 10 — 100, 10 to 100, 10 + 100, 10 → 100 и т.д. + -## Колбэки + + disable
data-disable
+ false + boolean + Блокирует слайдер, делает его не активным. + - - - - - + + + + - - - - - + + + + - - - + + + + - - - - + + + + +
АтрибутПо умолчаниюОписаниеonStart
nullfunctionКоллбэк. Вызывается при старте слайдера.
onLoad-Функция обратного вызова, вызывается один раз при инициализации слайдера или после обновления через метод UpdateonChange
nullfunctionКоллбэк. Вызывается каждый раз когда обновляются значения слайдера.
onChange-Callback функция, вызывается каждый раз при смене состояния слайдера, возвращает объект, содержащий параметры слайдераonFinish
nullfunctionКоллбэк. Вызывается когда пользователь заканчивает перемещать ползунок.
onFinish-Callback функция, вызывается один раз при смене состояния слайдера, когда работа слайдера завершена. Возвращает объект, содержащий параметры слайдера
onUpdate
nullfunctionКоллбэк. Вызывается когда слайдер обновляется методом update или reset.
-## Описание данных передаваемых в функцию обратного вызова: -В любую функцию обратного вызова передается объект с данными сладера: +## Описание данных передаваемых в колбэки (onChange и т.д): + +Результат имеет тип object и передается коллбэк первым аргументом: ```javascript Obj: { "input": object, // jQuery-ссылка на input "slider": object, // jQuery-ссылка на контейнер слайдера - "min": 10, // значение MIN - "max": 20, // значение MAX - "fromNumber": 10, // значение ОТ - "toNumber": 20, // значение ДО - "fromPers": 25, // значение ОТ в процентах - "toPers": 75, // значение ДО в процентах - "fromX": 100, // координата x ползунка-ОТ в пикселях - "toX": 200 // координата x ползунка-ДО в пикселях + "min": 0, // значение MIN + "max": 1000, // значение MAX + "from": 100, // значение ОТ + "from_percent": 10, // значение ОТ в процентах + "from_value": 0, // индекс ОТ массива values (если используется) + "to": 900, // значение ДО + "to_percent": 90, // значение ДО в процентах + "to_value": 0 // индекс ДО массива values (если используется) } ``` -## Создание слайдера (подробно) -Пример слайдера, запущенного с параметрами: +## Создание слайдера c параметрами + +Пример ```javascript -$("#someID").ionRangeSlider({ - min: 10, // минимальное значение - max: 100, // максимальное значение - from: 30, // предустановленное значение ОТ - to: 80, // предустановленное значение ДО - type: "single", // тип слайдера - step: 10, // шаг слайдера - prefix: "$", // префикс значение - postfix: " €", // постфикс значение - maxPostfix: "+", // постфикс для максимального значения - hasGrid: true, // показать сетку - gridMargin: 7, // отсуп от края сетки до края слайдера - hideMinMax: true, // спрятать поля Min и Max - hideFromTo: true, // спрятать поля From и To - prettify: true, // разделять цифры пробелами 10 000 - disable: false, // заблокировать слайдер - values: ["a", "b", "c"], // массив предустановленных значений - onLoad: function (obj) { // callback, вызывается при запуске и обновлении - console.log(obj); - }, - onChange: function (obj) { // callback, вызывается при каждом изменении состояния - console.log(obj); - }, - onFinish: function (obj) { // callback, вызывается один раз в конце использования - console.log(obj); - } +$("#example").ionRangeSlider({ + min: 0, + max: 10000, + from: 1000, + to: 9000, + type: 'double', + prefix: "$", + grid: true, + grid_num: 10 }); ``` Слайдер с параметрами можно также инициализировать используя атрибуты data-* у тэга input: ```html -data-from="30" // предустановленное значение ОТ -data-to="70" // предустановленное значение ДО -data-type="double" // тип слайдера -data-step="10" // шаг слайдера -data-prefix="$" // префикс значение -data-postfix=" €" // постфикс значение -data-maxpostfix="+" // постфикс значение для максимального числа -data-hasgrid="true" // показать сетку -data-gridmargin="7" // устанавливаем отступ сетки от края -data-hideminmax="true" // спрятать поля Min и Max -data-hidefromto="true" // спрятать поля From и To -data-prettify="false" // не разделять цифры пробелами 10000 вместо 10 000 -data-disable="true" // отключить слайдер -data-values="a,b,c" // предустановленные значения, элементы через запятую +data-min="0" +data-max="10000" +data-from="1000" +data-to="9000" +data-type="double" +data-prefix="$" +data-grid="true" +data-grid-num="10" ``` ## Публичные методы -Обновление слайдера, метод update: +Для того чтобы использовать публичные методы, вначале нужно записать значение слайдера в переменную:: ```javascript -$("#someID").ionRangeSlider("update", { - min: 20, // меняем минимальное значение - max: 90, // меняем максимальное значение - from: 40, // меняем предустановленное значение ОТ - to: 70, // меняем предустановленное значение ДО - step: 5 // меняем шаг слайдера +// Запускаем слайдер +$("#range").ionRangeSlider({ + type: "double", + min: 0, + max: 1000, + from: 200, + to: 500, + grid: true }); + +// Записываем инстанс в переменную +var slider = $("#range").data("ionRangeSlider"); + +// Запускаем публичный метод +slider.reset(); ``` -Удаление слайдера, метод remove: +Всего существует 3 публичных метода: ```javascript -$("#someID").ionRangeSlider("remove"); +// UPDATE - обновляет значения слайдера (можно менять любые значения) +slider.update({ + from: 300, + to: 400 +}); + +// RESET - сбрасывает слайдер к исходным значениям +slider.reset(); + +// DESTROY - убивает слайдер и восстанавливает исходный input +slider.destroy(); ``` +## Еще раз взглянем на демо + +* Базовые настройки +* Расширенные настройки +* Взаимодействия + +В демках есть примеры использования всех опций слайдера + + ## История обновлений +* 2.0.0: 08.11.2014 - Новый API. Внесено множество улучшений и исправлено множество багов. * 1.9.3: 06.08.2014 - Добавлена поддержка bower * 1.9.2: 04.08.2014 - Новый параметр gridMargin. Выполнены задачи: #89, #94, #96, #97, #98, #103 * 1.9.1: 15.04.2014 - Исправлено несколько багов. Задачи: #81, #82, #85