materialize-sass 0.98.2 → 0.99.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/README.md +10 -1
  4. data/Rakefile +21 -3
  5. data/app/assets/fonts/roboto/Roboto-Bold.woff +0 -0
  6. data/app/assets/fonts/roboto/Roboto-Bold.woff2 +0 -0
  7. data/app/assets/fonts/roboto/Roboto-Light.woff +0 -0
  8. data/app/assets/fonts/roboto/Roboto-Light.woff2 +0 -0
  9. data/app/assets/fonts/roboto/Roboto-Medium.woff +0 -0
  10. data/app/assets/fonts/roboto/Roboto-Medium.woff2 +0 -0
  11. data/app/assets/fonts/roboto/Roboto-Regular.woff +0 -0
  12. data/app/assets/fonts/roboto/Roboto-Regular.woff2 +0 -0
  13. data/app/assets/fonts/roboto/Roboto-Thin.woff +0 -0
  14. data/app/assets/fonts/roboto/Roboto-Thin.woff2 +0 -0
  15. data/app/assets/javascripts/materialize-sprockets.js +2 -1
  16. data/app/assets/javascripts/materialize.js +9045 -5
  17. data/app/assets/javascripts/materialize/buttons.js +1 -1
  18. data/app/assets/javascripts/materialize/cards.js +13 -3
  19. data/app/assets/javascripts/materialize/carousel.js +33 -12
  20. data/app/assets/javascripts/materialize/character_counter.js +1 -1
  21. data/app/assets/javascripts/materialize/chips.js +8 -5
  22. data/app/assets/javascripts/materialize/collapsible.js +1 -1
  23. data/app/assets/javascripts/materialize/date_picker/picker.date.js +137 -136
  24. data/app/assets/javascripts/materialize/date_picker/picker.js +0 -1
  25. data/app/assets/javascripts/materialize/date_picker/picker.time.js +686 -0
  26. data/app/assets/javascripts/materialize/dropdown.js +17 -10
  27. data/app/assets/javascripts/materialize/extras/nouislider.js +1 -1
  28. data/app/assets/javascripts/materialize/extras/nouislider.min.js +1 -1
  29. data/app/assets/javascripts/materialize/forms.js +18 -12
  30. data/app/assets/javascripts/materialize/init.js +1 -0
  31. data/app/assets/javascripts/materialize/jquery.easing.1.4.js +166 -0
  32. data/app/assets/javascripts/materialize/materialbox.js +26 -17
  33. data/app/assets/javascripts/materialize/modal.js +2 -1
  34. data/app/assets/javascripts/materialize/scrollspy.js +11 -6
  35. data/app/assets/javascripts/materialize/sideNav.js +43 -13
  36. data/app/assets/javascripts/materialize/slider.js +3 -3
  37. data/app/assets/javascripts/materialize/tabs.js +10 -3
  38. data/app/assets/javascripts/materialize/tooltip.js +1 -1
  39. data/app/assets/javascripts/materialize/transitions.js +3 -3
  40. data/app/assets/javascripts/materialize/waves.js +1 -1
  41. data/app/assets/stylesheets/materialize.scss +0 -1
  42. data/app/assets/stylesheets/materialize/components/_buttons.scss +3 -8
  43. data/app/assets/stylesheets/materialize/components/_collapsible.scss +1 -0
  44. data/app/assets/stylesheets/materialize/components/_color.scss +1 -1
  45. data/app/assets/stylesheets/materialize/components/_global.scss +20 -20
  46. data/app/assets/stylesheets/materialize/components/_modal.scss +2 -2
  47. data/app/assets/stylesheets/materialize/components/_sideNav.scss +2 -0
  48. data/app/assets/stylesheets/materialize/components/_variables.scss +13 -4
  49. data/app/assets/stylesheets/materialize/components/date_picker/_default.date.scss +48 -27
  50. data/app/assets/stylesheets/materialize/components/date_picker/_default.scss +10 -0
  51. data/app/assets/stylesheets/materialize/components/date_picker/_default.time.scss +155 -13
  52. data/app/assets/stylesheets/materialize/components/forms/_input-fields.scss +12 -11
  53. data/app/assets/stylesheets/materialize/components/forms/_switches.scss +30 -17
  54. data/app/assets/stylesheets/materialize/extras/nouislider.css +1 -1
  55. data/lib/materialize-sass/version.rb +1 -1
  56. metadata +4 -14
  57. data/app/assets/fonts/roboto/Roboto-Bold.eot +0 -0
  58. data/app/assets/fonts/roboto/Roboto-Bold.ttf +0 -0
  59. data/app/assets/fonts/roboto/Roboto-Light.eot +0 -0
  60. data/app/assets/fonts/roboto/Roboto-Light.ttf +0 -0
  61. data/app/assets/fonts/roboto/Roboto-Medium.eot +0 -0
  62. data/app/assets/fonts/roboto/Roboto-Medium.ttf +0 -0
  63. data/app/assets/fonts/roboto/Roboto-Regular.eot +0 -0
  64. data/app/assets/fonts/roboto/Roboto-Regular.ttf +0 -0
  65. data/app/assets/fonts/roboto/Roboto-Thin.eot +0 -0
  66. data/app/assets/fonts/roboto/Roboto-Thin.ttf +0 -0
  67. data/app/assets/javascripts/materialize/jquery.easing.1.3.js +0 -205
  68. data/app/assets/stylesheets/materialize/components/_prefixer.scss +0 -384
@@ -150,6 +150,14 @@
150
150
  leftPosition = origin.position().left + gutterSpacing;
151
151
  }
152
152
  else if (currAlignment === 'right') {
153
+ // Material icons fix
154
+ activates
155
+ .stop(true, true)
156
+ .css({
157
+ opacity: 0,
158
+ left: 0
159
+ })
160
+
153
161
  var offsetRight = origin.position().left + origin.outerWidth() - activates.outerWidth();
154
162
  gutterSpacing = -curr_options.gutter;
155
163
  leftPosition = offsetRight + gutterSpacing;
@@ -162,9 +170,8 @@
162
170
  left: leftPosition + scrollXOffset
163
171
  });
164
172
 
165
-
166
173
  // Show dropdown
