diff --git a/.travis.yml b/.travis.yml
index e934fd9..014123b 100755
--- a/.travis.yml
+++ b/.travis.yml
@@ -2,12 +2,25 @@ language: node_js
node_js:
- 0.10
-before_script:
+# Google Chrome
+#
+# https://github.com/travis-ci/travis-ci/issues/272#issuecomment-14402117
+# http://stackoverflow.com/questions/19255976/how-to-make-travis-execute-angular-tests-on-chrome-please-set-env-variable-chr
+#
+before_install:
+ - export CHROME_BIN=chromium-browser
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- npm install -g karma
- npm install -g bower
+ - npm install -g grunt-cli
+
+install:
+ - npm install
- bower install
+before_script:
+ - grunt
+
script:
- - karma start --no-auto-watch --single-run --reporters dots --browsers Firefox
\ No newline at end of file
+ - karma start --no-auto-watch --single-run --reporters dots
diff --git a/README.md b/README.md
index ab8aff1..5e1db9f 100755
--- a/README.md
+++ b/README.md
@@ -1,5 +1,11 @@
-# angular-slider [](http://travis-ci.org/Venturocket/angular-slider)
-Slider directive for AngularJS. https://venturocket.github.io/angular-slider
+## merged from CrossLead/angular-slider
+- Added touch event check in onMove() and onStart()
+
+## modified in fork
+- Single knob selection bar (SPAN.bar.unselected.low)
+
+# angular-slider [](https://travis-ci.org/JulianWielga/angular-slider)
+Slider directive for AngularJS. https://julianwielga.github.io/angular-slider
License: MIT
## Features
@@ -12,16 +18,16 @@ License: MIT
- Full touch event support
## Known Issues
-- When hidden during initialization (`display: none;`) the slider might not display correctly when shown. Issue `$scope.$broadcast('refreshSlider');`
-in a parent scope to tell the slider to update the DOM.
-- The `step` attribute conflicts with angular-foundation's `step` directive ([docs](http://madmimi.github.io/angular-foundation/#/tour)). To remedy this,
-use `step-width` instead (it's an alias of `step`). `step` will be deprecated in the next minor release, so if you want to do a bit of future proofing
+- When hidden during initialization (`display: none;`) the slider might not display correctly when shown. Issue `$scope.$broadcast('refreshSlider');`
+in a parent scope to tell the slider to update the DOM.
+- The `step` attribute conflicts with angular-foundation's `step` directive ([docs](http://madmimi.github.io/angular-foundation/#/tour)). To remedy this,
+use `step-width` instead (it's an alias of `step`). `step` will be deprecated in the next minor release, so if you want to do a bit of future proofing
you can start using `step-width` now and save yourself a bit of migration work later .
## Installation
```
-bower install venturocket-angular-slider
+bower install touk-angular-slider
```
## Usage
@@ -35,10 +41,10 @@ Add `
```
-And add `vr.directives.slider` as a dependency for your app:
+And add `touk.slider` as a dependency for your app:
```javascript
-angular.module('myApp', ['vr.directives.slider', ...]);
+angular.module('myApp', ['touk.slider', ...]);
```
**NOTE:** in IE10/11 an annoying tooltip will show up unless you add the following css:
@@ -152,7 +158,7 @@ As an attribute:
## Scaling
-You can supply any arbitrary scaling function (and its inverse) to the slider to suit your needs.
+You can supply any arbitrary scaling function (and its inverse) to the slider to suit your needs.
The inverse scaling function MUST be specified if a scaling function is specified (and vice versa).
The scaling/inverse function can be pretty much anything as long as they take a number as a parameter and return a number. Like this:
```javascript
diff --git a/bower.json b/bower.json
index 9393359..f05d46f 100755
--- a/bower.json
+++ b/bower.json
@@ -1,31 +1,29 @@
{
- "name": "angular-slider",
- "version": "0.3.2",
- "main": "./build/angular-slider.js",
- "ignore": [
- "**/.*",
- "node_modules",
- "components",
- "lib",
- "src",
- "test",
- ".g*",
- ".editorconfig",
- ".jshintrc",
- ".travis.yml",
- "Gruntfile.js",
- "karma.conf.js",
- "*.html"
- ],
- "dependencies": {
- "angular": "~1.2",
- "angular-touch": "~1.2"
- },
- "devDependencies": {
- "angular-mocks": "*",
- "angular-scenario": "*"
- },
- "resolutions": {
- "angular": "v1.2.16"
- }
+ "name": "touk-angular-slider",
+ "version": "0.3.3",
+ "main": "./build/touk-angular-slider.js",
+ "ignore": [
+ "**/.*",
+ "node_modules",
+ "components",
+ "lib",
+ "src",
+ "test",
+ ".g*",
+ ".editorconfig",
+ ".jshintrc",
+ ".travis.yml",
+ "Gruntfile.js",
+ "karma.conf.js",
+ "*.html"
+ ],
+ "dependencies": {
+ "angular": ">= 1.2 < 1.4",
+ "angular-touch": ">= 1.2 < 1.4"
+ },
+ "devDependencies": {
+ "angular-mocks": "*",
+ "angular-scenario": "*",
+ "jquery": ">= 2.1 < 2.2"
+ }
}
diff --git a/build/angular-slider.min.js b/build/angular-slider.min.js
deleted file mode 100644
index f253cc0..0000000
--- a/build/angular-slider.min.js
+++ /dev/null
@@ -1,6 +0,0 @@
-/*
- angular-slider v0.3.2
- (c) 2013-2014 Venturocket, Inc. http://github.com/Venturocket
- License: MIT
-*/
-window.AngularSlider=function(a,b,c){function d(a){n.cssText=a}function e(a,b){return typeof a===b}function f(){j.inputtypes=function(a){for(var d,e,f,g=0,h=a.length;h>g;g++)o.setAttribute("type",e=a[g]),d="text"!==o.type,d&&(o.value=p,o.style.cssText="position:absolute;visibility:hidden;",/^range$/.test(e)&&o.style.WebkitAppearance!==c?(k.appendChild(o),f=b.defaultView,d=f.getComputedStyle&&"textfield"!==f.getComputedStyle(o,null).WebkitAppearance&&0!==o.offsetHeight,k.removeChild(o)):/^(search|tel)$/.test(e)||(d=/^(url|email)$/.test(e)?o.checkValidity&&o.checkValidity()===!1:o.value!=p)),r[a[g]]=!!d;return r}("search tel url email datetime date month week time datetime-local number range color".split(" "))}var g,h,i="2.7.1",j={},k=b.documentElement,l="modernizr",m=b.createElement(l),n=m.style,o=b.createElement("input"),p=":)",q=({}.toString,{}),r={},s=[],t=s.slice,u={}.hasOwnProperty;h=e(u,"undefined")||e(u.call,"undefined")?function(a,b){return b in a&&e(a.constructor.prototype[b],"undefined")}:function(a,b){return u.call(a,b)},Function.prototype.bind||(Function.prototype.bind=function(a){var b=this;if("function"!=typeof b)throw new TypeError;var c=t.call(arguments,1),d=function(){if(this instanceof d){var e=function(){};e.prototype=b.prototype;var f=new e,g=b.apply(f,c.concat(t.call(arguments)));return Object(g)===g?g:f}return b.apply(a,c.concat(t.call(arguments)))};return d});for(var v in q)h(q,v)&&(g=v.toLowerCase(),j[g]=q[v](),s.push((j[g]?"":"no-")+g));return j.input||f(),j.addTest=function(a,b){if("object"==typeof a)for(var d in a)h(a,d)&&j.addTest(d,a[d]);else{if(a=a.toLowerCase(),j[a]!==c)return j;b="function"==typeof b?b():b,"undefined"!=typeof enableClasses&&enableClasses&&(k.className+=" "+(b?"":"no-")+a),j[a]=b}return j},d(""),m=o=null,j._version=i,j}(this,this.document),function(a,b,c){function d(a){return"[object Function]"==q.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=r.shift();s=1,a?a.t?o(function(){("c"==a.t?m.injectCss:m.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):s=0}function i(a,c,d,e,f,i,j){function k(b){if(!n&&g(l.readyState)&&(t.r=n=1,!s&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&o(function(){v.removeChild(l)},50);for(var d in A[c])A[c].hasOwnProperty(d)&&A[c][d].onload()}}var j=j||m.errorTimeout,l=b.createElement(a),n=0,q=0,t={t:d,s:c,e:f,a:i,x:j};1===A[c]&&(q=1,A[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,q)},r.splice(e,0,t),"img"!=a&&(q||2===A[c]?(v.insertBefore(l,u?null:p),o(k,j)):A[c].push(l))}function j(a,b,c,d,f){return s=0,b=b||"j",e(a)?i("c"==b?x:w,a,b,this.i++,c,d,f):(r.splice(this.i++,0,a),1==r.length&&h()),this}function k(){var a=m;return a.loader={load:j,i:0},a}var l,m,n=b.documentElement,o=a.setTimeout,p=b.getElementsByTagName("script")[0],q={}.toString,r=[],s=0,t="MozAppearance"in n.style,u=t&&!!b.createRange().compareNode,v=u?n:p.parentNode,n=a.opera&&"[object Opera]"==q.call(a.opera),n=!!b.attachEvent&&!n,w=t?"object":n?"script":"img",x=n?"script":w,y=Array.isArray||function(a){return"[object Array]"==q.call(a)},z=[],A={},B={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}};m=function(a){function b(a){var b,c,d,a=a.split("!"),e=z.length,f=a.pop(),g=a.length,f={url:f,origUrl:f,prefixes:a};for(c=0;g>c;c++)d=a[c].split("="),(b=B[d.shift()])&&(f=b(f,d));for(c=0;e>c;c++)f=z[c](f);return f}function g(a,e,f,g,h){var i=b(a),j=i.autoCallback;i.url.split(".").pop().split("?").shift(),i.bypass||(e&&(e=d(e)?e:e[a]||e[g]||e[a.split("/").pop().split("?")[0]]),i.instead?i.instead(a,e,f,g,h):(A[i.url]?i.noexec=!0:A[i.url]=1,f.load(i.url,i.forceCSS||!i.forceJS&&"css"==i.url.split(".").pop().split("?").shift()?"c":c,i.noexec,i.attrs,i.timeout),(d(e)||d(j))&&f.load(function(){k(),e&&e(i.origUrl,h,g),j&&j(i.origUrl,h,g),A[i.url]=2})))}function h(a,b){function c(a,c){if(a){if(e(a))c||(l=function(){var a=[].slice.call(arguments);m.apply(this,a),n()}),g(a,l,b,0,j);else if(Object(a)===a)for(i in h=function(){var b,c=0;for(b in a)a.hasOwnProperty(b)&&c++;return c}(),a)a.hasOwnProperty(i)&&(!c&&!--h&&(d(l)?l=function(){var a=[].slice.call(arguments);m.apply(this,a),n()}:l[i]=function(a){return function(){var b=[].slice.call(arguments);a&&a.apply(this,b),n()}}(m[i])),g(a[i],l,b,i,j))}else!c&&n()}var h,i,j=!!a.test,k=a.load||a.both,l=a.callback||f,m=l,n=a.complete||f;c(j?a.yep:a.nope,!!k),k&&c(k)}var i,j,l=this.yepnope.loader;if(e(a))g(a,0,l,0);else if(y(a))for(i=0;im(b)?m(a)-m(b)-k(b):m(b)-m(a)-k(a)}function o(a,b){return a.attr("ng-bind-template",b)}function p(a,b,c,d,e){(angular.isUndefined(b)||!b)&&(b=0),(angular.isUndefined(c)||!c||0==c)&&(c=1/Math.pow(10,b)),(angular.isUndefined(d)||!d)&&(d=0),(angular.isUndefined(a)||!a)&&(a=0);var f=(a-d)%c,g=f>c/2?a+c-f:a-f;return(angular.isUndefined(e)||!e)&&(e=g),g=Math.min(Math.max(g,d),e),parseFloat(g.toFixed(b))}function q(a,b){return Math.floor(a/b+.5)*b}function r(a,b){return a>0&&!isNaN(b)?Math.ceil(b/a)*a:b}function s(a){return u+" "+a+" "+v}var t=3,u=c.startSymbol(),v=c.endSymbol();return{restrict:"EA",require:"ngModel",scope:{floor:"@",ceiling:"@",step:"@",stepWidth:"@",precision:"@",buffer:"@",stickiness:"@",showSteps:"@",ngModel:"=",ngModelRange:"=",ngDisabled:"=",ngChange:"&",translateFn:"&",translateRangeFn:"&",translateCombinedFn:"&",scaleFn:"&",inverseScaleFn:"&"},template:"",compile:function(c,g){function u(a){a||(a=c);var b=[];return angular.forEach(a.children(),function(a){b.push(e(a))}),b}function v(a,b,c){return{fullBar:a[0],stepBubs:a[1],selBar:b?a[2]:null,unSelBarLow:b?a[3]:null,unSelBarHigh:b?a[4]:null,minPtr:b?a[5]:a[2],maxPtr:b?a[6]:null,lowBub:b?a[7]:a[3],highBub:b?a[8]:null,cmbBub:b?a[9]:null,selBub:b?a[10]:null,flrBub:b?a[11]:a[4],ceilBub:b?a[12]:a[5],minInput:c?b?a[13]:a[6]:null,maxInput:c&&b?a[14]:null,selInput:c&&b?a[15]:null}}var w=g.showSteps,x=g.stepWidth?"stepWidth":"step",y=null!=g.ngModelRange,z={},A="ngModel",B="ngModelRange",C="selectBar",D=["floor","ceiling","stickiness",A];if(z=function(){for(var a=u(),b=[],c=0,d=a.length;d>c;c++){var f=a[c];f=e(f),f.css({"white-space":"nowrap",position:"absolute",display:"block","z-index":1}),b.push(f)}return b}(),z=v(z,!0,!0),g.translateFn&&g.$set("translateFn",""+g.translateFn+"(value)"),g.translateRangeFn&&g.$set("translateRangeFnFn",""+g.translateRangeFn+"(low,high)"),g.translateCombinedFn&&g.$set("translateCombinedFnFn",""+g.translateCombinedFn+"(low,high)"),g.scaleFn&&g.$set("scaleFn",""+g.scaleFn+"(value)"),g.inverseScaleFn&&g.$set("inverseScaleFn",""+g.inverseScaleFn+"(value)"),z.fullBar.css({left:0,right:0}),AngularSlider.inputtypes.range){var E={position:"absolute",margin:0,padding:0,opacity:0,height:"100%"};z.minInput.attr("step",s("inputSteps()")),z.minInput.attr("min",s("floor")),z.minInput.css(E),z.minInput.css("left",0),y?(z.minInput.attr("max",s("ngModelRange - (buffer / 2)")),z.maxInput.attr("step",s("inputSteps()")),z.maxInput.attr("min",s("ngModel + (buffer / 2)")),z.maxInput.attr("max",s("ceiling")),z.maxInput.css(E),z.selInput.attr("step",s("inputSteps()")),z.selInput.attr("min",s("ngModel")),z.selInput.attr("max",s("ngModelRange")),z.selInput.css(E)):(z.minInput.attr("max",s("ceiling")),z.minInput.css({width:"100%"}),z.maxInput.remove(),z.selInput.remove())}else z.minInput.remove(),z.maxInput.remove(),z.selInput.remove();if(o(z.stepBubs.children().eq(0),s("translation(step)")),o(z.ceilBub,s("translation(ceiling)")),o(z.flrBub,s("translation(floor)")),o(z.selBub,s("rangeTranslation("+A+","+B+")")),o(z.lowBub,s("translation("+A+")")),o(z.highBub,s("translation("+B+")")),o(z.cmbBub,s("combinedTranslation("+A+","+B+")")),y)D.push(B),D.unshift("buffer");else for(var F=[z.selBar,z.unSelBarLow,z.unSelBarHigh,z.maxPtr,z.selBub,z.highBub,z.cmbBub],G=0,H=F.length;H>G;G++)c=F[G],c.remove();return D.unshift("precision",x),w||z.stepBubs.children().remove(),{post:function(c,g,o,s){function w(){if(angular.forEach(D,function(a){c[a]=parseFloat(c[a]),a==A||a==B?c[a]=p(c[a],c.precision,c[x],c.floor,c.ceiling):"buffer"==a?c.buffer=!c.buffer||isNaN(c.buffer)||c.buffer<0?0:r(c[x],c.buffer):"precision"==a?c.precision=!c.precision||isNaN(c.precision)?0:parseInt(c.precision):a==x?c[x]=!c[x]||isNaN(c[x])?1/Math.pow(10,c.precision):parseFloat(c[x].toFixed(c.precision)):"stickiness"==a&&(isNaN(c.stickiness)?c.stickiness=t:c.stickiness<1&&(c.stickiness=1)),c.decodedValues[a]=c.decodeRef(a)}),y){if(c[B]0&&bc.ceiling&&(c[B]=c.ceiling,c[A]=c.ceiling-c.buffer)}}F=k(E.fullBar),G=l(E.minPtr),H=m(E.fullBar),I=H+F-k(E.minPtr),J=I-H,K=c.floor,L=c.decodedValues.floor,M=c.ceiling,N=c.decodedValues.ceiling,O=M-K,P=N-L,Q=q(P,c.decodedValues[x])}function z(){function a(a){return(a-H)/J*100}function o(b){return a(b)/100*P+L}function r(a){return c.encode(o(a))}function t(a){var b=a-L;return O==P?b=q(b,c.decodedValues[x])/Q:b/=P,100*b}function u(a){return t(c.decode(a))}function v(a){return f(a*J/100)}function z(a){return Math.min(Math.max(a,H),I)}function D(b){return j(b,v(a(z(m(b)))))}function N(a,b,d){var e=a>0?1:-1;return b=b?b:100,d?(Math.sin(Math.min(Math.abs(a/b),1)*Math.PI-Math.PI/2)+1)*e*b/6:e*Math.pow(Math.min(Math.abs(a/b*2),1),c.stickiness)*b/2}function U(){var b=t(c.decodedValues[A]),d=u(c[A]+c[x])-b,e=b-u(c[A]-c[x]),f=u(c[A]+c.buffer)-b,g=a(G+H),h=b+N(R,R>0?d:e);if(j(E.minPtr,v(h)),j(E.lowBub,v(a(m(E.minPtr)-l(E.lowBub)+G))),y){var i=t(c.decodedValues[B]),k=u(c[B]+c[x])-i,n=i-u(c[B]-c[x]),o=i-u(c[B]-c.buffer),p=i+N(S,S>0?k:n);if(h>i-o&&(h=b+N(R,f,!0),j(E.minPtr,v(h)),j(E.lowBub,v(a(m(E.minPtr)-l(E.lowBub)+G)))),b+f>p&&(p=i+N(S,o,!0)),j(E.maxPtr,v(p)),j(E.highBub,v(a(m(E.maxPtr)-l(E.highBub)+G))),j(E.selBar,v(h+g)),E.selBar.css({width:v(p-h)}),j(E.selBub,v((h+p)/2-a(l(E.selBub)+H)+g)),j(E.cmbBub,v((h+p)/2-a(l(E.cmbBub)+H)+g)),E.unSelBarLow.css({left:0,width:v(h+g)}),j(E.unSelBarHigh,v(p+g)),E.unSelBarHigh.css({right:0}),AngularSlider.inputtypes.range){var q=2*g,r=h+f/2,s=100-r;r+=q;var w=p-o/2,z=h+q,C=p-h-q;h+q>=p&&(z=h,C=p+q-h),E.minInput.css({width:v(w)}),E.maxInput.css({left:v(r),width:v(s)}),E.selInput.css({left:v(z),width:v(C)})}}}function V(){var a=E.lowBub;D(E.lowBub),y&&(D(E.highBub),D(E.selBub),n(E.lowBub,E.highBub)<10?(h(E.lowBub),h(E.highBub),i(E.cmbBub),D(E.cmbBub),a=E.cmbBub):(i(E.lowBub),i(E.highBub),h(E.cmbBub),a=E.highBub)),n(E.flrBub,E.lowBub)<5?h(E.flrBub):y&&n(E.flrBub,a)<5?h(E.flrBub):i(E.flrBub),n(E.lowBub,E.ceilBub)<5?h(E.ceilBub):y&&n(a,E.ceilBub)<5?h(E.ceilBub):i(E.ceilBub)}function W(){R=0,S=0,bb&&(U(),V(),bb.removeClass("active")),bb=null,cb=null,$=!1}function X(b){bb&&c.$apply(function(){var d=b.clientX||b.x;if($){var e=r(d)-_,f=r(d)+ab;K>e?(f+=K-e,e=K):f>M&&(e-=f-M,f=M);var h=u(e),i=u(f);R=h,S=i,c[A]=e=p(e,c.precision,c[x],c.floor,c.ceiling),c[B]=f=p(f,c.precision,c[x],c.floor,c.ceiling),R-=u(e),S-=u(f)}else{var j=z(d+H-m(g)-l(bb)),k=a(j),n=c.encode(L+P*k/100);if(R=k,y)if(c.buffer>0)cb===A?n>c[B]-c.buffer&&(n=c[B]-c.buffer):nc[B]){c[A]=c[B],c.decodedValues[A]=c.decodeRef(A),cb=B;var o=E.minPtr;E.minPtr=E.maxPtr,E.maxPtr=o,E.maxPtr.removeClass("active").removeClass("high").addClass("low"),E.minPtr.addClass("active").removeClass("low").addClass("high")}}else if(n" + // secondary bars used for dual knobs
- "" + // step bubbles
- "" + // the knobs
- "" + // current value bubbles
- "" + // low, high, middle and selection bubbles
- "" + // upper and lower limit bubbles
- "", // range sliders used for browsers that support them
+ '' + // secondary bars used for dual knobs
+ '' + // step bubbles
+ '' + // the knobs
+ '' + // current value bubbles
+ '' + // low, high, middle and selection bubbles
+ '' + // upper and lower limit bubbles
+ '', // range sliders used for browsers that support them
compile: function(element, attributes) {
// are we gonna show the step bubbles?
var showSteps = attributes.showSteps;
-
+
// are we using 'step' or 'step-width'?
var stepWidth = attributes.stepWidth?'stepWidth':'step';
// dual knob?
- var isDualKnob = attributes.ngModelRange != null,
+ var isDualKnob = !!attributes.ngModelRange,
// init element references
refs = {},
@@ -508,17 +509,17 @@ angular.module('vr.directives.slider', ['ngTouch']).directive('slider',
fullBar : refs[0], // background bar
stepBubs : refs[1], // the steps bubbles
selBar : dual ? refs[2] : null, // dual knob: the bar between knobs
- unSelBarLow : dual ? refs[3] : null, // dual knob: the bar to the left of the low knob
+ unSelBarLow : dual ? refs[3] : refs[2], // dual knob: the bar to the left of the low knob
unSelBarHigh: dual ? refs[4] : null, // dual knob: the bar to the right of the high knob
- minPtr : dual ? refs[5] : refs[2], // single knob: the knob, dual knob: the low knob
+ minPtr : dual ? refs[5] : refs[3], // single knob: the knob, dual knob: the low knob
maxPtr : dual ? refs[6] : null, // dual knob: the high knob
- lowBub : dual ? refs[7] : refs[3], // single knob: the value bubble, dual knob: the low value bubble
+ lowBub : dual ? refs[7] : refs[4], // single knob: the value bubble, dual knob: the low value bubble
highBub : dual ? refs[8] : null, // dual knob: the high value bubble
cmbBub : dual ? refs[9] : null, // dual knob: the range values bubble
selBub : dual ? refs[10] : null, // dual knob: the range width bubble
- flrBub : dual ? refs[11] : refs[4], // the lower limit bubble
- ceilBub : dual ? refs[12] : refs[5], // the upper limit bubble
- minInput : inputs ? (dual ? refs[13] : refs[6]) : null, // single knob: the actual slider input, dual knob: the low value slider input
+ flrBub : dual ? refs[11] : refs[5], // the lower limit bubble
+ ceilBub : dual ? refs[12] : refs[6], // the upper limit bubble
+ minInput : inputs ? (dual ? refs[13] : refs[7]) : null, // single knob: the actual slider input, dual knob: the low value slider input
maxInput : inputs ? (dual ? refs[14] : null) : null, // dual knob: the high value slider input
selInput : inputs ? (dual ? refs[15] : null) : null // dual knob: the selection slider input
};
@@ -546,27 +547,27 @@ angular.module('vr.directives.slider', ['ngTouch']).directive('slider',
// set up the translation function
if(attributes.translateFn) {
- attributes.$set('translateFn', "" + attributes.translateFn + "(value)");
+ attributes.$set('translateFn', '' + attributes.translateFn + '(value)');
}
// set up the translation function for the range bubble
if(attributes.translateRangeFn) {
- attributes.$set('translateRangeFnFn', "" + attributes.translateRangeFn + "(low,high)");
+ attributes.$set('translateRangeFnFn', '' + attributes.translateRangeFn + '(low,high)');
}
// set up the translation function for the center bubble
if(attributes.translateCombinedFn) {
- attributes.$set('translateCombinedFnFn', "" + attributes.translateCombinedFn + "(low,high)");
+ attributes.$set('translateCombinedFnFn', '' + attributes.translateCombinedFn + '(low,high)');
}
// set up the encoding function
if(attributes.scaleFn) {
- attributes.$set('scaleFn', "" + attributes.scaleFn + "(value)");
+ attributes.$set('scaleFn', '' + attributes.scaleFn + '(value)');
}
// set up the decoding function
if(attributes.inverseScaleFn) {
- attributes.$set('inverseScaleFn', "" + attributes.inverseScaleFn + "(value)");
+ attributes.$set('inverseScaleFn', '' + attributes.inverseScaleFn + '(value)');
}
// set up the background bar so it fills the entire width of the slider
@@ -592,31 +593,31 @@ angular.module('vr.directives.slider', ['ngTouch']).directive('slider',
};
// set up the low value range input
- refs.minInput.attr('step', expression("inputSteps()")); // set the number of steps
- refs.minInput.attr('min', expression("floor")); // set the minimum possible value
+ refs.minInput.attr('step', expression('inputSteps()')); // set the number of steps
+ refs.minInput.attr('min', expression('floor')); // set the minimum possible value
refs.minInput.css(inputStyles); // apply the default styles
refs.minInput.css('left', 0); // stick it to the left
if(isDualKnob) {
// this is a dual knob slider
- refs.minInput.attr('max', expression("ngModelRange - (buffer / 2)")); // set the maximum value of the low range input so it doesn't overlap the high range input's minimum value
+ refs.minInput.attr('max', expression('ngModelRange - (buffer / 2)')); // set the maximum value of the low range input so it doesn't overlap the high range input's minimum value
// set up the high value range input
- refs.maxInput.attr('step', expression("inputSteps()")); // set the number of steps
- refs.maxInput.attr('min', expression("ngModel + (buffer / 2)")); // set the minimum value of the high range input so it doesn't overlap the low range input's maximum value
- refs.maxInput.attr('max', expression("ceiling")); // set the maximum possible value
+ refs.maxInput.attr('step', expression('inputSteps()')); // set the number of steps
+ refs.maxInput.attr('min', expression('ngModel + (buffer / 2)')); // set the minimum value of the high range input so it doesn't overlap the low range input's maximum value
+ refs.maxInput.attr('max', expression('ceiling')); // set the maximum possible value
refs.maxInput.css(inputStyles); // apply the default styles
// set up the selection range input
- refs.selInput.attr('step', expression("inputSteps()")); // set the number of steps
- refs.selInput.attr('min', expression("ngModel")); // set up the minimum value
- refs.selInput.attr('max', expression("ngModelRange")); // set up the maximum falue
+ refs.selInput.attr('step', expression('inputSteps()')); // set the number of steps
+ refs.selInput.attr('min', expression('ngModel')); // set up the minimum value
+ refs.selInput.attr('max', expression('ngModelRange')); // set up the maximum falue
refs.selInput.css(inputStyles); // apply the default styles
} else {
// this is single knob slider
- refs.minInput.attr('max', expression("ceiling")); // set the maximum possible value
+ refs.minInput.attr('max', expression('ceiling')); // set the maximum possible value
refs.minInput.css({ width: '100%' }); // make sure it fills the entire slider
refs.maxInput.remove(); // get rid of the high value range input
refs.selInput.remove(); // get rid of the selection value range input
@@ -629,13 +630,13 @@ angular.module('vr.directives.slider', ['ngTouch']).directive('slider',
}
// set up bubbles
- bindHtml(refs.stepBubs.children().eq(0), expression("translation(step)"));
- bindHtml(refs.ceilBub, expression("translation(ceiling)"));
- bindHtml(refs.flrBub, expression("translation(floor)"));
- bindHtml(refs.selBub, expression("rangeTranslation(" + refLow + "," + refHigh + ")"));
- bindHtml(refs.lowBub, expression("translation(" + refLow + ")"));
- bindHtml(refs.highBub, expression("translation(" + refHigh + ")"));
- bindHtml(refs.cmbBub, expression("combinedTranslation(" + refLow + "," + refHigh + ")"));
+ bindHtml(refs.stepBubs.children().eq(0), expression('translation(step)'));
+ bindHtml(refs.ceilBub, expression('translation(ceiling)'));
+ bindHtml(refs.flrBub, expression('translation(floor)'));
+ bindHtml(refs.selBub, expression('rangeTranslation(' + refLow + ',' + refHigh + ')'));
+ bindHtml(refs.lowBub, expression('translation(' + refLow + ')'));
+ bindHtml(refs.highBub, expression('translation(' + refHigh + ')'));
+ bindHtml(refs.cmbBub, expression('combinedTranslation(' + refLow + ',' + refHigh + ')'));
// start to compile watchables
if(isDualKnob) {
@@ -644,7 +645,7 @@ angular.module('vr.directives.slider', ['ngTouch']).directive('slider',
watchables.unshift('buffer');
} else {
// single knob so get rid of what we don't need
- var _ref1 = [refs.selBar, refs.unSelBarLow, refs.unSelBarHigh, refs.maxPtr, refs.selBub, refs.highBub, refs.cmbBub];
+ var _ref1 = [refs.selBar, refs.unSelBarHigh, refs.maxPtr, refs.selBub, refs.highBub, refs.cmbBub];
for(var _i = 0, _len = _ref1.length; _i < _len; _i++) {
element = _ref1[_i];
element.remove();
@@ -652,7 +653,7 @@ angular.module('vr.directives.slider', ['ngTouch']).directive('slider',
}
// make sure the precision and step are first in the list
watchables.unshift('precision', stepWidth);
-
+
if(!showSteps) {
// we're not displaying the step bubbles this time
refs.stepBubs.children().remove();
@@ -668,15 +669,15 @@ angular.module('vr.directives.slider', ['ngTouch']).directive('slider',
* @type {{floor: number, ceiling: number, step: number, precision: number, buffer: number, stickiness: number, ngModel: number, ngModel: number, ngModelRange: number}}
*/
scope.decodedValues = {
- floor : 0,
- ceiling : 0,
- step : 0,
- stepWidth : 0,
- precision : 0,
- buffer : 0,
- stickiness : 0,
- ngModel : 0,
- ngModelRange: 0
+ floor : 0,
+ ceiling : 0,
+ step : 0,
+ stepWidth : 0,
+ precision : 0,
+ buffer : 0,
+ stickiness : 0,
+ ngModel : 0,
+ ngModelRange : 0
};
/**
@@ -700,7 +701,7 @@ angular.module('vr.directives.slider', ['ngTouch']).directive('slider',
*/
scope.rangeTranslation = function(low, high) {
if(angular.isUndefined(attributes.translateRangeFn)) {
- return "Range: " + scope.translation((high - low).toFixed(scope.precision));
+ return 'Range: ' + scope.translation((high - low).toFixed(scope.precision));
}
return scope.translateRangeFn({low: low, high: high});
};
@@ -713,7 +714,7 @@ angular.module('vr.directives.slider', ['ngTouch']).directive('slider',
*/
scope.combinedTranslation = function(low, high) {
if(angular.isUndefined(attributes.translateCombinedFn)) {
- return scope.translation(low) + " - " + scope.translation(high);
+ return scope.translation(low) + ' - ' + scope.translation(high);
}
return scope.translateCombinedFn({low: low, high: high});
};
@@ -724,7 +725,7 @@ angular.module('vr.directives.slider', ['ngTouch']).directive('slider',
* @returns {number}
*/
scope.encode = function(value) {
- if(angular.isUndefined(attributes.scaleFn) || attributes.scaleFn == '') {
+ if(angular.isUndefined(attributes.scaleFn) || !attributes.scaleFn) {
return value;
}
return scope.scaleFn({value: value});
@@ -736,14 +737,14 @@ angular.module('vr.directives.slider', ['ngTouch']).directive('slider',
* @returns {number}
*/
scope.decode = function(value) {
- if(angular.isUndefined(attributes.inverseScaleFn) || attributes.inverseScaleFn == '') {
+ if(angular.isUndefined(attributes.inverseScaleFn) || !attributes.inverseScaleFn) {
return value;
}
return scope.inverseScaleFn({value: value});
};
-
- if(Math.round(scope.encode(scope.decode(1))) != 1 || Math.round(scope.encode(scope.decode(100))) != 100) {
- console.warn("The scale and inverseScale functions are not perfect inverses: 1 = "+scope.encode(scope.decode(1))+" 100 = "+scope.encode(scope.decode(100)));
+
+ if(Math.round(scope.encode(scope.decode(1))) !== 1 || Math.round(scope.encode(scope.decode(100))) !== 100) {
+ console.warn('The scale and inverseScale functions are not perfect inverses: 1 = '+scope.encode(scope.decode(1))+' 100 = '+scope.encode(scope.decode(100)));
}
/**
@@ -860,14 +861,14 @@ angular.module('vr.directives.slider', ['ngTouch']).directive('slider',
// make sure the watchables are all valid
angular.forEach(watchables, function(watchable) {
-
+
// parse them to floats
scope[watchable] = parseFloat(scope[watchable]);
- if(watchable == refLow || watchable == refHigh) {
+ if(watchable === refLow || watchable === refHigh) {
// this is the low or high value so bring them back in line with the steps
scope[watchable] = roundToStep(scope[watchable], scope.precision, scope[stepWidth], scope.floor, scope.ceiling);
- } else if(watchable == 'buffer') {
+ } else if(watchable === 'buffer') {
if(!scope.buffer || isNaN(scope.buffer) || scope.buffer < 0) {
// the buffer is not valid, so set to 0
scope.buffer = 0;
@@ -875,21 +876,21 @@ angular.module('vr.directives.slider', ['ngTouch']).directive('slider',
// this is the buffer so make sure it aligns with the steps
scope.buffer = stepBuffer(scope[stepWidth], scope.buffer);
}
- } else if(watchable == 'precision') {
+ } else if(watchable === 'precision') {
// make sure the precision is valid
if(!scope.precision || isNaN(scope.precision)) {
scope.precision = 0;
} else {
scope.precision = parseInt(scope.precision);
}
- } else if(watchable == stepWidth) {
+ } else if(watchable === stepWidth) {
// make sure the step is valid
if(!scope[stepWidth] || isNaN(scope[stepWidth])) {
scope[stepWidth] = 1 / Math.pow(10, scope.precision);
} else {
scope[stepWidth] = parseFloat(scope[stepWidth].toFixed(scope.precision));
}
- } else if(watchable == 'stickiness') {
+ } else if(watchable === 'stickiness') {
// make sure the stickiness is valid
if(isNaN(scope.stickiness)) {
scope.stickiness = KNOB_STICKINESS;
@@ -897,7 +898,7 @@ angular.module('vr.directives.slider', ['ngTouch']).directive('slider',
scope.stickiness = 1;
}
}
-
+
// save the decoded values
scope.decodedValues[watchable] = scope.decodeRef(watchable);
@@ -951,7 +952,7 @@ angular.module('vr.directives.slider', ['ngTouch']).directive('slider',
maxValueDecoded = scope.decodedValues.ceiling;
valueRange = maxValue - minValue;
valueRangeDecoded = maxValueDecoded - minValueDecoded;
-
+
stepRange = roundTo(valueRangeDecoded, scope.decodedValues[stepWidth]);
}
@@ -1014,7 +1015,7 @@ angular.module('vr.directives.slider', ['ngTouch']).directive('slider',
* @param {number} value
* @returns {number}
*/
- function offsetFromValue(value) {
+ function offsetFromValue(value) { // jshint unused: false
return offsetFromDecodedValue(scope.decode(value));
}
@@ -1025,7 +1026,7 @@ angular.module('vr.directives.slider', ['ngTouch']).directive('slider',
*/
function percentFromDecodedValue(value) {
var percent = value - minValueDecoded;
- if(valueRange == valueRangeDecoded) {
+ if(valueRange === valueRangeDecoded) {
percent = roundTo(percent, scope.decodedValues[stepWidth]) / stepRange;
} else {
percent /= valueRangeDecoded;
@@ -1145,6 +1146,12 @@ angular.module('vr.directives.slider', ['ngTouch']).directive('slider',
offset(refs.lowBub,
offsetFromPercent(percentFromOffset(offsetLeft(refs.minPtr) - halfWidth(refs.lowBub) + pointerHalfWidth)));
+ // set the low unselected bar's new position and width
+ refs.unSelBarLow.css({
+ left : 0,
+ width: offsetFromPercent(stretchedLowPercent + ptrHalfWidthPercent)
+ });
+
if(isDualKnob) {
// dual knob slider
@@ -1212,12 +1219,6 @@ angular.module('vr.directives.slider', ['ngTouch']).directive('slider',
offset(refs.selBub, offsetFromPercent(((stretchedLowPercent + stretchedHighPercent) / 2) - percentFromOffset(halfWidth(refs.selBub) + minOffset) + ptrHalfWidthPercent));
offset(refs.cmbBub, offsetFromPercent(((stretchedLowPercent + stretchedHighPercent) / 2) - percentFromOffset(halfWidth(refs.cmbBub) + minOffset) + ptrHalfWidthPercent));
- // set the low unselected bar's new position and width
- refs.unSelBarLow.css({
- left : 0,
- width: offsetFromPercent(stretchedLowPercent + ptrHalfWidthPercent)
- });
-
// set the high unselected bar's new position and width
offset(refs.unSelBarHigh, offsetFromPercent(stretchedHighPercent + ptrHalfWidthPercent));
refs.unSelBarHigh.css({
@@ -1226,26 +1227,26 @@ angular.module('vr.directives.slider', ['ngTouch']).directive('slider',
if(AngularSlider.inputtypes.range) {
// we're using range inputs
-
+
var ptrWidth = ptrHalfWidthPercent * 2;
-
+
// get the high input's new position
var highInputLeft = stretchedLowPercent + (bufferWidthPercentLow / 2);
var highInputWidth = 100 - highInputLeft;
highInputLeft += ptrWidth;
-
+
// get the low input's new width
var lowInputWidth = stretchedHighPercent - (bufferWidthPercentHigh / 2);
-
+
// get the selection inputs new position and width;
var selInputLeft = stretchedLowPercent + ptrWidth;
var selInputWidth = stretchedHighPercent - stretchedLowPercent - ptrWidth;
-
- if(stretchedHighPercent <= stretchedLowPercent + ptrWidth) {
+
+ if(stretchedHighPercent <= stretchedLowPercent + ptrWidth) {
selInputLeft = stretchedLowPercent;
selInputWidth = stretchedHighPercent + ptrWidth - stretchedLowPercent;
}
-
+
// set the low input's new width
refs.minInput.css({
width: offsetFromPercent(lowInputWidth)
@@ -1402,6 +1403,16 @@ angular.module('vr.directives.slider', ['ngTouch']).directive('slider',
dragRange = false;
}
+ /**
+ * Get X coord from click, touch etc. event
+ * @param {object} event
+ * @returns {number}
+ */
+ function getXFromEvent(event) {
+ var _ref, _ref1, _ref2;
+ return event.clientX || event.x || ((_ref = event.touches) != null ? _ref[0].clientX : void 0) || ((_ref1 = event.originalEvent) != null ? (_ref2 = _ref1.touches) != null ? _ref2[0].clientX : void 0 : void 0);
+ }
+
/**
* What to do when the knob/bar is moved
* @param {object} event
@@ -1416,7 +1427,7 @@ angular.module('vr.directives.slider', ['ngTouch']).directive('slider',
* The current x position of the mouse/finger/etc.
* @type {number}
*/
- var currentX = event.clientX || event.x;
+ var currentX = getXFromEvent(event);
if(dragRange) {
// the entire range is being dragged
@@ -1499,7 +1510,7 @@ angular.module('vr.directives.slider', ['ngTouch']).directive('slider',
// the new value cuts into the buffer
// so make the value respect the buffer
- newValue = scope[refHigh] - scope.buffer
+ newValue = scope[refHigh] - scope.buffer;
}
} else {
// the high knob is being dragged
@@ -1513,7 +1524,7 @@ angular.module('vr.directives.slider', ['ngTouch']).directive('slider',
}
} else {
// we don't have to worry about a buffer
-
+ var temp;
if(ref === refLow) {
// the low knob is being dragged
@@ -1522,15 +1533,15 @@ angular.module('vr.directives.slider', ['ngTouch']).directive('slider',
// so set the low value to what the high used to be
scope[refLow] = scope[refHigh];
-
+
// make sure the decoded values are updated
scope.decodedValues[refLow] = scope.decodeRef(refLow);
// switch the value reference
ref = refHigh;
-
+
// swap the element references
- var temp = refs.minPtr;
+ temp = refs.minPtr;
refs.minPtr = refs.maxPtr;
refs.maxPtr = temp;
@@ -1546,15 +1557,15 @@ angular.module('vr.directives.slider', ['ngTouch']).directive('slider',
// so set the high value to what the low used to be
scope[refHigh] = scope[refLow];
-
+
// make sure the decoded values are updated
scope.decodedValues[refHigh] = scope.decodeRef(refHigh);
// switch the value reference
ref = refLow;
-
+
// swap the element references
- var temp = refs.minPtr;
+ temp = refs.minPtr;
refs.minPtr = refs.maxPtr;
refs.maxPtr = temp;
@@ -1568,7 +1579,7 @@ angular.module('vr.directives.slider', ['ngTouch']).directive('slider',
// round the new value and assign it
scope[ref] = newValue = roundToStep(newValue, scope.precision, scope[stepWidth], scope.floor, scope.ceiling);
-
+
// update the decoded value
scope.decodedValues[ref] = scope.decodeRef(ref);
@@ -1577,7 +1588,7 @@ angular.module('vr.directives.slider', ['ngTouch']).directive('slider',
// so update the sticky offset for the low knob
stickyOffsetLow = stickyOffsetLow - percentFromValue(newValue);
-
+
// and ensure the high knob stays put
stickyOffsetHigh = 0;
} else {
@@ -1590,11 +1601,13 @@ angular.module('vr.directives.slider', ['ngTouch']).directive('slider',
stickyOffsetLow = 0;
}
}
-
+
if(scope.ngChange) {
scope.ngChange();
}
ctrl.$setViewValue(scope[refLow]);
+ ctrl.$setDirty();
+ ctrl .$setTouched();
// update the DOM
setPointers();
@@ -1611,16 +1624,18 @@ angular.module('vr.directives.slider', ['ngTouch']).directive('slider',
* @param {string} rf
*/
function onStart(event, ptr, rf) {
-
- if(scope.ngDisabled && scope.ngDisabled == true) return;
-
+
+ if(scope.ngDisabled && scope.ngDisabled === true) {
+ return;
+ }
+
event.preventDefault();
/**
* The current x position of the mouse/finger/etc.
* @type {number}
*/
- var currentX = event.clientX || event.x;
+ var currentX = getXFromEvent(event);
// save the pointer reference
pointer = ptr;
@@ -1631,12 +1646,12 @@ angular.module('vr.directives.slider', ['ngTouch']).directive('slider',
// set the knob/bar to active
pointer.addClass('active');
- if(ref == refSel) {
+ if(ref === refSel) {
// the selection bar is being dragged
// so tell everyone else this is the case
dragRange = true;
-
+
var startValue = valueFromOffset(currentX);
// and save the start positions
@@ -1660,7 +1675,7 @@ angular.module('vr.directives.slider', ['ngTouch']).directive('slider',
* @param {object} ptr
* @param {string} rf
*/
- function bindSlider(elem, ptr, rf) {
+ var bindSlider = function(elem, ptr, rf) {
// make sure the element has all the methods and properties we'll need
elem = angularize(elem);
@@ -1695,7 +1710,7 @@ angular.module('vr.directives.slider', ['ngTouch']).directive('slider',
onEnd(ev);
}
});
- }
+ };
// bind the events to the low value range input
bindSlider(refs.minInput, refs.minPtr, refLow);
@@ -1715,7 +1730,7 @@ angular.module('vr.directives.slider', ['ngTouch']).directive('slider',
* @param {string} rf
* @param {object} [ptr]
*/
- function bindSwipeStart(elem, rf, ptr) {
+ var bindSwipeStart = function(elem, rf, ptr) {
// make sure the element has all the methods and properties we'll need
elem = angularize(elem);
@@ -1733,13 +1748,13 @@ angular.module('vr.directives.slider', ['ngTouch']).directive('slider',
onStart(ev, ptr, rf);
}
});
- }
+ };
/**
* Move event
* @param {object} elem
*/
- function bindSwipe(elem) {
+ var bindSwipe = function(elem) {
// make sure the element has all the methods and properties we'll need
elem = angularize(elem);
@@ -1747,23 +1762,25 @@ angular.module('vr.directives.slider', ['ngTouch']).directive('slider',
// bind the swipe move, end, and cancel events
$swipe.bind(elem, {
move : function(coords, ev) {
- onMove(ev);
+ onMove(ev);
},
end : function(coords, ev) {
onMove(ev);
onEnd();
},
cancel: function(coords, ev) {
- onEnd(ev);
+ onEnd(ev);
}
});
- }
+ };
// bind the common events to the various common elements
bindSwipe($document);
bindSwipeStart(refs.minPtr, refLow);
bindSwipeStart(refs.lowBub, refLow);
bindSwipeStart(refs.flrBub, refLow, refs.minPtr);
+ bindSwipeStart(refs.unSelBarLow, refLow, refs.minPtr);
+ bindSwipeStart(refs.stepBubs, refLow, refs.minPtr);
if(isDualKnob) {
// bind the dual knob specific events to the dual knob specific elements
bindSwipeStart(refs.maxPtr, refHigh);
@@ -1771,7 +1788,6 @@ angular.module('vr.directives.slider', ['ngTouch']).directive('slider',
bindSwipeStart(refs.ceilBub, refHigh, refs.maxPtr);
bindSwipeStart(refs.selBar, refSel);
bindSwipeStart(refs.selBub, refSel, refs.selBar);
- bindSwipeStart(refs.unSelBarLow, refLow, refs.minPtr);
bindSwipeStart(refs.unSelBarHigh, refHigh, refs.maxPtr);
} else {
// bind the single knob specific events to the single knob specific elements
@@ -1796,31 +1812,23 @@ angular.module('vr.directives.slider', ['ngTouch']).directive('slider',
// update the DOM when one of the watchables changes
for(var i = 0; i < watchables.length; i++) {
- scope.$watch(watchables[i], function() {
- updateDOM();
- });
+ scope.$watch(watchables[i], updateDOM);
}
// update the DOM when the window resizes
- angularize(window).bind("resize", function() {
- updateDOM();
- });
+ angularize(window).bind('resize', updateDOM);
// listen for a refresh event
scope.$on('refreshSlider', function() {
// update the DOM, but make sure everything has been digested first
- $timeout(function() {
- updateDOM();
- });
+ $timeout(updateDOM);
});
// wait for everything to be digested then set up the DOM
- $timeout(function() {
- updateDOM();
- });
+ $timeout(updateDOM);
}
};
}
- }
+ };
}
]);
diff --git a/build/touk-angular-slider.min.js b/build/touk-angular-slider.min.js
new file mode 100644
index 0000000..7fcc6f6
--- /dev/null
+++ b/build/touk-angular-slider.min.js
@@ -0,0 +1,6 @@
+/*
+ touk-angular-slider v0.3.3
+ (c) 2013-2014 Venturocket, Inc. http://github.com/Venturocket
+ License: MIT
+*/
+window.AngularSlider=function(a,b,c){function d(a){n.cssText=a}function e(a,b){return typeof a===b}function f(){j.inputtypes=function(a){for(var d,e,f,g=0,h=a.length;h>g;g++)o.setAttribute("type",e=a[g]),d="text"!==o.type,d&&(o.value=p,o.style.cssText="position:absolute;visibility:hidden;",/^range$/.test(e)&&o.style.WebkitAppearance!==c?(k.appendChild(o),f=b.defaultView,d=f.getComputedStyle&&"textfield"!==f.getComputedStyle(o,null).WebkitAppearance&&0!==o.offsetHeight,k.removeChild(o)):/^(search|tel)$/.test(e)||(d=/^(url|email)$/.test(e)?o.checkValidity&&o.checkValidity()===!1:o.value!=p)),r[a[g]]=!!d;return r}("search tel url email datetime date month week time datetime-local number range color".split(" "))}var g,h,i="2.7.1",j={},k=b.documentElement,l="modernizr",m=b.createElement(l),n=m.style,o=b.createElement("input"),p=":)",q=({}.toString,{}),r={},s=[],t=s.slice,u={}.hasOwnProperty;h=e(u,"undefined")||e(u.call,"undefined")?function(a,b){return b in a&&e(a.constructor.prototype[b],"undefined")}:function(a,b){return u.call(a,b)},Function.prototype.bind||(Function.prototype.bind=function(a){var b=this;if("function"!=typeof b)throw new TypeError;var c=t.call(arguments,1),d=function(){if(this instanceof d){var e=function(){};e.prototype=b.prototype;var f=new e,g=b.apply(f,c.concat(t.call(arguments)));return Object(g)===g?g:f}return b.apply(a,c.concat(t.call(arguments)))};return d});for(var v in q)h(q,v)&&(g=v.toLowerCase(),j[g]=q[v](),s.push((j[g]?"":"no-")+g));return j.input||f(),j.addTest=function(a,b){if("object"==typeof a)for(var d in a)h(a,d)&&j.addTest(d,a[d]);else{if(a=a.toLowerCase(),j[a]!==c)return j;b="function"==typeof b?b():b,"undefined"!=typeof enableClasses&&enableClasses&&(k.className+=" "+(b?"":"no-")+a),j[a]=b}return j},d(""),m=o=null,j._version=i,j}(this,this.document),function(a,b,c){function d(a){return"[object Function]"==q.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=r.shift();s=1,a?a.t?o(function(){("c"==a.t?m.injectCss:m.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):s=0}function i(a,c,d,e,f,i,j){function k(b){if(!n&&g(l.readyState)&&(t.r=n=1,!s&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&o(function(){v.removeChild(l)},50);for(var d in A[c])A[c].hasOwnProperty(d)&&A[c][d].onload()}}var j=j||m.errorTimeout,l=b.createElement(a),n=0,q=0,t={t:d,s:c,e:f,a:i,x:j};1===A[c]&&(q=1,A[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,q)},r.splice(e,0,t),"img"!=a&&(q||2===A[c]?(v.insertBefore(l,u?null:p),o(k,j)):A[c].push(l))}function j(a,b,c,d,f){return s=0,b=b||"j",e(a)?i("c"==b?x:w,a,b,this.i++,c,d,f):(r.splice(this.i++,0,a),1==r.length&&h()),this}function k(){var a=m;return a.loader={load:j,i:0},a}var l,m,n=b.documentElement,o=a.setTimeout,p=b.getElementsByTagName("script")[0],q={}.toString,r=[],s=0,t="MozAppearance"in n.style,u=t&&!!b.createRange().compareNode,v=u?n:p.parentNode,n=a.opera&&"[object Opera]"==q.call(a.opera),n=!!b.attachEvent&&!n,w=t?"object":n?"script":"img",x=n?"script":w,y=Array.isArray||function(a){return"[object Array]"==q.call(a)},z=[],A={},B={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}};m=function(a){function b(a){var b,c,d,a=a.split("!"),e=z.length,f=a.pop(),g=a.length,f={url:f,origUrl:f,prefixes:a};for(c=0;g>c;c++)d=a[c].split("="),(b=B[d.shift()])&&(f=b(f,d));for(c=0;e>c;c++)f=z[c](f);return f}function g(a,e,f,g,h){var i=b(a),j=i.autoCallback;i.url.split(".").pop().split("?").shift(),i.bypass||(e&&(e=d(e)?e:e[a]||e[g]||e[a.split("/").pop().split("?")[0]]),i.instead?i.instead(a,e,f,g,h):(A[i.url]?i.noexec=!0:A[i.url]=1,f.load(i.url,i.forceCSS||!i.forceJS&&"css"==i.url.split(".").pop().split("?").shift()?"c":c,i.noexec,i.attrs,i.timeout),(d(e)||d(j))&&f.load(function(){k(),e&&e(i.origUrl,h,g),j&&j(i.origUrl,h,g),A[i.url]=2})))}function h(a,b){function c(a,c){if(a){if(e(a))c||(l=function(){var a=[].slice.call(arguments);m.apply(this,a),n()}),g(a,l,b,0,j);else if(Object(a)===a)for(i in h=function(){var b,c=0;for(b in a)a.hasOwnProperty(b)&&c++;return c}(),a)a.hasOwnProperty(i)&&(!c&&!--h&&(d(l)?l=function(){var a=[].slice.call(arguments);m.apply(this,a),n()}:l[i]=function(a){return function(){var b=[].slice.call(arguments);a&&a.apply(this,b),n()}}(m[i])),g(a[i],l,b,i,j))}else!c&&n()}var h,i,j=!!a.test,k=a.load||a.both,l=a.callback||f,m=l,n=a.complete||f;c(j?a.yep:a.nope,!!k),k&&c(k)}var i,j,l=this.yepnope.loader;if(e(a))g(a,0,l,0);else if(y(a))for(i=0;im(b)?m(a)-m(b)-k(b):m(b)-m(a)-k(a)}function o(a,b){return a.attr("ng-bind-template",b)}function p(a,b,c,d,e){(angular.isUndefined(b)||!b)&&(b=0),(angular.isUndefined(c)||!c||0===c)&&(c=1/Math.pow(10,b)),(angular.isUndefined(d)||!d)&&(d=0),(angular.isUndefined(a)||!a)&&(a=0);var f=(a-d)%c,g=f>c/2?a+c-f:a-f;return(angular.isUndefined(e)||!e)&&(e=g),g=Math.min(Math.max(g,d),e),parseFloat(g.toFixed(b))}function q(a,b){return Math.floor(a/b+.5)*b}function r(a,b){return a>0&&!isNaN(b)?Math.ceil(b/a)*a:b}function s(a){return u+" "+a+" "+v}var t=3,u=c.startSymbol(),v=c.endSymbol();return{restrict:"EA",require:"ngModel",scope:{floor:"@",ceiling:"@",step:"@",stepWidth:"@",precision:"@",buffer:"@",stickiness:"@",showSteps:"@",ngModel:"=",ngModelRange:"=",ngDisabled:"=",ngChange:"&",translateFn:"&",translateRangeFn:"&",translateCombinedFn:"&",scaleFn:"&",inverseScaleFn:"&"},template:'',compile:function(c,g){function u(a){a||(a=c);var b=[];return angular.forEach(a.children(),function(a){b.push(e(a))}),b}function v(a,b,c){return{fullBar:a[0],stepBubs:a[1],selBar:b?a[2]:null,unSelBarLow:b?a[3]:a[2],unSelBarHigh:b?a[4]:null,minPtr:b?a[5]:a[3],maxPtr:b?a[6]:null,lowBub:b?a[7]:a[4],highBub:b?a[8]:null,cmbBub:b?a[9]:null,selBub:b?a[10]:null,flrBub:b?a[11]:a[5],ceilBub:b?a[12]:a[6],minInput:c?b?a[13]:a[7]:null,maxInput:c&&b?a[14]:null,selInput:c&&b?a[15]:null}}var w=g.showSteps,x=g.stepWidth?"stepWidth":"step",y=!!g.ngModelRange,z={},A="ngModel",B="ngModelRange",C="selectBar",D=["floor","ceiling","stickiness",A];if(z=function(){for(var a=u(),b=[],c=0,d=a.length;d>c;c++){var f=a[c];f=e(f),f.css({"white-space":"nowrap",position:"absolute",display:"block","z-index":1}),b.push(f)}return b}(),z=v(z,!0,!0),g.translateFn&&g.$set("translateFn",""+g.translateFn+"(value)"),g.translateRangeFn&&g.$set("translateRangeFnFn",""+g.translateRangeFn+"(low,high)"),g.translateCombinedFn&&g.$set("translateCombinedFnFn",""+g.translateCombinedFn+"(low,high)"),g.scaleFn&&g.$set("scaleFn",""+g.scaleFn+"(value)"),g.inverseScaleFn&&g.$set("inverseScaleFn",""+g.inverseScaleFn+"(value)"),z.fullBar.css({left:0,right:0}),AngularSlider.inputtypes.range){var E={position:"absolute",margin:0,padding:0,opacity:0,height:"100%"};z.minInput.attr("step",s("inputSteps()")),z.minInput.attr("min",s("floor")),z.minInput.css(E),z.minInput.css("left",0),y?(z.minInput.attr("max",s("ngModelRange - (buffer / 2)")),z.maxInput.attr("step",s("inputSteps()")),z.maxInput.attr("min",s("ngModel + (buffer / 2)")),z.maxInput.attr("max",s("ceiling")),z.maxInput.css(E),z.selInput.attr("step",s("inputSteps()")),z.selInput.attr("min",s("ngModel")),z.selInput.attr("max",s("ngModelRange")),z.selInput.css(E)):(z.minInput.attr("max",s("ceiling")),z.minInput.css({width:"100%"}),z.maxInput.remove(),z.selInput.remove())}else z.minInput.remove(),z.maxInput.remove(),z.selInput.remove();if(o(z.stepBubs.children().eq(0),s("translation(step)")),o(z.ceilBub,s("translation(ceiling)")),o(z.flrBub,s("translation(floor)")),o(z.selBub,s("rangeTranslation("+A+","+B+")")),o(z.lowBub,s("translation("+A+")")),o(z.highBub,s("translation("+B+")")),o(z.cmbBub,s("combinedTranslation("+A+","+B+")")),y)D.push(B),D.unshift("buffer");else for(var F=[z.selBar,z.unSelBarHigh,z.maxPtr,z.selBub,z.highBub,z.cmbBub],G=0,H=F.length;H>G;G++)c=F[G],c.remove();return D.unshift("precision",x),w||z.stepBubs.children().remove(),{post:function(c,g,o,s){function w(){if(angular.forEach(D,function(a){c[a]=parseFloat(c[a]),a===A||a===B?c[a]=p(c[a],c.precision,c[x],c.floor,c.ceiling):"buffer"===a?c.buffer=!c.buffer||isNaN(c.buffer)||c.buffer<0?0:r(c[x],c.buffer):"precision"===a?c.precision=!c.precision||isNaN(c.precision)?0:parseInt(c.precision):a===x?c[x]=!c[x]||isNaN(c[x])?1/Math.pow(10,c.precision):parseFloat(c[x].toFixed(c.precision)):"stickiness"===a&&(isNaN(c.stickiness)?c.stickiness=t:c.stickiness<1&&(c.stickiness=1)),c.decodedValues[a]=c.decodeRef(a)}),y){if(c[B]0&&bc.ceiling&&(c[B]=c.ceiling,c[A]=c.ceiling-c.buffer)}}F=k(E.fullBar),G=l(E.minPtr),H=m(E.fullBar),I=H+F-k(E.minPtr),J=I-H,K=c.floor,L=c.decodedValues.floor,M=c.ceiling,N=c.decodedValues.ceiling,O=M-K,P=N-L,Q=q(P,c.decodedValues[x])}function z(){function a(a){return(a-H)/J*100}function o(b){return a(b)/100*P+L}function r(a){return c.encode(o(a))}function t(a){var b=a-L;return O===P?b=q(b,c.decodedValues[x])/Q:b/=P,100*b}function u(a){return t(c.decode(a))}function v(a){return f(a*J/100)}function z(a){return Math.min(Math.max(a,H),I)}function D(b){return j(b,v(a(z(m(b)))))}function N(a,b,d){var e=a>0?1:-1;return b=b?b:100,d?(Math.sin(Math.min(Math.abs(a/b),1)*Math.PI-Math.PI/2)+1)*e*b/6:e*Math.pow(Math.min(Math.abs(a/b*2),1),c.stickiness)*b/2}function U(){var b=t(c.decodedValues[A]),d=u(c[A]+c[x])-b,e=b-u(c[A]-c[x]),f=u(c[A]+c.buffer)-b,g=a(G+H),h=b+N(R,R>0?d:e);if(j(E.minPtr,v(h)),j(E.lowBub,v(a(m(E.minPtr)-l(E.lowBub)+G))),E.unSelBarLow.css({left:0,width:v(h+g)}),y){var i=t(c.decodedValues[B]),k=u(c[B]+c[x])-i,n=i-u(c[B]-c[x]),o=i-u(c[B]-c.buffer),p=i+N(S,S>0?k:n);if(h>i-o&&(h=b+N(R,f,!0),j(E.minPtr,v(h)),j(E.lowBub,v(a(m(E.minPtr)-l(E.lowBub)+G)))),b+f>p&&(p=i+N(S,o,!0)),j(E.maxPtr,v(p)),j(E.highBub,v(a(m(E.maxPtr)-l(E.highBub)+G))),j(E.selBar,v(h+g)),E.selBar.css({width:v(p-h)}),j(E.selBub,v((h+p)/2-a(l(E.selBub)+H)+g)),j(E.cmbBub,v((h+p)/2-a(l(E.cmbBub)+H)+g)),j(E.unSelBarHigh,v(p+g)),E.unSelBarHigh.css({right:0}),AngularSlider.inputtypes.range){var q=2*g,r=h+f/2,s=100-r;r+=q;var w=p-o/2,z=h+q,C=p-h-q;h+q>=p&&(z=h,C=p+q-h),E.minInput.css({width:v(w)}),E.maxInput.css({left:v(r),width:v(s)}),E.selInput.css({left:v(z),width:v(C)})}}}function V(){var a=E.lowBub;D(E.lowBub),y&&(D(E.highBub),D(E.selBub),n(E.lowBub,E.highBub)<10?(h(E.lowBub),h(E.highBub),i(E.cmbBub),D(E.cmbBub),a=E.cmbBub):(i(E.lowBub),i(E.highBub),h(E.cmbBub),a=E.highBub)),n(E.flrBub,E.lowBub)<5?h(E.flrBub):y&&n(E.flrBub,a)<5?h(E.flrBub):i(E.flrBub),n(E.lowBub,E.ceilBub)<5?h(E.ceilBub):y&&n(a,E.ceilBub)<5?h(E.ceilBub):i(E.ceilBub)}function W(){R=0,S=0,cb&&(U(),V(),cb.removeClass("active")),cb=null,db=null,_=!1}function X(a){var b,c,d;return a.clientX||a.x||(null!=(b=a.touches)?b[0].clientX:void 0)||(null!=(c=a.originalEvent)&&null!=(d=c.touches)?d[0].clientX:void 0)}function Y(b){cb&&c.$apply(function(){var d=X(b);if(_){var e=r(d)-ab,f=r(d)+bb;K>e?(f+=K-e,e=K):f>M&&(e-=f-M,f=M);var h=u(e),i=u(f);R=h,S=i,c[A]=e=p(e,c.precision,c[x],c.floor,c.ceiling),c[B]=f=p(f,c.precision,c[x],c.floor,c.ceiling),R-=u(e),S-=u(f)}else{var j=z(d+H-m(g)-l(cb)),k=a(j),n=c.encode(L+P*k/100);if(R=k,y)if(c.buffer>0)db===A?n>c[B]-c.buffer&&(n=c[B]-c.buffer):nc[B]&&(c[A]=c[B],c.decodedValues[A]=c.decodeRef(A),db=B,o=E.minPtr,E.minPtr=E.maxPtr,E.maxPtr=o,E.maxPtr.removeClass("active").removeClass("high").addClass("low"),E.minPtr.addClass("active").removeClass("low").addClass("high")):nin ngRepeat
-
-
-
+
+
+