167
- activates.stop(true, true).css('opacity', 0)
174
+ activates
168
175
  .slideDown({
169
176
  queue: false,
170
177
  duration: curr_options.inDuration,
@@ -177,9 +184,9 @@
177
184
 
178
185
  // Add click close handler to document
179
186
  setTimeout(function() {
180
- $(document).bind('click.'+ activates.attr('id'), function (e) {
187
+ $(document).on('click.'+ activates.attr('id'), function (e) {
181
188
  hideDropdown();
182
- $(document).unbind('click.'+ activates.attr('id'));
189
+ $(document).off('click.'+ activates.attr('id'));
183
190
  });
184
191
  }, 0);
185
192
  }
@@ -190,14 +197,14 @@
190
197
  activates.fadeOut(curr_options.outDuration);
191
198
  activates.removeClass('active');
192
199
  origin.removeClass('active');
193
- $(document).unbind('click.'+ activates.attr('id'));
200
+ $(document).off('click.'+ activates.attr('id'));
194
201
  setTimeout(function() { activates.css('max-height', ''); }, curr_options.outDuration);
195
202
  }
196
203
 
197
204
  // Hover
198
205
  if (curr_options.hover) {
199
206
  var open = false;
200
- origin.unbind('click.' + origin.attr('id'));
207
+ origin.off('click.' + origin.attr('id'));
201
208
  // Hover handler to show dropdown
202
209
  origin.on('mouseenter', function(e){ // Mouse over
203
210
  if (open === false) {
@@ -227,8 +234,8 @@
227
234
  // Click
228
235
  } else {
229
236
  // Click handler to show dropdown
230
- origin.unbind('click.' + origin.attr('id'));
231
- origin.bind('click.'+origin.attr('id'), function(e){
237
+ origin.off('click.' + origin.attr('id'));
238
+ origin.on('click.'+origin.attr('id'), function(e){
232
239
  if (!isFocused) {
233
240
  if ( origin[0] == e.currentTarget &&
234
241
  !origin.hasClass('active') &&
@@ -242,7 +249,7 @@
242
249
  // If origin is clicked and menu is open, close menu
243
250
  else if (origin.hasClass('active')) {
244
251
  hideDropdown();
245
- $(document).unbind('click.'+ activates.attr('id'));
252
+ $(document).off('click.'+ activates.attr('id'));
246
253
  }
247
254
  }
248
255
  });
@@ -259,7 +266,7 @@
259
266
  });
260
267
  }; // End dropdown plugin
261
268
 
262
- $(document).on('turbolinks:load', function(){
269
+ $(document).on('ready turbolinks:load', function(){
263
270
  $('.dropdown-button').dropdown();
264
271
  });
265
272
  }( jQuery ));
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Materialize v0.98.2 (http://materializecss.com)
2
+ * Materialize v0.99.0 (http://materializecss.com)
3
3
  * Copyright 2014-2015 Materialize
4
4
  * MIT License (https://raw.githubusercontent.com/Dogfalo/materialize/master/LICENSE)
5
5
  */
@@ -1 +1 @@
1
- !function(){function a(a){return a.split("").reverse().join("")}function b(a,b,c){if((a[b]||a[c])&&a[b]===a[c])throw Error(b)}function c(b,c,d,e,f,g,h,i,j,k,l,m){h=m;var n,o=l="";return g&&(m=g(m)),!("number"!=typeof m||!isFinite(m))&&(b&&0===parseFloat(m.toFixed(b))&&(m=0),0>m&&(n=!0,m=Math.abs(m)),b&&(g=Math.pow(10,b),m=(Math.round(m*g)/g).toFixed(b)),m=m.toString(),-1!==m.indexOf(".")&&(b=m.split("."),m=b[0],d&&(l=d+b[1])),c&&(m=a(m).match(/.{1,3}/g),m=a(m.join(a(c)))),n&&i&&(o+=i),e&&(o+=e),n&&j&&(o+=j),o=o+m+l,f&&(o+=f),k&&(o=k(o,h)),o)}function d(a,b,c,d,e,f,g,h,i,j,k,l){var m;return a="",k&&(l=k(l)),!(!l||"string"!=typeof l)&&(h&&l.substring(0,h.length)===h&&(l=l.replace(h,""),m=!0),d&&l.substring(0,d.length)===d&&(l=l.replace(d,"")),i&&l.substring(0,i.length)===i&&(l=l.replace(i,""),m=!0),e&&l.slice(-1*e.length)===e&&(l=l.slice(0,-1*e.length)),b&&(l=l.split(b).join("")),c&&(l=l.replace(c,".")),m&&(a+="-"),a=Number((a+l).replace(/[^0-9\.\-.]/g,"")),g&&(a=g(a)),!("number"!=typeof a||!isFinite(a))&&a)}function e(a){var c,d,e,f={};for(c=0;c<h.length;c+=1)d=h[c],e=a[d],void 0===e?f[d]="negative"!==d||f.negativeBefore?"mark"===d&&"."!==f.thousand&&".":"-":"decimals"===d?0<e&&8>e&&(f[d]=e):"encoder"===d||"decoder"===d||"edit"===d||"undo"===d?"function"==typeof e&&(f[d]=e):"string"==typeof e&&(f[d]=e);return b(f,"mark","thousand"),b(f,"prefix","negative"),b(f,"prefix","negativeBefore"),f}function f(a,b,c){var d,e=[];for(d=0;d<h.length;d+=1)e.push(a[h[d]]);return e.push(c),b.apply("",e)}function g(a){return this instanceof g?void("object"==typeof a&&(a=e(a),this.to=function(b){return f(a,c,b)},this.from=function(b){return f(a,d,b)})):new g(a)}var h="decimals thousand mark prefix postfix encoder decoder negativeBefore negative edit undo".split(" ");window.wNumb=g}(),function(a){"function"==typeof define&&define.amd?define([],a):"object"==typeof exports?module.exports=a():window.noUiSlider=a()}(function(){"use strict";function a(a,b){var c=document.createElement("div");return j(c,b),a.appendChild(c),c}function b(a){return a.filter(function(a){return!this[a]&&(this[a]=!0)},{})}function c(a,b){return Math.round(a/b)*b}function d(a,b){var c=a.getBoundingClientRect(),d=a.ownerDocument,e=d.documentElement,f=m();return/webkit.*Chrome.*Mobile/i.test(navigator.userAgent)&&(f.x=0),b?c.top+f.y-e.clientTop:c.left+f.x-e.clientLeft}function e(a){return"number"==typeof a&&!isNaN(a)&&isFinite(a)}function f(a,b,c){c>0&&(j(a,b),setTimeout(function(){k(a,b)},c))}function g(a){return Math.max(Math.min(a,100),0)}function h(a){return Array.isArray(a)?a:[a]}function i(a){a=String(a);var b=a.split(".");return b.length>1?b[1].length:0}function j(a,b){a.classList?a.classList.add(b):a.className+=" "+b}function k(a,b){a.classList?a.classList.remove(b):a.className=a.className.replace(new RegExp("(^|\\b)"+b.split(" ").join("|")+"(\\b|$)","gi")," ")}function l(a,b){return a.classList?a.classList.contains(b):new RegExp("\\b"+b+"\\b").test(a.className)}function m(){var a=void 0!==window.pageXOffset,b="CSS1Compat"===(document.compatMode||""),c=a?window.pageXOffset:b?document.documentElement.scrollLeft:document.body.scrollLeft,d=a?window.pageYOffset:b?document.documentElement.scrollTop:document.body.scrollTop;return{x:c,y:d}}function n(){return window.navigator.pointerEnabled?{start:"pointerdown",move:"pointermove",end:"pointerup"}:window.navigator.msPointerEnabled?{start:"MSPointerDown",move:"MSPointerMove",end:"MSPointerUp"}:{start:"mousedown touchstart",move:"mousemove touchmove",end:"mouseup touchend"}}function o(a,b){return 100/(b-a)}function p(a,b){return 100*b/(a[1]-a[0])}function q(a,b){return p(a,a[0]<0?b+Math.abs(a[0]):b-a[0])}function r(a,b){return b*(a[1]-a[0])/100+a[0]}function s(a,b){for(var c=1;a>=b[c];)c+=1;return c}function t(a,b,c){if(c>=a.slice(-1)[0])return 100;var d,e,f,g,h=s(c,a);return d=a[h-1],e=a[h],f=b[h-1],g=b[h],f+q([d,e],c)/o(f,g)}function u(a,b,c){if(c>=100)return a.slice(-1)[0];var d,e,f,g,h=s(c,b);return d=a[h-1],e=a[h],f=b[h-1],g=b[h],r([d,e],(c-f)*o(f,g))}function v(a,b,d,e){if(100===e)return e;var f,g,h=s(e,a);return d?(f=a[h-1],g=a[h],e-f>(g-f)/2?g:f):b[h-1]?a[h-1]+c(e-a[h-1],b[h-1]):e}function w(a,b,c){var d;if("number"==typeof b&&(b=[b]),"[object Array]"!==Object.prototype.toString.call(b))throw new Error("noUiSlider: 'range' contains invalid value.");if(d="min"===a?0:"max"===a?100:parseFloat(a),!e(d)||!e(b[0]))throw new Error("noUiSlider: 'range' value isn't numeric.");c.xPct.push(d),c.xVal.push(b[0]),d?c.xSteps.push(!isNaN(b[1])&&b[1]):isNaN(b[1])||(c.xSteps[0]=b[1]),c.xHighestCompleteStep.push(0)}function x(a,b,c){if(!b)return!0;c.xSteps[a]=p([c.xVal[a],c.xVal[a+1]],b)/o(c.xPct[a],c.xPct[a+1]);var d=(c.xVal[a+1]-c.xVal[a])/c.xNumSteps[a],e=Math.ceil(Number(d.toFixed(3))-1),f=c.xVal[a]+c.xNumSteps[a]*e;c.xHighestCompleteStep[a]=f}function y(a,b,c,d){this.xPct=[],this.xVal=[],this.xSteps=[d||!1],this.xNumSteps=[!1],this.xHighestCompleteStep=[],this.snap=b,this.direction=c;var e,f=[];for(e in a)a.hasOwnProperty(e)&&f.push([a[e],e]);for(f.length&&"object"==typeof f[0][0]?f.sort(function(a,b){return a[0][0]-b[0][0]}):f.sort(function(a,b){return a[0]-b[0]}),e=0;e<f.length;e++)w(f[e][1],f[e][0],this);for(this.xNumSteps=this.xSteps.slice(0),e=0;e<this.xNumSteps.length;e++)x(e,this.xNumSteps[e],this)}function z(a,b){if(!e(b))throw new Error("noUiSlider: 'step' is not numeric.");a.singleStep=b}function A(a,b){if("object"!=typeof b||Array.isArray(b))throw new Error("noUiSlider: 'range' is not an object.");if(void 0===b.min||void 0===b.max)throw new Error("noUiSlider: Missing 'min' or 'max' in 'range'.");if(b.min===b.max)throw new Error("noUiSlider: 'range' 'min' and 'max' cannot be equal.");a.spectrum=new y(b,a.snap,a.dir,a.singleStep)}function B(a,b){if(b=h(b),!Array.isArray(b)||!b.length)throw new Error("noUiSlider: 'start' option is incorrect.");a.handles=b.length,a.start=b}function C(a,b){if(a.snap=b,"boolean"!=typeof b)throw new Error("noUiSlider: 'snap' option must be a boolean.")}function D(a,b){if(a.animate=b,"boolean"!=typeof b)throw new Error("noUiSlider: 'animate' option must be a boolean.")}function E(a,b){if(a.animationDuration=b,"number"!=typeof b)throw new Error("noUiSlider: 'animationDuration' option must be a number.")}function F(a,b){var c,d=[!1];if("lower"===b?b=[!0,!1]:"upper"===b&&(b=[!1,!0]),b===!0||b===!1){for(c=1;c<a.handles;c++)d.push(b);d.push(!1)}else{if(!Array.isArray(b)||!b.length||b.length!==a.handles+1)throw new Error("noUiSlider: 'connect' option doesn't match handle count.");d=b}a.connect=d}function G(a,b){switch(b){case"horizontal":a.ort=0;break;case"vertical":a.ort=1;break;default:throw new Error("noUiSlider: 'orientation' option is invalid.")}}function H(a,b){if(!e(b))throw new Error("noUiSlider: 'margin' option must be numeric.");if(0!==b&&(a.margin=a.spectrum.getMargin(b),!a.margin))throw new Error("noUiSlider: 'margin' option is only supported on linear sliders.")}function I(a,b){if(!e(b))throw new Error("noUiSlider: 'limit' option must be numeric.");if(a.limit=a.spectrum.getMargin(b),!a.limit||a.handles<2)throw new Error("noUiSlider: 'limit' option is only supported on linear sliders with 2 or more handles.")}function J(a,b){if(!e(b))throw new Error("noUiSlider: 'padding' option must be numeric.");if(0!==b){if(a.padding=a.spectrum.getMargin(b),!a.padding)throw new Error("noUiSlider: 'padding' option is only supported on linear sliders.");if(a.padding<0)throw new Error("noUiSlider: 'padding' option must be a positive number.");if(a.padding>=50)throw new Error("noUiSlider: 'padding' option must be less than half the range.")}}function K(a,b){switch(b){case"ltr":a.dir=0;break;case"rtl":a.dir=1;break;default:throw new Error("noUiSlider: 'direction' option was not recognized.")}}function L(a,b){if("string"!=typeof b)throw new Error("noUiSlider: 'behaviour' must be a string containing options.");var c=b.indexOf("tap")>=0,d=b.indexOf("drag")>=0,e=b.indexOf("fixed")>=0,f=b.indexOf("snap")>=0,g=b.indexOf("hover")>=0;if(e){if(2!==a.handles)throw new Error("noUiSlider: 'fixed' behaviour must be used with 2 handles");H(a,a.start[1]-a.start[0])}a.events={tap:c||f,drag:d,fixed:e,snap:f,hover:g}}function M(a,b){if(b!==!1)if(b===!0){a.tooltips=[];for(var c=0;c<a.handles;c++)a.tooltips.push(!0)}else{if(a.tooltips=h(b),a.tooltips.length!==a.handles)throw new Error("noUiSlider: must pass a formatter for all handles.");a.tooltips.forEach(function(a){if("boolean"!=typeof a&&("object"!=typeof a||"function"!=typeof a.to))throw new Error("noUiSlider: 'tooltips' must be passed a formatter or 'false'.")})}}function N(a,b){if(a.format=b,"function"==typeof b.to&&"function"==typeof b.from)return!0;throw new Error("noUiSlider: 'format' requires 'to' and 'from' methods.")}function O(a,b){if(void 0!==b&&"string"!=typeof b&&b!==!1)throw new Error("noUiSlider: 'cssPrefix' must be a string or `false`.");a.cssPrefix=b}function P(a,b){if(void 0!==b&&"object"!=typeof b)throw new Error("noUiSlider: 'cssClasses' must be an object.");if("string"==typeof a.cssPrefix){a.cssClasses={};for(var c in b)b.hasOwnProperty(c)&&(a.cssClasses[c]=a.cssPrefix+b[c])}else a.cssClasses=b}function Q(a,b){if(b!==!0&&b!==!1)throw new Error("noUiSlider: 'useRequestAnimationFrame' option should be true (default) or false.");a.useRequestAnimationFrame=b}function R(a){var b={margin:0,limit:0,padding:0,animate:!0,animationDuration:300,format:U},c={step:{r:!1,t:z},start:{r:!0,t:B},connect:{r:!0,t:F},direction:{r:!0,t:K},snap:{r:!1,t:C},animate:{r:!1,t:D},animationDuration:{r:!1,t:E},range:{r:!0,t:A},orientation:{r:!1,t:G},margin:{r:!1,t:H},limit:{r:!1,t:I},padding:{r:!1,t:J},behaviour:{r:!0,t:L},format:{r:!1,t:N},tooltips:{r:!1,t:M},cssPrefix:{r:!1,t:O},cssClasses:{r:!1,t:P},useRequestAnimationFrame:{r:!1,t:Q}},d={connect:!1,direction:"ltr",behaviour:"tap",orientation:"horizontal",cssPrefix:"noUi-",cssClasses:{target:"target",base:"base",origin:"origin",handle:"handle",handleLower:"handle-lower",handleUpper:"handle-upper",horizontal:"horizontal",vertical:"vertical",background:"background",connect:"connect",ltr:"ltr",rtl:"rtl",draggable:"draggable",drag:"state-drag",tap:"state-tap",active:"active",tooltip:"tooltip",pips:"pips",pipsHorizontal:"pips-horizontal",pipsVertical:"pips-vertical",marker:"marker",markerHorizontal:"marker-horizontal",markerVertical:"marker-vertical",markerNormal:"marker-normal",markerLarge:"marker-large",markerSub:"marker-sub",value:"value",valueHorizontal:"value-horizontal",valueVertical:"value-vertical",valueNormal:"value-normal",valueLarge:"value-large",valueSub:"value-sub"},useRequestAnimationFrame:!0};Object.keys(c).forEach(function(e){if(void 0===a[e]&&void 0===d[e]){if(c[e].r)throw new Error("noUiSlider: '"+e+"' is required.");return!0}c[e].t(b,void 0===a[e]?d[e]:a[e])}),b.pips=a.pips;var e=[["left","top"],["right","bottom"]];return b.style=e[b.dir][b.ort],b.styleOposite=e[b.dir?0:1][b.ort],b}function S(c,e,i){function o(b,c){var d=a(b,e.cssClasses.origin),f=a(d,e.cssClasses.handle);return f.setAttribute("data-handle",c),0===c?j(f,e.cssClasses.handleLower):c===e.handles-1&&j(f,e.cssClasses.handleUpper),d}function p(b,c){return!!c&&a(b,e.cssClasses.connect)}function q(a,b){ba=[],ca=[],ca.push(p(b,a[0]));for(var c=0;c<e.handles;c++)ba.push(o(b,c)),ha[c]=c,ca.push(p(b,a[c+1]))}function r(b){j(b,e.cssClasses.target),0===e.dir?j(b,e.cssClasses.ltr):j(b,e.cssClasses.rtl),0===e.ort?j(b,e.cssClasses.horizontal):j(b,e.cssClasses.vertical),aa=a(b,e.cssClasses.base)}function s(b,c){return!!e.tooltips[c]&&a(b.firstChild,e.cssClasses.tooltip)}function t(){var a=ba.map(s);Z("update",function(b,c,d){if(a[c]){var f=b[c];e.tooltips[c]!==!0&&(f=e.tooltips[c].to(d[c])),a[c].innerHTML="<span>"+f+"</span>"}})}function u(a,b,c){if("range"===a||"steps"===a)return ja.xVal;if("count"===a){var d,e=100/(b-1),f=0;for(b=[];(d=f++*e)<=100;)b.push(d);a="positions"}return"positions"===a?b.map(function(a){return ja.fromStepping(c?ja.getStep(a):a)}):"values"===a?c?b.map(function(a){return ja.fromStepping(ja.getStep(ja.toStepping(a)))}):b:void 0}function v(a,c,d){function e(a,b){return(a+b).toFixed(7)/1}var f={},g=ja.xVal[0],h=ja.xVal[ja.xVal.length-1],i=!1,j=!1,k=0;return d=b(d.slice().sort(function(a,b){return a-b})),d[0]!==g&&(d.unshift(g),i=!0),d[d.length-1]!==h&&(d.push(h),j=!0),d.forEach(function(b,g){var h,l,m,n,o,p,q,r,s,t,u=b,v=d[g+1];if("steps"===c&&(h=ja.xNumSteps[g]),h||(h=v-u),u!==!1&&void 0!==v)for(h=Math.max(h,1e-7),l=u;l<=v;l=e(l,h)){for(n=ja.toStepping(l),o=n-k,r=o/a,s=Math.round(r),t=o/s,m=1;m<=s;m+=1)p=k+m*t,f[p.toFixed(5)]=["x",0];q=d.indexOf(l)>-1?1:"steps"===c?2:0,!g&&i&&(q=0),l===v&&j||(f[n.toFixed(5)]=[l,q]),k=n}}),f}function w(a,b,c){function d(a,b){var c=b===e.cssClasses.value,d=c?m:n,f=c?k:l;return b+" "+d[e.ort]+" "+f[a]}function f(a,b,c){return'class="'+d(c[1],b)+'" style="'+e.style+": "+a+'%"'}function g(a,d){d[1]=d[1]&&b?b(d[0],d[1]):d[1],i+="<div "+f(a,e.cssClasses.marker,d)+"></div>",d[1]&&(i+="<div "+f(a,e.cssClasses.value,d)+">"+c.to(d[0])+"</div>")}var h=document.createElement("div"),i="",k=[e.cssClasses.valueNormal,e.cssClasses.valueLarge,e.cssClasses.valueSub],l=[e.cssClasses.markerNormal,e.cssClasses.markerLarge,e.cssClasses.markerSub],m=[e.cssClasses.valueHorizontal,e.cssClasses.valueVertical],n=[e.cssClasses.markerHorizontal,e.cssClasses.markerVertical];return j(h,e.cssClasses.pips),j(h,0===e.ort?e.cssClasses.pipsHorizontal:e.cssClasses.pipsVertical),Object.keys(a).forEach(function(b){g(b,a[b])}),h.innerHTML=i,h}function x(a){var b=a.mode,c=a.density||1,d=a.filter||!1,e=a.values||!1,f=a.stepped||!1,g=u(b,e,f),h=v(c,b,g),i=a.format||{to:Math.round};return fa.appendChild(w(h,d,i))}function y(){var a=aa.getBoundingClientRect(),b="offset"+["Width","Height"][e.ort];return 0===e.ort?a.width||aa[b]:a.height||aa[b]}function z(a,b,c,d){var f=function(b){return!fa.hasAttribute("disabled")&&(!l(fa,e.cssClasses.tap)&&(!!(b=A(b,d.pageOffset))&&(!(a===ea.start&&void 0!==b.buttons&&b.buttons>1)&&((!d.hover||!b.buttons)&&(b.calcPoint=b.points[e.ort],void c(b,d))))))},g=[];return a.split(" ").forEach(function(a){b.addEventListener(a,f,!1),g.push([a,f])}),g}function A(a,b){a.preventDefault();var c,d,e=0===a.type.indexOf("touch"),f=0===a.type.indexOf("mouse"),g=0===a.type.indexOf("pointer");if(0===a.type.indexOf("MSPointer")&&(g=!0),e){if(a.touches.length>1)return!1;c=a.changedTouches[0].pageX,d=a.changedTouches[0].pageY}return b=b||m(),(f||g)&&(c=a.clientX+b.x,d=a.clientY+b.y),a.pageOffset=b,a.points=[c,d],a.cursor=f||g,a}function B(a){var b=a-d(aa,e.ort),c=100*b/y();return e.dir?100-c:c}function C(a){var b=100,c=!1;return ba.forEach(function(d,e){if(!d.hasAttribute("disabled")){var f=Math.abs(ga[e]-a);f<b&&(c=e,b=f)}}),c}function D(a,b,c,d){var e=c.slice(),f=[!a,a],g=[a,!a];d=d.slice(),a&&d.reverse(),d.length>1?d.forEach(function(a,c){var d=M(e,a,e[a]+b,f[c],g[c]);d===!1?b=0:(b=d-e[a],e[a]=d)}):f=g=[!0];var h=!1;d.forEach(function(a,d){h=Q(a,c[a]+b,f[d],g[d])||h}),h&&d.forEach(function(a){E("update",a),E("slide",a)})}function E(a,b,c){Object.keys(la).forEach(function(d){var f=d.split(".")[0];a===f&&la[d].forEach(function(a){a.call(da,ka.map(e.format.to),b,ka.slice(),c||!1,ga.slice())})})}function F(a,b){"mouseout"===a.type&&"HTML"===a.target.nodeName&&null===a.relatedTarget&&H(a,b)}function G(a,b){if(navigator.appVersion.indexOf("MSIE 9")===-1&&0===a.buttons&&0!==b.buttonsProperty)return H(a,b);var c=(e.dir?-1:1)*(a.calcPoint-b.startCalcPoint),d=100*c/b.baseSize;D(c>0,d,b.locations,b.handleNumbers)}function H(a,b){ia&&(k(ia,e.cssClasses.active),ia=!1),a.cursor&&(document.body.style.cursor="",document.body.removeEventListener("selectstart",document.body.noUiListener)),document.documentElement.noUiListeners.forEach(function(a){document.documentElement.removeEventListener(a[0],a[1])}),k(fa,e.cssClasses.drag),P(),b.handleNumbers.forEach(function(a){E("set",a),E("change",a),E("end",a)})}function I(a,b){if(1===b.handleNumbers.length){var c=ba[b.handleNumbers[0]];if(c.hasAttribute("disabled"))return!1;ia=c.children[0],j(ia,e.cssClasses.active)}a.preventDefault(),a.stopPropagation();var d=z(ea.move,document.documentElement,G,{startCalcPoint:a.calcPoint,baseSize:y(),pageOffset:a.pageOffset,handleNumbers:b.handleNumbers,buttonsProperty:a.buttons,locations:ga.slice()}),f=z(ea.end,document.documentElement,H,{handleNumbers:b.handleNumbers}),g=z("mouseout",document.documentElement,F,{handleNumbers:b.handleNumbers});if(document.documentElement.noUiListeners=d.concat(f,g),a.cursor){document.body.style.cursor=getComputedStyle(a.target).cursor,ba.length>1&&j(fa,e.cssClasses.drag);var h=function(){return!1};document.body.noUiListener=h,document.body.addEventListener("selectstart",h,!1)}b.handleNumbers.forEach(function(a){E("start",a)})}function J(a){a.stopPropagation();var b=B(a.calcPoint),c=C(b);return c!==!1&&(e.events.snap||f(fa,e.cssClasses.tap,e.animationDuration),Q(c,b,!0,!0),P(),E("slide",c,!0),E("set",c,!0),E("change",c,!0),E("update",c,!0),void(e.events.snap&&I(a,{handleNumbers:[c]})))}function K(a){var b=B(a.calcPoint),c=ja.getStep(b),d=ja.fromStepping(c);Object.keys(la).forEach(function(a){"hover"===a.split(".")[0]&&la[a].forEach(function(a){a.call(da,d)})})}function L(a){a.fixed||ba.forEach(function(a,b){z(ea.start,a.children[0],I,{handleNumbers:[b]})}),a.tap&&z(ea.start,aa,J,{}),a.hover&&z(ea.move,aa,K,{hover:!0}),a.drag&&ca.forEach(function(b,c){if(b!==!1&&0!==c&&c!==ca.length-1){var d=ba[c-1],f=ba[c],g=[b];j(b,e.cssClasses.draggable),a.fixed&&(g.push(d.children[0]),g.push(f.children[0])),g.forEach(function(a){z(ea.start,a,I,{handles:[d,f],handleNumbers:[c-1,c]})})}})}function M(a,b,c,d,f){return ba.length>1&&(d&&b>0&&(c=Math.max(c,a[b-1]+e.margin)),f&&b<ba.length-1&&(c=Math.min(c,a[b+1]-e.margin))),ba.length>1&&e.limit&&(d&&b>0&&(c=Math.min(c,a[b-1]+e.limit)),f&&b<ba.length-1&&(c=Math.max(c,a[b+1]-e.limit))),e.padding&&(0===b&&(c=Math.max(c,e.padding)),b===ba.length-1&&(c=Math.min(c,100-e.padding))),c=ja.getStep(c),c=g(c),c!==a[b]&&c}function N(a){return a+"%"}function O(a,b){ga[a]=b,ka[a]=ja.fromStepping(b);var c=function(){ba[a].style[e.style]=N(b),S(a),S(a+1)};window.requestAnimationFrame&&e.useRequestAnimationFrame?window.requestAnimationFrame(c):c()}function P(){ha.forEach(function(a){var b=ga[a]>50?-1:1,c=3+(ba.length+b*a);ba[a].childNodes[0].style.zIndex=c})}function Q(a,b,c,d){return b=M(ga,a,b,c,d),b!==!1&&(O(a,b),!0)}function S(a){if(ca[a]){var b=0,c=100;0!==a&&(b=ga[a-1]),a!==ca.length-1&&(c=ga[a]),ca[a].style[e.style]=N(b),ca[a].style[e.styleOposite]=N(100-c)}}function T(a,b){null!==a&&a!==!1&&("number"==typeof a&&(a=String(a)),a=e.format.from(a),a===!1||isNaN(a)||Q(b,ja.toStepping(a),!1,!1))}function U(a,b){var c=h(a),d=void 0===ga[0];b=void 0===b||!!b,c.forEach(T),e.animate&&!d&&f(fa,e.cssClasses.tap,e.animationDuration),ha.forEach(function(a){Q(a,ga[a],!0,!1)}),P(),ha.forEach(function(a){E("update",a),null!==c[a]&&b&&E("set",a)})}function V(a){U(e.start,a)}function W(){var a=ka.map(e.format.to);return 1===a.length?a[0]:a}function X(){for(var a in e.cssClasses)e.cssClasses.hasOwnProperty(a)&&k(fa,e.cssClasses[a]);for(;fa.firstChild;)fa.removeChild(fa.firstChild);delete fa.noUiSlider}function Y(){return ga.map(function(a,b){var c=ja.getNearbySteps(a),d=ka[b],e=c.thisStep.step,f=null;e!==!1&&d+e>c.stepAfter.startValue&&(e=c.stepAfter.startValue-d),f=d>c.thisStep.startValue?c.thisStep.step:c.stepBefore.step!==!1&&d-c.stepBefore.highestStep,100===a?e=null:0===a&&(f=null);var g=ja.countStepDecimals();return null!==e&&e!==!1&&(e=Number(e.toFixed(g))),null!==f&&f!==!1&&(f=Number(f.toFixed(g))),[f,e]})}function Z(a,b){la[a]=la[a]||[],la[a].push(b),"update"===a.split(".")[0]&&ba.forEach(function(a,b){E("update",b)})}function $(a){var b=a&&a.split(".")[0],c=b&&a.substring(b.length);Object.keys(la).forEach(function(a){var d=a.split(".")[0],e=a.substring(d.length);b&&b!==d||c&&c!==e||delete la[a]})}function _(a,b){var c=W(),d=["margin","limit","padding","range","animate","snap","step","format"];d.forEach(function(b){void 0!==a[b]&&(i[b]=a[b])});var f=R(i);d.forEach(function(b){void 0!==a[b]&&(e[b]=f[b])}),f.spectrum.direction=ja.direction,ja=f.spectrum,e.margin=f.margin,e.limit=f.limit,e.padding=f.padding,ga=[],U(a.start||c,b)}var aa,ba,ca,da,ea=n(),fa=c,ga=[],ha=[],ia=!1,ja=e.spectrum,ka=[],la={};if(fa.noUiSlider)throw new Error("Slider was already initialized.");return r(fa),q(e.connect,aa),da={destroy:X,steps:Y,on:Z,off:$,get:W,set:U,reset:V,__moveHandles:function(a,b,c){D(a,b,ga,c)},options:i,updateOptions:_,target:fa,pips:x},L(e.events),U(e.start),e.pips&&x(e.pips),e.tooltips&&t(),da}function T(a,b){if(!a.nodeName)throw new Error("noUiSlider.create requires a single element.");void 0===b.tooltips&&(b.tooltips=!0);var c=R(b,a),d=S(a,c,b);return a.noUiSlider=d,d}y.prototype.getMargin=function(a){var b=this.xNumSteps[0];if(b&&a/b%1!==0)throw new Error("noUiSlider: 'limit', 'margin' and 'padding' must be divisible by step.");return 2===this.xPct.length&&p(this.xVal,a)},y.prototype.toStepping=function(a){return a=t(this.xVal,this.xPct,a)},y.prototype.fromStepping=function(a){return u(this.xVal,this.xPct,a)},y.prototype.getStep=function(a){return a=v(this.xPct,this.xSteps,this.snap,a)},y.prototype.getNearbySteps=function(a){var b=s(a,this.xPct);return{stepBefore:{startValue:this.xVal[b-2],step:this.xNumSteps[b-2],highestStep:this.xHighestCompleteStep[b-2]},thisStep:{startValue:this.xVal[b-1],step:this.xNumSteps[b-1],highestStep:this.xHighestCompleteStep[b-1]},stepAfter:{startValue:this.xVal[b-0],step:this.xNumSteps[b-0],highestStep:this.xHighestCompleteStep[b-0]}}},y.prototype.countStepDecimals=function(){var a=this.xNumSteps.map(i);return Math.max.apply(null,a)},y.prototype.convert=function(a){return this.getStep(this.toStepping(a))};var U={to:function(a){return void 0!==a&&a.toFixed(2)},from:Number};return{create:T}});
1
+ !function(){function a(a){return a.split("").reverse().join("")}function b(a,b,c){if((a[b]||a[c])&&a[b]===a[c])throw Error(b)}function c(b,c,d,e,f,g,h,i,j,k,l,m){h=m;var n,o=l="";return g&&(m=g(m)),!("number"!=typeof m||!isFinite(m))&&(b&&0===parseFloat(m.toFixed(b))&&(m=0),0>m&&(n=!0,m=Math.abs(m)),b&&(g=Math.pow(10,b),m=(Math.round(m*g)/g).toFixed(b)),m=m.toString(),-1!==m.indexOf(".")&&(b=m.split("."),m=b[0],d&&(l=d+b[1])),c&&(m=a(m).match(/.{1,3}/g),m=a(m.join(a(c)))),n&&i&&(o+=i),e&&(o+=e),n&&j&&(o+=j),o=o+m+l,f&&(o+=f),k&&(o=k(o,h)),o)}function d(a,b,c,d,e,f,g,h,i,j,k,l){var m;return a="",k&&(l=k(l)),!(!l||"string"!=typeof l)&&(h&&l.substring(0,h.length)===h&&(l=l.replace(h,""),m=!0),d&&l.substring(0,d.length)===d&&(l=l.replace(d,"")),i&&l.substring(0,i.length)===i&&(l=l.replace(i,""),m=!0),e&&l.slice(-1*e.length)===e&&(l=l.slice(0,-1*e.length)),b&&(l=l.split(b).join("")),c&&(l=l.replace(c,".")),m&&(a+="-"),a=Number((a+l).replace(/[^0-9\.\-.]/g,"")),g&&(a=g(a)),!("number"!=typeof a||!isFinite(a))&&a)}function e(a){var c,d,e,f={};for(c=0;c<h.length;c+=1)d=h[c],e=a[d],void 0===e?f[d]="negative"!==d||f.negativeBefore?"mark"===d&&"."!==f.thousand&&".":"-":"decimals"===d?0<e&&8>e&&(f[d]=e):"encoder"===d||"decoder"===d||"edit"===d||"undo"===d?"function"==typeof e&&(f[d]=e):"string"==typeof e&&(f[d]=e);return b(f,"mark","thousand"),b(f,"prefix","negative"),b(f,"prefix","negativeBefore"),f}function f(a,b,c){var d,e=[];for(d=0;d<h.length;d+=1)e.push(a[h[d]]);return e.push(c),b.apply("",e)}function g(a){if(!(this instanceof g))return new g(a);"object"==typeof a&&(a=e(a),this.to=function(b){return f(a,c,b)},this.from=function(b){return f(a,d,b)})}var h="decimals thousand mark prefix postfix encoder decoder negativeBefore negative edit undo".split(" ");window.wNumb=g}(),function(a){"function"==typeof define&&define.amd?define([],a):"object"==typeof exports?module.exports=a():window.noUiSlider=a()}(function(){"use strict";function a(a,b){var c=document.createElement("div");return j(c,b),a.appendChild(c),c}function b(a){return a.filter(function(a){return!this[a]&&(this[a]=!0)},{})}function c(a,b){return Math.round(a/b)*b}function d(a,b){var c=a.getBoundingClientRect(),d=a.ownerDocument,e=d.documentElement,f=m();return/webkit.*Chrome.*Mobile/i.test(navigator.userAgent)&&(f.x=0),b?c.top+f.y-e.clientTop:c.left+f.x-e.clientLeft}function e(a){return"number"==typeof a&&!isNaN(a)&&isFinite(a)}function f(a,b,c){c>0&&(j(a,b),setTimeout(function(){k(a,b)},c))}function g(a){return Math.max(Math.min(a,100),0)}function h(a){return Array.isArray(a)?a:[a]}function i(a){a=String(a);var b=a.split(".");return b.length>1?b[1].length:0}function j(a,b){a.classList?a.classList.add(b):a.className+=" "+b}function k(a,b){a.classList?a.classList.remove(b):a.className=a.className.replace(new RegExp("(^|\\b)"+b.split(" ").join("|")+"(\\b|$)","gi")," ")}function l(a,b){return a.classList?a.classList.contains(b):new RegExp("\\b"+b+"\\b").test(a.className)}function m(){var a=void 0!==window.pageXOffset,b="CSS1Compat"===(document.compatMode||"");return{x:a?window.pageXOffset:b?document.documentElement.scrollLeft:document.body.scrollLeft,y:a?window.pageYOffset:b?document.documentElement.scrollTop:document.body.scrollTop}}function n(){return window.navigator.pointerEnabled?{start:"pointerdown",move:"pointermove",end:"pointerup"}:window.navigator.msPointerEnabled?{start:"MSPointerDown",move:"MSPointerMove",end:"MSPointerUp"}:{start:"mousedown touchstart",move:"mousemove touchmove",end:"mouseup touchend"}}function o(a,b){return 100/(b-a)}function p(a,b){return 100*b/(a[1]-a[0])}function q(a,b){return p(a,a[0]<0?b+Math.abs(a[0]):b-a[0])}function r(a,b){return b*(a[1]-a[0])/100+a[0]}function s(a,b){for(var c=1;a>=b[c];)c+=1;return c}function t(a,b,c){if(c>=a.slice(-1)[0])return 100;var d,e,f,g,h=s(c,a);return d=a[h-1],e=a[h],f=b[h-1],g=b[h],f+q([d,e],c)/o(f,g)}function u(a,b,c){if(c>=100)return a.slice(-1)[0];var d,e,f,g,h=s(c,b);return d=a[h-1],e=a[h],f=b[h-1],g=b[h],r([d,e],(c-f)*o(f,g))}function v(a,b,d,e){if(100===e)return e;var f,g,h=s(e,a);return d?(f=a[h-1],g=a[h],e-f>(g-f)/2?g:f):b[h-1]?a[h-1]+c(e-a[h-1],b[h-1]):e}function w(a,b,c){var d;if("number"==typeof b&&(b=[b]),"[object Array]"!==Object.prototype.toString.call(b))throw new Error("noUiSlider: 'range' contains invalid value.");if(d="min"===a?0:"max"===a?100:parseFloat(a),!e(d)||!e(b[0]))throw new Error("noUiSlider: 'range' value isn't numeric.");c.xPct.push(d),c.xVal.push(b[0]),d?c.xSteps.push(!isNaN(b[1])&&b[1]):isNaN(b[1])||(c.xSteps[0]=b[1]),c.xHighestCompleteStep.push(0)}function x(a,b,c){if(!b)return!0;c.xSteps[a]=p([c.xVal[a],c.xVal[a+1]],b)/o(c.xPct[a],c.xPct[a+1]);var d=(c.xVal[a+1]-c.xVal[a])/c.xNumSteps[a],e=Math.ceil(Number(d.toFixed(3))-1),f=c.xVal[a]+c.xNumSteps[a]*e;c.xHighestCompleteStep[a]=f}function y(a,b,c,d){this.xPct=[],this.xVal=[],this.xSteps=[d||!1],this.xNumSteps=[!1],this.xHighestCompleteStep=[],this.snap=b,this.direction=c;var e,f=[];for(e in a)a.hasOwnProperty(e)&&f.push([a[e],e]);for(f.length&&"object"==typeof f[0][0]?f.sort(function(a,b){return a[0][0]-b[0][0]}):f.sort(function(a,b){return a[0]-b[0]}),e=0;e<f.length;e++)w(f[e][1],f[e][0],this);for(this.xNumSteps=this.xSteps.slice(0),e=0;e<this.xNumSteps.length;e++)x(e,this.xNumSteps[e],this)}function z(a,b){if(!e(b))throw new Error("noUiSlider: 'step' is not numeric.");a.singleStep=b}function A(a,b){if("object"!=typeof b||Array.isArray(b))throw new Error("noUiSlider: 'range' is not an object.");if(void 0===b.min||void 0===b.max)throw new Error("noUiSlider: Missing 'min' or 'max' in 'range'.");if(b.min===b.max)throw new Error("noUiSlider: 'range' 'min' and 'max' cannot be equal.");a.spectrum=new y(b,a.snap,a.dir,a.singleStep)}function B(a,b){if(b=h(b),!Array.isArray(b)||!b.length)throw new Error("noUiSlider: 'start' option is incorrect.");a.handles=b.length,a.start=b}function C(a,b){if(a.snap=b,"boolean"!=typeof b)throw new Error("noUiSlider: 'snap' option must be a boolean.")}function D(a,b){if(a.animate=b,"boolean"!=typeof b)throw new Error("noUiSlider: 'animate' option must be a boolean.")}function E(a,b){if(a.animationDuration=b,"number"!=typeof b)throw new Error("noUiSlider: 'animationDuration' option must be a number.")}function F(a,b){var c,d=[!1];if("lower"===b?b=[!0,!1]:"upper"===b&&(b=[!1,!0]),!0===b||!1===b){for(c=1;c<a.handles;c++)d.push(b);d.push(!1)}else{if(!Array.isArray(b)||!b.length||b.length!==a.handles+1)throw new Error("noUiSlider: 'connect' option doesn't match handle count.");d=b}a.connect=d}function G(a,b){switch(b){case"horizontal":a.ort=0;break;case"vertical":a.ort=1;break;default:throw new Error("noUiSlider: 'orientation' option is invalid.")}}function H(a,b){if(!e(b))throw new Error("noUiSlider: 'margin' option must be numeric.");if(0!==b&&(a.margin=a.spectrum.getMargin(b),!a.margin))throw new Error("noUiSlider: 'margin' option is only supported on linear sliders.")}function I(a,b){if(!e(b))throw new Error("noUiSlider: 'limit' option must be numeric.");if(a.limit=a.spectrum.getMargin(b),!a.limit||a.handles<2)throw new Error("noUiSlider: 'limit' option is only supported on linear sliders with 2 or more handles.")}function J(a,b){if(!e(b))throw new Error("noUiSlider: 'padding' option must be numeric.");if(0!==b){if(a.padding=a.spectrum.getMargin(b),!a.padding)throw new Error("noUiSlider: 'padding' option is only supported on linear sliders.");if(a.padding<0)throw new Error("noUiSlider: 'padding' option must be a positive number.");if(a.padding>=50)throw new Error("noUiSlider: 'padding' option must be less than half the range.")}}function K(a,b){switch(b){case"ltr":a.dir=0;break;case"rtl":a.dir=1;break;default:throw new Error("noUiSlider: 'direction' option was not recognized.")}}function L(a,b){if("string"!=typeof b)throw new Error("noUiSlider: 'behaviour' must be a string containing options.");var c=b.indexOf("tap")>=0,d=b.indexOf("drag")>=0,e=b.indexOf("fixed")>=0,f=b.indexOf("snap")>=0,g=b.indexOf("hover")>=0;if(e){if(2!==a.handles)throw new Error("noUiSlider: 'fixed' behaviour must be used with 2 handles");H(a,a.start[1]-a.start[0])}a.events={tap:c||f,drag:d,fixed:e,snap:f,hover:g}}function M(a,b){if(!1!==b)if(!0===b){a.tooltips=[];for(var c=0;c<a.handles;c++)a.tooltips.push(!0)}else{if(a.tooltips=h(b),a.tooltips.length!==a.handles)throw new Error("noUiSlider: must pass a formatter for all handles.");a.tooltips.forEach(function(a){if("boolean"!=typeof a&&("object"!=typeof a||"function"!=typeof a.to))throw new Error("noUiSlider: 'tooltips' must be passed a formatter or 'false'.")})}}function N(a,b){if(a.format=b,"function"==typeof b.to&&"function"==typeof b.from)return!0;throw new Error("noUiSlider: 'format' requires 'to' and 'from' methods.")}function O(a,b){if(void 0!==b&&"string"!=typeof b&&!1!==b)throw new Error("noUiSlider: 'cssPrefix' must be a string or `false`.");a.cssPrefix=b}function P(a,b){if(void 0!==b&&"object"!=typeof b)throw new Error("noUiSlider: 'cssClasses' must be an object.");if("string"==typeof a.cssPrefix){a.cssClasses={};for(var c in b)b.hasOwnProperty(c)&&(a.cssClasses[c]=a.cssPrefix+b[c])}else a.cssClasses=b}function Q(a,b){if(!0!==b&&!1!==b)throw new Error("noUiSlider: 'useRequestAnimationFrame' option should be true (default) or false.");a.useRequestAnimationFrame=b}function R(a){var b={margin:0,limit:0,padding:0,animate:!0,animationDuration:300,format:U},c={step:{r:!1,t:z},start:{r:!0,t:B},connect:{r:!0,t:F},direction:{r:!0,t:K},snap:{r:!1,t:C},animate:{r:!1,t:D},animationDuration:{r:!1,t:E},range:{r:!0,t:A},orientation:{r:!1,t:G},margin:{r:!1,t:H},limit:{r:!1,t:I},padding:{r:!1,t:J},behaviour:{r:!0,t:L},format:{r:!1,t:N},tooltips:{r:!1,t:M},cssPrefix:{r:!1,t:O},cssClasses:{r:!1,t:P},useRequestAnimationFrame:{r:!1,t:Q}},d={connect:!1,direction:"ltr",behaviour:"tap",orientation:"horizontal",cssPrefix:"noUi-",cssClasses:{target:"target",base:"base",origin:"origin",handle:"handle",handleLower:"handle-lower",handleUpper:"handle-upper",horizontal:"horizontal",vertical:"vertical",background:"background",connect:"connect",ltr:"ltr",rtl:"rtl",draggable:"draggable",drag:"state-drag",tap:"state-tap",active:"active",tooltip:"tooltip",pips:"pips",pipsHorizontal:"pips-horizontal",pipsVertical:"pips-vertical",marker:"marker",markerHorizontal:"marker-horizontal",markerVertical:"marker-vertical",markerNormal:"marker-normal",markerLarge:"marker-large",markerSub:"marker-sub",value:"value",valueHorizontal:"value-horizontal",valueVertical:"value-vertical",valueNormal:"value-normal",valueLarge:"value-large",valueSub:"value-sub"},useRequestAnimationFrame:!0};Object.keys(c).forEach(function(e){if(void 0===a[e]&&void 0===d[e]){if(c[e].r)throw new Error("noUiSlider: '"+e+"' is required.");return!0}c[e].t(b,void 0===a[e]?d[e]:a[e])}),b.pips=a.pips;var e=[["left","top"],["right","bottom"]];return b.style=e[b.dir][b.ort],b.styleOposite=e[b.dir?0:1][b.ort],b}function S(c,e,i){function o(b,c){var d=a(b,e.cssClasses.origin),f=a(d,e.cssClasses.handle);return f.setAttribute("data-handle",c),0===c?j(f,e.cssClasses.handleLower):c===e.handles-1&&j(f,e.cssClasses.handleUpper),d}function p(b,c){return!!c&&a(b,e.cssClasses.connect)}function q(b,c){return!!e.tooltips[c]&&a(b.firstChild,e.cssClasses.tooltip)}function r(a,b,c){if("range"===a||"steps"===a)return fa.xVal;if("count"===a){var d,e=100/(b-1),f=0;for(b=[];(d=f++*e)<=100;)b.push(d);a="positions"}return"positions"===a?b.map(function(a){return fa.fromStepping(c?fa.getStep(a):a)}):"values"===a?c?b.map(function(a){return fa.fromStepping(fa.getStep(fa.toStepping(a)))}):b:void 0}function s(a,c,d){function e(a,b){return(a+b).toFixed(7)/1}var f={},g=fa.xVal[0],h=fa.xVal[fa.xVal.length-1],i=!1,j=!1,k=0;return d=b(d.slice().sort(function(a,b){return a-b})),d[0]!==g&&(d.unshift(g),i=!0),d[d.length-1]!==h&&(d.push(h),j=!0),d.forEach(function(b,g){var h,l,m,n,o,p,q,r,s,t,u=b,v=d[g+1];if("steps"===c&&(h=fa.xNumSteps[g]),h||(h=v-u),!1!==u&&void 0!==v)for(h=Math.max(h,1e-7),l=u;l<=v;l=e(l,h)){for(n=fa.toStepping(l),o=n-k,r=o/a,s=Math.round(r),t=o/s,m=1;m<=s;m+=1)p=k+m*t,f[p.toFixed(5)]=["x",0];q=d.indexOf(l)>-1?1:"steps"===c?2:0,!g&&i&&(q=0),l===v&&j||(f[n.toFixed(5)]=[l,q]),k=n}}),f}function t(a,b,c){function d(a,b){var c=b===e.cssClasses.value,d=c?m:n,f=c?k:l;return b+" "+d[e.ort]+" "+f[a]}function f(a,b,c){return'class="'+d(c[1],b)+'" style="'+e.style+": "+a+'%"'}function g(a,d){d[1]=d[1]&&b?b(d[0],d[1]):d[1],i+="<div "+f(a,e.cssClasses.marker,d)+"></div>",d[1]&&(i+="<div "+f(a,e.cssClasses.value,d)+">"+c.to(d[0])+"</div>")}var h=document.createElement("div"),i="",k=[e.cssClasses.valueNormal,e.cssClasses.valueLarge,e.cssClasses.valueSub],l=[e.cssClasses.markerNormal,e.cssClasses.markerLarge,e.cssClasses.markerSub],m=[e.cssClasses.valueHorizontal,e.cssClasses.valueVertical],n=[e.cssClasses.markerHorizontal,e.cssClasses.markerVertical];return j(h,e.cssClasses.pips),j(h,0===e.ort?e.cssClasses.pipsHorizontal:e.cssClasses.pipsVertical),Object.keys(a).forEach(function(b){g(b,a[b])}),h.innerHTML=i,h}function u(a){var b=a.mode,c=a.density||1,d=a.filter||!1,e=a.values||!1,f=a.stepped||!1,g=r(b,e,f),h=s(c,b,g),i=a.format||{to:Math.round};return ba.appendChild(t(h,d,i))}function v(){var a=Y.getBoundingClientRect(),b="offset"+["Width","Height"][e.ort];return 0===e.ort?a.width||Y[b]:a.height||Y[b]}function w(a,b,c,d){var f=function(b){return!ba.hasAttribute("disabled")&&(!l(ba,e.cssClasses.tap)&&(!!(b=x(b,d.pageOffset))&&(!(a===aa.start&&void 0!==b.buttons&&b.buttons>1)&&((!d.hover||!b.buttons)&&(b.calcPoint=b.points[e.ort],void c(b,d))))))},g=[];return a.split(" ").forEach(function(a){b.addEventListener(a,f,!1),g.push([a,f])}),g}function x(a,b){a.preventDefault();var c,d,e=0===a.type.indexOf("touch"),f=0===a.type.indexOf("mouse"),g=0===a.type.indexOf("pointer");if(0===a.type.indexOf("MSPointer")&&(g=!0),e){if(a.touches.length>1)return!1;c=a.changedTouches[0].pageX,d=a.changedTouches[0].pageY}return b=b||m(),(f||g)&&(c=a.clientX+b.x,d=a.clientY+b.y),a.pageOffset=b,a.points=[c,d],a.cursor=f||g,a}function y(a){var b=a-d(Y,e.ort),c=100*b/v();return e.dir?100-c:c}function z(a){var b=100,c=!1;return Z.forEach(function(d,e){if(!d.hasAttribute("disabled")){var f=Math.abs(ca[e]-a);f<b&&(c=e,b=f)}}),c}function A(a,b,c,d){var e=c.slice(),f=[!a,a],g=[a,!a];d=d.slice(),a&&d.reverse(),d.length>1?d.forEach(function(a,c){var d=I(e,a,e[a]+b,f[c],g[c]);!1===d?b=0:(b=d-e[a],e[a]=d)}):f=g=[!0];var h=!1;d.forEach(function(a,d){h=M(a,c[a]+b,f[d],g[d])||h}),h&&d.forEach(function(a){B("update",a),B("slide",a)})}function B(a,b,c){Object.keys(ha).forEach(function(d){var f=d.split(".")[0];a===f&&ha[d].forEach(function(a){a.call(_,ga.map(e.format.to),b,ga.slice(),c||!1,ca.slice())})})}function C(a,b){"mouseout"===a.type&&"HTML"===a.target.nodeName&&null===a.relatedTarget&&E(a,b)}function D(a,b){if(-1===navigator.appVersion.indexOf("MSIE 9")&&0===a.buttons&&0!==b.buttonsProperty)return E(a,b);var c=(e.dir?-1:1)*(a.calcPoint-b.startCalcPoint);A(c>0,100*c/b.baseSize,b.locations,b.handleNumbers)}function E(a,b){ea&&(k(ea,e.cssClasses.active),ea=!1),a.cursor&&(document.body.style.cursor="",document.body.removeEventListener("selectstart",document.body.noUiListener)),document.documentElement.noUiListeners.forEach(function(a){document.documentElement.removeEventListener(a[0],a[1])}),k(ba,e.cssClasses.drag),L(),b.handleNumbers.forEach(function(a){B("set",a),B("change",a),B("end",a)})}function F(a,b){if(1===b.handleNumbers.length){var c=Z[b.handleNumbers[0]];if(c.hasAttribute("disabled"))return!1;ea=c.children[0],j(ea,e.cssClasses.active)}a.preventDefault(),a.stopPropagation();var d=w(aa.move,document.documentElement,D,{startCalcPoint:a.calcPoint,baseSize:v(),pageOffset:a.pageOffset,handleNumbers:b.handleNumbers,buttonsProperty:a.buttons,locations:ca.slice()}),f=w(aa.end,document.documentElement,E,{handleNumbers:b.handleNumbers}),g=w("mouseout",document.documentElement,C,{handleNumbers:b.handleNumbers});if(document.documentElement.noUiListeners=d.concat(f,g),a.cursor){document.body.style.cursor=getComputedStyle(a.target).cursor,Z.length>1&&j(ba,e.cssClasses.drag);var h=function(){return!1};document.body.noUiListener=h,document.body.addEventListener("selectstart",h,!1)}b.handleNumbers.forEach(function(a){B("start",a)})}function G(a){a.stopPropagation();var b=y(a.calcPoint),c=z(b);if(!1===c)return!1;e.events.snap||f(ba,e.cssClasses.tap,e.animationDuration),M(c,b,!0,!0),L(),B("slide",c,!0),B("set",c,!0),B("change",c,!0),B("update",c,!0),e.events.snap&&F(a,{handleNumbers:[c]})}function H(a){var b=y(a.calcPoint),c=fa.getStep(b),d=fa.fromStepping(c);Object.keys(ha).forEach(function(a){"hover"===a.split(".")[0]&&ha[a].forEach(function(a){a.call(_,d)})})}function I(a,b,c,d,f){return Z.length>1&&(d&&b>0&&(c=Math.max(c,a[b-1]+e.margin)),f&&b<Z.length-1&&(c=Math.min(c,a[b+1]-e.margin))),Z.length>1&&e.limit&&(d&&b>0&&(c=Math.min(c,a[b-1]+e.limit)),f&&b<Z.length-1&&(c=Math.max(c,a[b+1]-e.limit))),e.padding&&(0===b&&(c=Math.max(c,e.padding)),b===Z.length-1&&(c=Math.min(c,100-e.padding))),c=fa.getStep(c),(c=g(c))!==a[b]&&c}function J(a){return a+"%"}function K(a,b){ca[a]=b,ga[a]=fa.fromStepping(b);var c=function(){Z[a].style[e.style]=J(b),N(a),N(a+1)};window.requestAnimationFrame&&e.useRequestAnimationFrame?window.requestAnimationFrame(c):c()}function L(){da.forEach(function(a){var b=ca[a]>50?-1:1,c=3+(Z.length+b*a);Z[a].childNodes[0].style.zIndex=c})}function M(a,b,c,d){return!1!==(b=I(ca,a,b,c,d))&&(K(a,b),!0)}function N(a){if($[a]){var b=0,c=100;0!==a&&(b=ca[a-1]),a!==$.length-1&&(c=ca[a]),$[a].style[e.style]=J(b),$[a].style[e.styleOposite]=J(100-c)}}function O(a,b){null!==a&&!1!==a&&("number"==typeof a&&(a=String(a)),!1===(a=e.format.from(a))||isNaN(a)||M(b,fa.toStepping(a),!1,!1))}function P(a,b){var c=h(a),d=void 0===ca[0];b=void 0===b||!!b,c.forEach(O),e.animate&&!d&&f(ba,e.cssClasses.tap,e.animationDuration),da.forEach(function(a){M(a,ca[a],!0,!1)}),L(),da.forEach(function(a){B("update",a),null!==c[a]&&b&&B("set",a)})}function Q(a){P(e.start,a)}function S(){var a=ga.map(e.format.to);return 1===a.length?a[0]:a}function T(){for(var a in e.cssClasses)e.cssClasses.hasOwnProperty(a)&&k(ba,e.cssClasses[a]);for(;ba.firstChild;)ba.removeChild(ba.firstChild);delete ba.noUiSlider}function U(){return ca.map(function(a,b){var c=fa.getNearbySteps(a),d=ga[b],e=c.thisStep.step,f=null;!1!==e&&d+e>c.stepAfter.startValue&&(e=c.stepAfter.startValue-d),f=d>c.thisStep.startValue?c.thisStep.step:!1!==c.stepBefore.step&&d-c.stepBefore.highestStep,100===a?e=null:0===a&&(f=null);var g=fa.countStepDecimals();return null!==e&&!1!==e&&(e=Number(e.toFixed(g))),null!==f&&!1!==f&&(f=Number(f.toFixed(g))),[f,e]})}function V(a,b){ha[a]=ha[a]||[],ha[a].push(b),"update"===a.split(".")[0]&&Z.forEach(function(a,b){B("update",b)})}function W(a){var b=a&&a.split(".")[0],c=b&&a.substring(b.length);Object.keys(ha).forEach(function(a){var d=a.split(".")[0],e=a.substring(d.length);b&&b!==d||c&&c!==e||delete ha[a]})}function X(a,b){var c=S(),d=["margin","limit","padding","range","animate","snap","step","format"];d.forEach(function(b){void 0!==a[b]&&(i[b]=a[b])});var f=R(i);d.forEach(function(b){void 0!==a[b]&&(e[b]=f[b])}),f.spectrum.direction=fa.direction,fa=f.spectrum,e.margin=f.margin,e.limit=f.limit,e.padding=f.padding,ca=[],P(a.start||c,b)}var Y,Z,$,_,aa=n(),ba=c,ca=[],da=[],ea=!1,fa=e.spectrum,ga=[],ha={};if(ba.noUiSlider)throw new Error("Slider was already initialized.");return function(b){j(b,e.cssClasses.target),0===e.dir?j(b,e.cssClasses.ltr):j(b,e.cssClasses.rtl),0===e.ort?j(b,e.cssClasses.horizontal):j(b,e.cssClasses.vertical),Y=a(b,e.cssClasses.base)}(ba),function(a,b){Z=[],$=[],$.push(p(b,a[0]));for(var c=0;c<e.handles;c++)Z.push(o(b,c)),da[c]=c,$.push(p(b,a[c+1]))}(e.connect,Y),_={destroy:T,steps:U,on:V,off:W,get:S,set:P,reset:Q,__moveHandles:function(a,b,c){A(a,b,ca,c)},options:i,updateOptions:X,target:ba,pips:u},function(a){a.fixed||Z.forEach(function(a,b){w(aa.start,a.children[0],F,{handleNumbers:[b]})}),a.tap&&w(aa.start,Y,G,{}),a.hover&&w(aa.move,Y,H,{hover:!0}),a.drag&&$.forEach(function(b,c){if(!1!==b&&0!==c&&c!==$.length-1){var d=Z[c-1],f=Z[c],g=[b];j(b,e.cssClasses.draggable),a.fixed&&(g.push(d.children[0]),g.push(f.children[0])),g.forEach(function(a){w(aa.start,a,F,{handles:[d,f],handleNumbers:[c-1,c]})})}})}(e.events),P(e.start),e.pips&&u(e.pips),e.tooltips&&function(){var a=Z.map(q);V("update",function(b,c,d){if(a[c]){var f=b[c];!0!==e.tooltips[c]&&(f=e.tooltips[c].to(d[c])),a[c].innerHTML="<span>"+f+"</span>"}})}(),_}function T(a,b){if(!a.nodeName)throw new Error("noUiSlider.create requires a single element.");void 0===b.tooltips&&(b.tooltips=!0);var c=R(b,a),d=S(a,c,b);return a.noUiSlider=d,d}y.prototype.getMargin=function(a){var b=this.xNumSteps[0];if(b&&a/b%1!=0)throw new Error("noUiSlider: 'limit', 'margin' and 'padding' must be divisible by step.");return 2===this.xPct.length&&p(this.xVal,a)},y.prototype.toStepping=function(a){return a=t(this.xVal,this.xPct,a)},y.prototype.fromStepping=function(a){return u(this.xVal,this.xPct,a)},y.prototype.getStep=function(a){return a=v(this.xPct,this.xSteps,this.snap,a)},y.prototype.getNearbySteps=function(a){var b=s(a,this.xPct);return{stepBefore:{startValue:this.xVal[b-2],step:this.xNumSteps[b-2],highestStep:this.xHighestCompleteStep[b-2]},thisStep:{startValue:this.xVal[b-1],step:this.xNumSteps[b-1],highestStep:this.xHighestCompleteStep[b-1]},stepAfter:{startValue:this.xVal[b-0],step:this.xNumSteps[b-0],highestStep:this.xHighestCompleteStep[b-0]}}},y.prototype.countStepDecimals=function(){var a=this.xNumSteps.map(i);return Math.max.apply(null,a)},y.prototype.convert=function(a){return this.getStep(this.toStepping(a))};var U={to:function(a){return void 0!==a&&a.toFixed(2)},from:Number};return{create:T}});
@@ -1,12 +1,12 @@
1
1
  (function ($) {
2
- $(document).on('turbolinks:load', function() {
2
+ $(document).on('ready turbolinks:load', function() {
3
3
 
4
4
  // Function to update labels of text fields
5
5
  Materialize.updateTextFields = function() {
6
6
  var input_selector = 'input[type=text], input[type=password], input[type=email], input[type=url], input[type=tel], input[type=number], input[type=search], textarea';
7
7
  $(input_selector).each(function(index, element) {
8
8
  var $this = $(this);
9
- if ($(element).val().length > 0 || element.autofocus || $this.attr('placeholder') !== undefined) {
9
+ if ($(element).val().length > 0 || $(element).is(':focus') || element.autofocus || $this.attr('placeholder') !== undefined) {
10
10
  $this.siblings('label').addClass('active');
11
11
  } else if ($(element)[0].validity) {
12
12
  $this.siblings('label').toggleClass('active', $(element)[0].validity.badInput === true);
@@ -28,7 +28,7 @@
28
28
  });
29
29
 
30
30
  // Add active if input element has been pre-populated on document ready
31
- $(document).on('turbolinks:load', function() {
31
+ $(document).on('ready turbolinks:load', function() {
32
32
  Materialize.updateTextFields();
33
33
  });
34
34
 
@@ -129,9 +129,14 @@
129
129
  if (fontFamily) { hiddenDiv.css('font-family', fontFamily); }
130
130
  if (lineHeight) { hiddenDiv.css('line-height', lineHeight); }
131
131
 
132
- if ($textarea.attr('wrap') === "off") {
133
- hiddenDiv.css('overflow-wrap', "normal")
134
- .css('white-space', "pre");
132
+ // Set original-height, if none
133
+ if (!$textarea.data('original-height')) {
134
+ $textarea.data('original-height', $textarea.height());
135
+ }
136
+
137
+ if ($textarea.attr('wrap') === 'off') {
138
+ hiddenDiv.css('overflow-wrap', 'normal')
139
+ .css('white-space', 'pre');
135
140
  }
136
141
 
137
142
  hiddenDiv.text($textarea.val() + '\n');
@@ -149,21 +154,22 @@
149
154
  hiddenDiv.css('width', $(window).width()/2);
150
155
  }
151
156
 
157
+
152
158
  /**
153
159
  * Resize if the new height is greater than the
154
160
  * original height of the textarea
155
161
  */
156
- if ($textarea.data("original-height") <= hiddenDiv.height()) {
162
+ if ($textarea.data('original-height') <= hiddenDiv.height()) {
157
163
  $textarea.css('height', hiddenDiv.height());
158
- } else if ($textarea.val().length < $textarea.data("previous-length")) {
164
+ } else if ($textarea.val().length < $textarea.data('previous-length')) {
159
165
  /**
160
166
  * In case the new height is less than original height, it
161
167
  * means the textarea has less text than before
162
168
  * So we set the height to the original one
163
169
  */
164
- $textarea.css('height', $textarea.data("original-height"));
170
+ $textarea.css('height', $textarea.data('original-height'));
165
171
  }
166
- $textarea.data("previous-length", $textarea.val().length);
172
+ $textarea.data('previous-length', $textarea.val().length);
167
173
  }
168
174
 
169
175
  $(text_area_selector).each(function () {
@@ -172,8 +178,8 @@
172
178
  * Instead of resizing textarea on document load,
173
179
  * store the original height and the original length
174
180
  */
175
- $textarea.data("original-height", $textarea.height());
176
- $textarea.data("previous-length", $textarea.val().length);
181
+ $textarea.data('original-height', $textarea.height());
182
+ $textarea.data('previous-length', $textarea.val().length);
177
183
  });
178
184
 
179
185
  $('body').on('keyup keydown autoresize', text_area_selector, function () {
@@ -177,6 +177,7 @@
177
177
  $('.scrollspy').scrollSpy();
178
178
  $('.button-collapse').sideNav({'edge': 'left'});
179
179
  $('.datepicker').pickadate({selectYears: 20});
180
+ $('.timepicker').pickatime();
180
181
  $('select').not('.disabled').material_select();
181
182
  $('input.autocomplete').autocomplete({
182
183
  data: {"Apple": null, "Microsoft": null, "Google": 'http://placehold.it/250x250'},
@@ -0,0 +1,166 @@
1
+ /*
2
+ * jQuery Easing v1.4.0 - http://gsgd.co.uk/sandbox/jquery/easing/
3
+ * Open source under the BSD License.
4
+ * Copyright © 2008 George McGinley Smith
5
+ * All rights reserved.
6
+ * https://raw.github.com/gdsmith/jquery-easing/master/LICENSE
7
+ */
8
+
9
+ (function (factory) {
10
+ if (typeof define === "function" && define.amd) {
11
+ define(['jquery'], function ($) {
12
+ return factory($);
13
+ });
14
+ } else if (typeof module === "object" && typeof module.exports === "object") {
15
+ exports = factory(require('jquery'));
16
+ } else {
17
+ factory(jQuery);
18
+ }
19
+ })(function($){
20
+
21
+ // Preserve the original jQuery "swing" easing as "jswing"
22
+ $.easing['jswing'] = $.easing['swing'];
23
+
24
+ var pow = Math.pow,
25
+ sqrt = Math.sqrt,
26
+ sin = Math.sin,
27
+ cos = Math.cos,
28
+ PI = Math.PI,
29
+ c1 = 1.70158,
30
+ c2 = c1 * 1.525,
31
+ c3 = c1 + 1,
32
+ c4 = ( 2 * PI ) / 3,
33
+ c5 = ( 2 * PI ) / 4.5;
34
+
35
+ // x is the fraction of animation progress, in the range 0..1
36
+ function bounceOut(x) {
37
+ var n1 = 7.5625,
38
+ d1 = 2.75;
39
+ if ( x < 1/d1 ) {
40
+ return n1*x*x;
41
+ } else if ( x < 2/d1 ) {
42
+ return n1*(x-=(1.5/d1))*x + .75;
43
+ } else if ( x < 2.5/d1 ) {
44
+ return n1*(x-=(2.25/d1))*x + .9375;
45
+ } else {
46
+ return n1*(x-=(2.625/d1))*x + .984375;
47
+ }
48
+ }
49
+
50
+ $.extend( $.easing,
51
+ {
52
+ def: 'easeOutQuad',
53
+ swing: function (x) {
54
+ return $.easing[$.easing.def](x);
55
+ },
56
+ easeInQuad: function (x) {
57
+ return x * x;
58
+ },
59
+ easeOutQuad: function (x) {
60
+ return 1 - ( 1 - x ) * ( 1 - x );
61
+ },
62
+ easeInOutQuad: function (x) {
63
+ return x < 0.5 ?
64
+ 2 * x * x :
65
+ 1 - pow( -2 * x + 2, 2 ) / 2;
66
+ },
67
+ easeInCubic: function (x) {
68
+ return x * x * x;
69
+ },
70
+ easeOutCubic: function (x) {
71
+ return 1 - pow( 1 - x, 3 );
72
+ },
73
+ easeInOutCubic: function (x) {
74
+ return x < 0.5 ?
75
+ 4 * x * x * x :
76
+ 1 - pow( -2 * x + 2, 3 ) / 2;
77
+ },
78
+ easeInQuart: function (x) {
79
+ return x * x * x * x;
80
+ },
81
+ easeOutQuart: function (x) {
82
+ return 1 - pow( 1 - x, 4 );
83
+ },
84
+ easeInOutQuart: function (x) {
85
+ return x < 0.5 ?
86
+ 8 * x * x * x * x :
87
+ 1 - pow( -2 * x + 2, 4 ) / 2;
88
+ },
89
+ easeInQuint: function (x) {
90
+ return x * x * x * x * x;
91
+ },
92
+ easeOutQuint: function (x) {
93
+ return 1 - pow( 1 - x, 5 );
94
+ },
95
+ easeInOutQuint: function (x) {
96
+ return x < 0.5 ?
97
+ 16 * x * x * x * x * x :
98
+ 1 - pow( -2 * x + 2, 5 ) / 2;
99
+ },
100
+ easeInSine: function (x) {
101
+ return 1 - cos( x * PI/2 );
102
+ },
103
+ easeOutSine: function (x) {
104
+ return sin( x * PI/2 );
105
+ },
106
+ easeInOutSine: function (x) {
107
+ return -( cos( PI * x ) - 1 ) / 2;
108
+ },
109
+ easeInExpo: function (x) {
110
+ return x === 0 ? 0 : pow( 2, 10 * x - 10 );
111
+ },
112
+ easeOutExpo: function (x) {
113
+ return x === 1 ? 1 : 1 - pow( 2, -10 * x );
114
+ },
115
+ easeInOutExpo: function (x) {
116
+ return x === 0 ? 0 : x === 1 ? 1 : x < 0.5 ?
117
+ pow( 2, 20 * x - 10 ) / 2 :
118
+ ( 2 - pow( 2, -20 * x + 10 ) ) / 2;
119
+ },
120
+ easeInCirc: function (x) {
121
+ return 1 - sqrt( 1 - pow( x, 2 ) );
122
+ },
123
+ easeOutCirc: function (x) {
124
+ return sqrt( 1 - pow( x - 1, 2 ) );
125
+ },
126
+ easeInOutCirc: function (x) {
127
+ return x < 0.5 ?
128
+ ( 1 - sqrt( 1 - pow( 2 * x, 2 ) ) ) / 2 :
129
+ ( sqrt( 1 - pow( -2 * x + 2, 2 ) ) + 1 ) / 2;
130
+ },
131
+ easeInElastic: function (x) {
132
+ return x === 0 ? 0 : x === 1 ? 1 :
133
+ -pow( 2, 10 * x - 10 ) * sin( ( x * 10 - 10.75 ) * c4 );
134
+ },
135
+ easeOutElastic: function (x) {
136
+ return x === 0 ? 0 : x === 1 ? 1 :
137
+ pow( 2, -10 * x ) * sin( ( x * 10 - 0.75 ) * c4 ) + 1;
138
+ },
139
+ easeInOutElastic: function (x) {
140
+ return x === 0 ? 0 : x === 1 ? 1 : x < 0.5 ?
141
+ -( pow( 2, 20 * x - 10 ) * sin( ( 20 * x - 11.125 ) * c5 )) / 2 :
142
+ pow( 2, -20 * x + 10 ) * sin( ( 20 * x - 11.125 ) * c5 ) / 2 + 1;
143
+ },
144
+ easeInBack: function (x) {
145
+ return c3 * x * x * x - c1 * x * x;
146
+ },
147
+ easeOutBack: function (x) {
148
+ return 1 + c3 * pow( x - 1, 3 ) + c1 * pow( x - 1, 2 );
149
+ },
150
+ easeInOutBack: function (x) {
151
+ return x < 0.5 ?
152
+ ( pow( 2 * x, 2 ) * ( ( c2 + 1 ) * 2 * x - c2 ) ) / 2 :
153
+ ( pow( 2 * x - 2, 2 ) *( ( c2 + 1 ) * ( x * 2 - 2 ) + c2 ) + 2 ) / 2;
154
+ },
155
+ easeInBounce: function (x) {
156
+ return 1 - bounceOut( 1 - x );
157
+ },
158
+ easeOutBounce: bounceOut,
159
+ easeInOutBounce: function (x) {
160
+ return x < 0.5 ?
161
+ ( 1 - bounceOut( 1 - 2 * x ) ) / 2 :
162
+ ( 1 + bounceOut( 2 * x - 1 ) ) / 2;
163
+ }
164
+ });
165
+
166
+ });
@@ -24,7 +24,8 @@
24
24
  origin.wrap(placeholder);
25
25
 
26
26
 
27
- origin.on('click', function(){
27
+ // Start click handler
28
+ origin.on('click', function() {
28
29
  var placeholder = origin.parent('.material-placeholder');
29
30
  var windowWidth = window.innerWidth;
30
31
  var windowHeight = window.innerHeight;
@@ -178,25 +179,29 @@
178
179
  ); // End Velocity
179
180
  }
180
181
 
181
- }); // End origin on click
182
-
183
-
184
- // Return on scroll
185
- $(window).scroll(function() {
186
- if (overlayActive) {
187
- returnToOriginal();
188
- }
189
- });
190
-
191
- // Return on ESC
192
- $(document).keyup(function(e) {
182
+ // Handle Exit triggers
183
+ $(window).on('scroll.materialbox', function() {
184
+ if (overlayActive) {
185
+ returnToOriginal();
186
+ }
187
+ });
193
188
 
194
- if (e.keyCode === 27 && doneAnimating === true) { // ESC key
189
+ $(window).on('resize.materialbox', function() {
195
190
  if (overlayActive) {
196
191
  returnToOriginal();
197
192
  }
198
- }
199
- });
193
+ });
194
+
195
+ $(document).on('keyup.materialbox', function(e) {
196
+ // ESC key
197
+ if (e.keyCode === 27 &&
198
+ doneAnimating === true &&
199
+ overlayActive) {
200
+ returnToOriginal();
201
+ }
202
+ });
203
+
204
+ }); // End click handler
200
205
 
201
206
 
202
207
  // This function returns the modaled image to the original spot
@@ -214,6 +219,10 @@
214
219
  $('#materialbox-overlay').velocity("stop", true);
215
220
  $('.materialbox-caption').velocity("stop", true);
216
221
 
222
+ // disable exit handlers
223
+ $(window).off('scroll.materialbox');
224
+ $(document).off('keyup.materialbox');
225
+ $(window).off('resize.materialbox');
217
226
 
218
227
  $('#materialbox-overlay').velocity({opacity: 0}, {
219
228
  duration: outDuration, // Delay prevents animation overlapping
@@ -273,7 +282,7 @@
273
282
  });
274
283
  };
275
284
 
276
- $(document).on('turbolinks:load', function(){
285
+ $(document).on('ready turbolinks:load', function(){
277
286
  $('.materialboxed').materialbox();
278
287
  });
279
288
 
@@ -83,7 +83,7 @@
83
83
 
84
84
  var overlayID = _generateID();
85
85
  var $overlay = $('<div class="modal-overlay"></div>');
86
- lStack = (++_stack);
86
+ var lStack = (++_stack);
87
87
 
88
88
  // Store a reference of the overlay
89
89
  $overlay.attr('id', overlayID).css('z-index', 1000 + lStack * 2);
@@ -164,6 +164,7 @@
164
164
  }); // done return
165
165
  },
166
166
  open : function() {
167
+ methods.init.apply( this, arguments );
167
168
  $(this).trigger('openModal');
168
169
  },
169
170
  close : function() {
@@ -115,12 +115,17 @@
115
115
  offsetRight : number -> offset from right. Default: 0
116
116
  offsetBottom : number -> offset from bottom. Default: 0
117
117
  offsetLeft : number -> offset from left. Default: 0
118
+ activeClass : string -> Class name to be added to the active link. Default: active
118
119
  * @returns {jQuery}
119
120
  */
120
121
  $.scrollSpy = function(selector, options) {
121
122
  var defaults = {
122
123
  throttle: 100,
123
- scrollOffset: 200 // offset - 200 allows elements near bottom of page to scroll
124
+ scrollOffset: 200, // offset - 200 allows elements near bottom of page to scroll
125
+ activeClass: 'active',
126
+ getActiveElement: function(id) {
127
+ return 'a[href="#' + id + '"]';
128
+ }
124
129
  };
125
130
  options = $.extend(defaults, options);
126
131
 
@@ -146,7 +151,7 @@
146
151
  onScroll(options.scrollOffset);
147
152
  }, options.throttle || 100);
148
153
  var readyScroll = function(){
149
- $(document).on('turbolinks:load', throttledScroll);
154
+ $(document).on('ready turbolinks:load', throttledScroll);
150
155
  };
151
156
 
152
157
  if (!isSpying) {
@@ -167,7 +172,7 @@
167
172
  var $this = $(this);
168
173
 
169
174
  if (visible[0]) {
170
- $('a[href="#' + visible[0].attr('id') + '"]').removeClass('active');
175
+ $(options.getActiveElement(visible[0].attr('id'))).removeClass(options.activeClass);
171
176
  if ($this.data('scrollSpy:id') < visible[0].data('scrollSpy:id')) {
172
177
  visible.unshift($(this));
173
178
  }
@@ -180,7 +185,7 @@
180
185
  }
181
186
 
182
187
 
183
- $('a[href="#' + visible[0].attr('id') + '"]').addClass('active');
188
+ $(options.getActiveElement(visible[0].attr('id'))).addClass(options.activeClass);
184
189
  });
185
190
  selector.on('scrollSpy:exit', function() {
186
191
  visible = $.grep(visible, function(value) {
@@ -188,13 +193,13 @@
188
193
  });
189
194
 
190
195
  if (visible[0]) {
191
- $('a[href="#' + visible[0].attr('id') + '"]').removeClass('active');
196
+ $(options.getActiveElement(visible[0].attr('id'))).removeClass(options.activeClass);
192
197
  var $this = $(this);
193
198
  visible = $.grep(visible, function(value) {
194
199
  return value.attr('id') != $this.attr('id');
195
200
  });
196
201
  if (visible[0]) { // Check if empty
197
- $('a[href="#' + visible[0].attr('id') + '"]').addClass('active');
202
+ $(options.getActiveElement(visible[0].attr('id'))).addClass(options.activeClass);
198
203
  }
199
204
  }
200
205
  });