materialize-sass 0.100.2.1 → 1.0.0.alpha1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (126) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +18 -42
  3. data/Rakefile +17 -17
  4. data/{app/assets → assets}/javascripts/materialize-sprockets.js +8 -12
  5. data/assets/javascripts/materialize.js +11877 -0
  6. data/assets/javascripts/materialize/autocomplete.js +420 -0
  7. data/assets/javascripts/materialize/buttons.js +388 -0
  8. data/assets/javascripts/materialize/cards.js +28 -0
  9. data/assets/javascripts/materialize/carousel.js +791 -0
  10. data/assets/javascripts/materialize/cash.js +992 -0
  11. data/assets/javascripts/materialize/characterCounter.js +180 -0
  12. data/assets/javascripts/materialize/chips.js +555 -0
  13. data/assets/javascripts/materialize/collapsible.js +275 -0
  14. data/assets/javascripts/materialize/datepicker.js +898 -0
  15. data/assets/javascripts/materialize/dropdown.js +530 -0
  16. data/{app/assets → assets}/javascripts/materialize/extras/nouislider.js +1 -1
  17. data/{app/assets → assets}/javascripts/materialize/extras/nouislider.min.js +1 -1
  18. data/assets/javascripts/materialize/forms.js +223 -0
  19. data/assets/javascripts/materialize/global.js +353 -0
  20. data/assets/javascripts/materialize/materialbox.js +432 -0
  21. data/{app/assets → assets}/javascripts/materialize/modal.js +82 -113
  22. data/assets/javascripts/materialize/parallax.js +135 -0
  23. data/assets/javascripts/materialize/pushpin.js +158 -0
  24. data/assets/javascripts/materialize/range.js +305 -0
  25. data/assets/javascripts/materialize/scrollspy.js +322 -0
  26. data/assets/javascripts/materialize/select.js +426 -0
  27. data/assets/javascripts/materialize/sidenav.js +584 -0
  28. data/assets/javascripts/materialize/slider.js +383 -0
  29. data/assets/javascripts/materialize/tabs.js +460 -0
  30. data/assets/javascripts/materialize/tapTarget.js +347 -0
  31. data/assets/javascripts/materialize/timepicker.js +616 -0
  32. data/{app/assets → assets}/javascripts/materialize/toasts.js +42 -46
  33. data/assets/javascripts/materialize/tooltip.js +325 -0
  34. data/assets/javascripts/materialize/velocity.min.js +782 -0
  35. data/{app/assets → assets}/javascripts/materialize/waves.js +0 -0
  36. data/{app/assets → assets}/stylesheets/materialize.scss +5 -6
  37. data/{app/assets → assets}/stylesheets/materialize/components/_badges.scss +1 -1
  38. data/{app/assets → assets}/stylesheets/materialize/components/_buttons.scss +34 -2
  39. data/{app/assets → assets}/stylesheets/materialize/components/_cards.scss +0 -0
  40. data/{app/assets → assets}/stylesheets/materialize/components/_carousel.scss +1 -1
  41. data/{app/assets → assets}/stylesheets/materialize/components/_chips.scss +6 -5
  42. data/{app/assets → assets}/stylesheets/materialize/components/_collapsible.scss +3 -3
  43. data/{app/assets → assets}/stylesheets/materialize/components/_color.scss +0 -0
  44. data/assets/stylesheets/materialize/components/_datepicker.scss +180 -0
  45. data/{app/assets → assets}/stylesheets/materialize/components/_dropdown.scss +16 -15
  46. data/{app/assets → assets}/stylesheets/materialize/components/_global.scss +49 -14
  47. data/{app/assets → assets}/stylesheets/materialize/components/_grid.scss +1 -1
  48. data/{app/assets → assets}/stylesheets/materialize/components/_icons-material-design.scss +0 -0
  49. data/{app/assets → assets}/stylesheets/materialize/components/_materialbox.scss +0 -0
  50. data/assets/stylesheets/materialize/components/_mixins.scss +5 -0
  51. data/{app/assets → assets}/stylesheets/materialize/components/_modal.scss +1 -1
  52. data/{app/assets → assets}/stylesheets/materialize/components/_navbar.scss +0 -0
  53. data/assets/stylesheets/materialize/components/_normalize.scss +447 -0
  54. data/{app/assets → assets}/stylesheets/materialize/components/_preloader.scss +0 -0
  55. data/{app/assets → assets}/stylesheets/materialize/components/_pulse.scss +0 -0
  56. data/{app/assets/stylesheets/materialize/components/_sideNav.scss → assets/stylesheets/materialize/components/_sidenav.scss} +23 -21
  57. data/{app/assets → assets}/stylesheets/materialize/components/_slider.scss +0 -0
  58. data/{app/assets → assets}/stylesheets/materialize/components/_table_of_contents.scss +3 -3
  59. data/{app/assets → assets}/stylesheets/materialize/components/_tabs.scss +2 -2
  60. data/{app/assets → assets}/stylesheets/materialize/components/_tapTarget.scss +0 -0
  61. data/assets/stylesheets/materialize/components/_timepicker.scss +182 -0
  62. data/{app/assets → assets}/stylesheets/materialize/components/_toast.scss +0 -0
  63. data/{app/assets → assets}/stylesheets/materialize/components/_tooltip.scss +1 -0
  64. data/{app/assets → assets}/stylesheets/materialize/components/_transitions.scss +0 -0
  65. data/{app/assets → assets}/stylesheets/materialize/components/_typography.scss +8 -8
  66. data/{app/assets → assets}/stylesheets/materialize/components/_variables.scss +42 -44
  67. data/{app/assets → assets}/stylesheets/materialize/components/_waves.scss +0 -0
  68. data/{app/assets → assets}/stylesheets/materialize/components/forms/_checkboxes.scss +24 -24
  69. data/{app/assets → assets}/stylesheets/materialize/components/forms/_file-input.scss +0 -0
  70. data/{app/assets → assets}/stylesheets/materialize/components/forms/_forms.scss +0 -0
  71. data/{app/assets → assets}/stylesheets/materialize/components/forms/_input-fields.scss +49 -35
  72. data/{app/assets → assets}/stylesheets/materialize/components/forms/_radio-buttons.scss +29 -29
  73. data/{app/assets → assets}/stylesheets/materialize/components/forms/_range.scss +32 -31
  74. data/{app/assets → assets}/stylesheets/materialize/components/forms/_select.scss +20 -11
  75. data/{app/assets → assets}/stylesheets/materialize/components/forms/_switches.scss +0 -0
  76. data/{app/assets → assets}/stylesheets/materialize/extras/nouislider.css +1 -1
  77. data/lib/materialize-sass.rb +13 -23
  78. data/lib/materialize-sass/engine.rb +6 -9
  79. data/lib/materialize-sass/version.rb +1 -1
  80. data/materialize-sass.gemspec +2 -1
  81. metadata +97 -97
  82. data/app/assets/fonts/roboto/Roboto-Bold.woff +0 -0
  83. data/app/assets/fonts/roboto/Roboto-Bold.woff2 +0 -0
  84. data/app/assets/fonts/roboto/Roboto-Light.woff +0 -0
  85. data/app/assets/fonts/roboto/Roboto-Light.woff2 +0 -0
  86. data/app/assets/fonts/roboto/Roboto-Medium.woff +0 -0
  87. data/app/assets/fonts/roboto/Roboto-Medium.woff2 +0 -0
  88. data/app/assets/fonts/roboto/Roboto-Regular.woff +0 -0
  89. data/app/assets/fonts/roboto/Roboto-Regular.woff2 +0 -0
  90. data/app/assets/fonts/roboto/Roboto-Thin.woff +0 -0
  91. data/app/assets/fonts/roboto/Roboto-Thin.woff2 +0 -0
  92. data/app/assets/javascripts/materialize.js +0 -10021
  93. data/app/assets/javascripts/materialize/animation.js +0 -7
  94. data/app/assets/javascripts/materialize/buttons.js +0 -253
  95. data/app/assets/javascripts/materialize/cards.js +0 -28
  96. data/app/assets/javascripts/materialize/carousel.js +0 -543
  97. data/app/assets/javascripts/materialize/character_counter.js +0 -64
  98. data/app/assets/javascripts/materialize/chips.js +0 -315
  99. data/app/assets/javascripts/materialize/collapsible.js +0 -178
  100. data/app/assets/javascripts/materialize/date_picker/picker.date.js +0 -1399
  101. data/app/assets/javascripts/materialize/date_picker/picker.js +0 -1196
  102. data/app/assets/javascripts/materialize/date_picker/picker.time.js +0 -646
  103. data/app/assets/javascripts/materialize/dropdown.js +0 -257
  104. data/app/assets/javascripts/materialize/forms.js +0 -806
  105. data/app/assets/javascripts/materialize/global.js +0 -170
  106. data/app/assets/javascripts/materialize/hammer.min.js +0 -424
  107. data/app/assets/javascripts/materialize/initial.js +0 -10
  108. data/app/assets/javascripts/materialize/jquery.easing.1.4.js +0 -144
  109. data/app/assets/javascripts/materialize/jquery.hammer.js +0 -33
  110. data/app/assets/javascripts/materialize/materialbox.js +0 -263
  111. data/app/assets/javascripts/materialize/parallax.js +0 -54
  112. data/app/assets/javascripts/materialize/pushpin.js +0 -68
  113. data/app/assets/javascripts/materialize/scrollFire.js +0 -49
  114. data/app/assets/javascripts/materialize/scrollspy.js +0 -230
  115. data/app/assets/javascripts/materialize/sideNav.js +0 -395
  116. data/app/assets/javascripts/materialize/slider.js +0 -295
  117. data/app/assets/javascripts/materialize/tabs.js +0 -244
  118. data/app/assets/javascripts/materialize/tapTarget.js +0 -184
  119. data/app/assets/javascripts/materialize/tooltip.js +0 -227
  120. data/app/assets/javascripts/materialize/transitions.js +0 -163
  121. data/app/assets/javascripts/materialize/velocity.min.js +0 -626
  122. data/app/assets/stylesheets/materialize/components/_normalize.scss +0 -424
  123. data/app/assets/stylesheets/materialize/components/_roboto.scss +0 -39
  124. data/app/assets/stylesheets/materialize/components/date_picker/_default.date.scss +0 -469
  125. data/app/assets/stylesheets/materialize/components/date_picker/_default.scss +0 -216
  126. data/app/assets/stylesheets/materialize/components/date_picker/_default.time.scss +0 -267
@@ -1,170 +0,0 @@
1
- // Required for Meteor package, the use of window prevents export by Meteor
2
- (function (window) {
3
- if (window.Package) {
4
- Materialize = {};
5
- } else {
6
- window.Materialize = {};
7
- }
8
- })(window);
9
-
10
- if (typeof exports !== 'undefined' && !exports.nodeType) {
11
- if (typeof module !== 'undefined' && !module.nodeType && module.exports) {
12
- exports = module.exports = Materialize;
13
- }
14
- exports.default = Materialize;
15
- }
16
-
17
- /*
18
- * raf.js
19
- * https://github.com/ngryman/raf.js
20
- *
21
- * original requestAnimationFrame polyfill by Erik Möller
22
- * inspired from paul_irish gist and post
23
- *
24
- * Copyright (c) 2013 ngryman
25
- * Licensed under the MIT license.
26
- */
27
- (function (window) {
28
- var lastTime = 0,
29
- vendors = ['webkit', 'moz'],
30
- requestAnimationFrame = window.requestAnimationFrame,
31
- cancelAnimationFrame = window.cancelAnimationFrame,
32
- i = vendors.length;
33
-
34
- // try to un-prefix existing raf
35
- while (--i >= 0 && !requestAnimationFrame) {
36
- requestAnimationFrame = window[vendors[i] + 'RequestAnimationFrame'];
37
- cancelAnimationFrame = window[vendors[i] + 'CancelRequestAnimationFrame'];
38
- }
39
-
40
- // polyfill with setTimeout fallback
41
- // heavily inspired from @darius gist mod: https://gist.github.com/paulirish/1579671#comment-837945
42
- if (!requestAnimationFrame || !cancelAnimationFrame) {
43
- requestAnimationFrame = function (callback) {
44
- var now = +Date.now(),
45
- nextTime = Math.max(lastTime + 16, now);
46
- return setTimeout(function () {
47
- callback(lastTime = nextTime);
48
- }, nextTime - now);
49
- };
50
-
51
- cancelAnimationFrame = clearTimeout;
52
- }
53
-
54
- // export to window
55
- window.requestAnimationFrame = requestAnimationFrame;
56
- window.cancelAnimationFrame = cancelAnimationFrame;
57
- })(window);
58
-
59
- /**
60
- * Generate approximated selector string for a jQuery object
61
- * @param {jQuery} obj jQuery object to be parsed
62
- * @returns {string}
63
- */
64
- Materialize.objectSelectorString = function (obj) {
65
- var tagStr = obj.prop('tagName') || '';
66
- var idStr = obj.attr('id') || '';
67
- var classStr = obj.attr('class') || '';
68
- return (tagStr + idStr + classStr).replace(/\s/g, '');
69
- };
70
-
71
- // Unique Random ID
72
- Materialize.guid = function () {
73
- function s4() {
74
- return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);
75
- }
76
- return function () {
77
- return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();
78
- };
79
- }();
80
-
81
- /**
82
- * Escapes hash from special characters
83
- * @param {string} hash String returned from this.hash
84
- * @returns {string}
85
- */
86
- Materialize.escapeHash = function (hash) {
87
- return hash.replace(/(:|\.|\[|\]|,|=)/g, "\\$1");
88
- };
89
-
90
- Materialize.elementOrParentIsFixed = function (element) {
91
- var $element = $(element);
92
- var $checkElements = $element.add($element.parents());
93
- var isFixed = false;
94
- $checkElements.each(function () {
95
- if ($(this).css("position") === "fixed") {
96
- isFixed = true;
97
- return false;
98
- }
99
- });
100
- return isFixed;
101
- };
102
-
103
- /**
104
- * Get time in ms
105
- * @license https://raw.github.com/jashkenas/underscore/master/LICENSE
106
- * @type {function}
107
- * @return {number}
108
- */
109
- var getTime = Date.now || function () {
110
- return new Date().getTime();
111
- };
112
-
113
- /**
114
- * Returns a function, that, when invoked, will only be triggered at most once
115
- * during a given window of time. Normally, the throttled function will run
116
- * as much as it can, without ever going more than once per `wait` duration;
117
- * but if you'd like to disable the execution on the leading edge, pass
118
- * `{leading: false}`. To disable execution on the trailing edge, ditto.
119
- * @license https://raw.github.com/jashkenas/underscore/master/LICENSE
120
- * @param {function} func
121
- * @param {number} wait
122
- * @param {Object=} options
123
- * @returns {Function}
124
- */
125
- Materialize.throttle = function (func, wait, options) {
126
- var context, args, result;
127
- var timeout = null;
128
- var previous = 0;
129
- options || (options = {});
130
- var later = function () {
131
- previous = options.leading === false ? 0 : getTime();
132
- timeout = null;
133
- result = func.apply(context, args);
134
- context = args = null;
135
- };
136
- return function () {
137
- var now = getTime();
138
- if (!previous && options.leading === false) previous = now;
139
- var remaining = wait - (now - previous);
140
- context = this;
141
- args = arguments;
142
- if (remaining <= 0) {
143
- clearTimeout(timeout);
144
- timeout = null;
145
- previous = now;
146
- result = func.apply(context, args);
147
- context = args = null;
148
- } else if (!timeout && options.trailing !== false) {
149
- timeout = setTimeout(later, remaining);
150
- }
151
- return result;
152
- };
153
- };
154
-
155
- // Velocity has conflicts when loaded with jQuery, this will check for it
156
- // First, check if in noConflict mode
157
- var Vel;
158
- if (jQuery) {
159
- Vel = jQuery.Velocity;
160
- } else if ($) {
161
- Vel = $.Velocity;
162
- } else {
163
- Vel = Velocity;
164
- }
165
-
166
- if (Vel) {
167
- Materialize.Vel = Vel;
168
- } else {
169
- Materialize.Vel = Velocity;
170
- }
@@ -1,424 +0,0 @@
1
- !function (a, b, c, d) {
2
- "use strict";
3
- function k(a, b, c) {
4
- return setTimeout(q(a, c), b);
5
- }function l(a, b, c) {
6
- return Array.isArray(a) ? (m(a, c[b], c), !0) : !1;
7
- }function m(a, b, c) {
8
- var e;if (a) if (a.forEach) a.forEach(b, c);else if (a.length !== d) for (e = 0; e < a.length;) {
9
- b.call(c, a[e], e, a), e++;
10
- } else for (e in a) {
11
- a.hasOwnProperty(e) && b.call(c, a[e], e, a);
12
- }
13
- }function n(a, b, c) {
14
- for (var e = Object.keys(b), f = 0; f < e.length;) {
15
- (!c || c && a[e[f]] === d) && (a[e[f]] = b[e[f]]), f++;
16
- }return a;
17
- }function o(a, b) {
18
- return n(a, b, !0);
19
- }function p(a, b, c) {
20
- var e,
21
- d = b.prototype;e = a.prototype = Object.create(d), e.constructor = a, e._super = d, c && n(e, c);
22
- }function q(a, b) {
23
- return function () {
24
- return a.apply(b, arguments);
25
- };
26
- }function r(a, b) {
27
- return typeof a == g ? a.apply(b ? b[0] || d : d, b) : a;
28
- }function s(a, b) {
29
- return a === d ? b : a;
30
- }function t(a, b, c) {
31
- m(x(b), function (b) {
32
- a.addEventListener(b, c, !1);
33
- });
34
- }function u(a, b, c) {
35
- m(x(b), function (b) {
36
- a.removeEventListener(b, c, !1);
37
- });
38
- }function v(a, b) {
39
- for (; a;) {
40
- if (a == b) return !0;a = a.parentNode;
41
- }return !1;
42
- }function w(a, b) {
43
- return a.indexOf(b) > -1;
44
- }function x(a) {
45
- return a.trim().split(/\s+/g);
46
- }function y(a, b, c) {
47
- if (a.indexOf && !c) return a.indexOf(b);for (var d = 0; d < a.length;) {
48
- if (c && a[d][c] == b || !c && a[d] === b) return d;d++;
49
- }return -1;
50
- }function z(a) {
51
- return Array.prototype.slice.call(a, 0);
52
- }function A(a, b, c) {
53
- for (var d = [], e = [], f = 0; f < a.length;) {
54
- var g = b ? a[f][b] : a[f];y(e, g) < 0 && d.push(a[f]), e[f] = g, f++;
55
- }return c && (d = b ? d.sort(function (a, c) {
56
- return a[b] > c[b];
57
- }) : d.sort()), d;
58
- }function B(a, b) {
59
- for (var c, f, g = b[0].toUpperCase() + b.slice(1), h = 0; h < e.length;) {
60
- if (c = e[h], f = c ? c + g : b, f in a) return f;h++;
61
- }return d;
62
- }function D() {
63
- return C++;
64
- }function E(a) {
65
- var b = a.ownerDocument;return b.defaultView || b.parentWindow;
66
- }function ab(a, b) {
67
- var c = this;this.manager = a, this.callback = b, this.element = a.element, this.target = a.options.inputTarget, this.domHandler = function (b) {
68
- r(a.options.enable, [a]) && c.handler(b);
69
- }, this.init();
70
- }function bb(a) {
71
- var b,
72
- c = a.options.inputClass;return b = c ? c : H ? wb : I ? Eb : G ? Gb : rb, new b(a, cb);
73
- }function cb(a, b, c) {
74
- var d = c.pointers.length,
75
- e = c.changedPointers.length,
76
- f = b & O && 0 === d - e,
77
- g = b & (Q | R) && 0 === d - e;c.isFirst = !!f, c.isFinal = !!g, f && (a.session = {}), c.eventType = b, db(a, c), a.emit("hammer.input", c), a.recognize(c), a.session.prevInput = c;
78
- }function db(a, b) {
79
- var c = a.session,
80
- d = b.pointers,
81
- e = d.length;c.firstInput || (c.firstInput = gb(b)), e > 1 && !c.firstMultiple ? c.firstMultiple = gb(b) : 1 === e && (c.firstMultiple = !1);var f = c.firstInput,
82
- g = c.firstMultiple,
83
- h = g ? g.center : f.center,
84
- i = b.center = hb(d);b.timeStamp = j(), b.deltaTime = b.timeStamp - f.timeStamp, b.angle = lb(h, i), b.distance = kb(h, i), eb(c, b), b.offsetDirection = jb(b.deltaX, b.deltaY), b.scale = g ? nb(g.pointers, d) : 1, b.rotation = g ? mb(g.pointers, d) : 0, fb(c, b);var k = a.element;v(b.srcEvent.target, k) && (k = b.srcEvent.target), b.target = k;
85
- }function eb(a, b) {
86
- var c = b.center,
87
- d = a.offsetDelta || {},
88
- e = a.prevDelta || {},
89
- f = a.prevInput || {};(b.eventType === O || f.eventType === Q) && (e = a.prevDelta = { x: f.deltaX || 0, y: f.deltaY || 0 }, d = a.offsetDelta = { x: c.x, y: c.y }), b.deltaX = e.x + (c.x - d.x), b.deltaY = e.y + (c.y - d.y);
90
- }function fb(a, b) {
91
- var f,
92
- g,
93
- h,
94
- j,
95
- c = a.lastInterval || b,
96
- e = b.timeStamp - c.timeStamp;if (b.eventType != R && (e > N || c.velocity === d)) {
97
- var k = c.deltaX - b.deltaX,
98
- l = c.deltaY - b.deltaY,
99
- m = ib(e, k, l);g = m.x, h = m.y, f = i(m.x) > i(m.y) ? m.x : m.y, j = jb(k, l), a.lastInterval = b;
100
- } else f = c.velocity, g = c.velocityX, h = c.velocityY, j = c.direction;b.velocity = f, b.velocityX = g, b.velocityY = h, b.direction = j;
101
- }function gb(a) {
102
- for (var b = [], c = 0; c < a.pointers.length;) {
103
- b[c] = { clientX: h(a.pointers[c].clientX), clientY: h(a.pointers[c].clientY) }, c++;
104
- }return { timeStamp: j(), pointers: b, center: hb(b), deltaX: a.deltaX, deltaY: a.deltaY };
105
- }function hb(a) {
106
- var b = a.length;if (1 === b) return { x: h(a[0].clientX), y: h(a[0].clientY) };for (var c = 0, d = 0, e = 0; b > e;) {
107
- c += a[e].clientX, d += a[e].clientY, e++;
108
- }return { x: h(c / b), y: h(d / b) };
109
- }function ib(a, b, c) {
110
- return { x: b / a || 0, y: c / a || 0 };
111
- }function jb(a, b) {
112
- return a === b ? S : i(a) >= i(b) ? a > 0 ? T : U : b > 0 ? V : W;
113
- }function kb(a, b, c) {
114
- c || (c = $);var d = b[c[0]] - a[c[0]],
115
- e = b[c[1]] - a[c[1]];return Math.sqrt(d * d + e * e);
116
- }function lb(a, b, c) {
117
- c || (c = $);var d = b[c[0]] - a[c[0]],
118
- e = b[c[1]] - a[c[1]];return 180 * Math.atan2(e, d) / Math.PI;
119
- }function mb(a, b) {
120
- return lb(b[1], b[0], _) - lb(a[1], a[0], _);
121
- }function nb(a, b) {
122
- return kb(b[0], b[1], _) / kb(a[0], a[1], _);
123
- }function rb() {
124
- this.evEl = pb, this.evWin = qb, this.allow = !0, this.pressed = !1, ab.apply(this, arguments);
125
- }function wb() {
126
- this.evEl = ub, this.evWin = vb, ab.apply(this, arguments), this.store = this.manager.session.pointerEvents = [];
127
- }function Ab() {
128
- this.evTarget = yb, this.evWin = zb, this.started = !1, ab.apply(this, arguments);
129
- }function Bb(a, b) {
130
- var c = z(a.touches),
131
- d = z(a.changedTouches);return b & (Q | R) && (c = A(c.concat(d), "identifier", !0)), [c, d];
132
- }function Eb() {
133
- this.evTarget = Db, this.targetIds = {}, ab.apply(this, arguments);
134
- }function Fb(a, b) {
135
- var c = z(a.touches),
136
- d = this.targetIds;if (b & (O | P) && 1 === c.length) return d[c[0].identifier] = !0, [c, c];var e,
137
- f,
138
- g = z(a.changedTouches),
139
- h = [],
140
- i = this.target;if (f = c.filter(function (a) {
141
- return v(a.target, i);
142
- }), b === O) for (e = 0; e < f.length;) {
143
- d[f[e].identifier] = !0, e++;
144
- }for (e = 0; e < g.length;) {
145
- d[g[e].identifier] && h.push(g[e]), b & (Q | R) && delete d[g[e].identifier], e++;
146
- }return h.length ? [A(f.concat(h), "identifier", !0), h] : void 0;
147
- }function Gb() {
148
- ab.apply(this, arguments);var a = q(this.handler, this);this.touch = new Eb(this.manager, a), this.mouse = new rb(this.manager, a);
149
- }function Pb(a, b) {
150
- this.manager = a, this.set(b);
151
- }function Qb(a) {
152
- if (w(a, Mb)) return Mb;var b = w(a, Nb),
153
- c = w(a, Ob);return b && c ? Nb + " " + Ob : b || c ? b ? Nb : Ob : w(a, Lb) ? Lb : Kb;
154
- }function Yb(a) {
155
- this.id = D(), this.manager = null, this.options = o(a || {}, this.defaults), this.options.enable = s(this.options.enable, !0), this.state = Rb, this.simultaneous = {}, this.requireFail = [];
156
- }function Zb(a) {
157
- return a & Wb ? "cancel" : a & Ub ? "end" : a & Tb ? "move" : a & Sb ? "start" : "";
158
- }function $b(a) {
159
- return a == W ? "down" : a == V ? "up" : a == T ? "left" : a == U ? "right" : "";
160
- }function _b(a, b) {
161
- var c = b.manager;return c ? c.get(a) : a;
162
- }function ac() {
163
- Yb.apply(this, arguments);
164
- }function bc() {
165
- ac.apply(this, arguments), this.pX = null, this.pY = null;
166
- }function cc() {
167
- ac.apply(this, arguments);
168
- }function dc() {
169
- Yb.apply(this, arguments), this._timer = null, this._input = null;
170
- }function ec() {
171
- ac.apply(this, arguments);
172
- }function fc() {
173
- ac.apply(this, arguments);
174
- }function gc() {
175
- Yb.apply(this, arguments), this.pTime = !1, this.pCenter = !1, this._timer = null, this._input = null, this.count = 0;
176
- }function hc(a, b) {
177
- return b = b || {}, b.recognizers = s(b.recognizers, hc.defaults.preset), new kc(a, b);
178
- }function kc(a, b) {
179
- b = b || {}, this.options = o(b, hc.defaults), this.options.inputTarget = this.options.inputTarget || a, this.handlers = {}, this.session = {}, this.recognizers = [], this.element = a, this.input = bb(this), this.touchAction = new Pb(this, this.options.touchAction), lc(this, !0), m(b.recognizers, function (a) {
180
- var b = this.add(new a[0](a[1]));a[2] && b.recognizeWith(a[2]), a[3] && b.requireFailure(a[3]);
181
- }, this);
182
- }function lc(a, b) {
183
- var c = a.element;m(a.options.cssProps, function (a, d) {
184
- c.style[B(c.style, d)] = b ? a : "";
185
- });
186
- }function mc(a, c) {
187
- var d = b.createEvent("Event");d.initEvent(a, !0, !0), d.gesture = c, c.target.dispatchEvent(d);
188
- }var e = ["", "webkit", "moz", "MS", "ms", "o"],
189
- f = b.createElement("div"),
190
- g = "function",
191
- h = Math.round,
192
- i = Math.abs,
193
- j = Date.now,
194
- C = 1,
195
- F = /mobile|tablet|ip(ad|hone|od)|android/i,
196
- G = "ontouchstart" in a,
197
- H = B(a, "PointerEvent") !== d,
198
- I = G && F.test(navigator.userAgent),
199
- J = "touch",
200
- K = "pen",
201
- L = "mouse",
202
- M = "kinect",
203
- N = 25,
204
- O = 1,
205
- P = 2,
206
- Q = 4,
207
- R = 8,
208
- S = 1,
209
- T = 2,
210
- U = 4,
211
- V = 8,
212
- W = 16,
213
- X = T | U,
214
- Y = V | W,
215
- Z = X | Y,
216
- $ = ["x", "y"],
217
- _ = ["clientX", "clientY"];ab.prototype = { handler: function () {}, init: function () {
218
- this.evEl && t(this.element, this.evEl, this.domHandler), this.evTarget && t(this.target, this.evTarget, this.domHandler), this.evWin && t(E(this.element), this.evWin, this.domHandler);
219
- }, destroy: function () {
220
- this.evEl && u(this.element, this.evEl, this.domHandler), this.evTarget && u(this.target, this.evTarget, this.domHandler), this.evWin && u(E(this.element), this.evWin, this.domHandler);
221
- } };var ob = { mousedown: O, mousemove: P, mouseup: Q },
222
- pb = "mousedown",
223
- qb = "mousemove mouseup";p(rb, ab, { handler: function (a) {
224
- var b = ob[a.type];b & O && 0 === a.button && (this.pressed = !0), b & P && 1 !== a.which && (b = Q), this.pressed && this.allow && (b & Q && (this.pressed = !1), this.callback(this.manager, b, { pointers: [a], changedPointers: [a], pointerType: L, srcEvent: a }));
225
- } });var sb = { pointerdown: O, pointermove: P, pointerup: Q, pointercancel: R, pointerout: R },
226
- tb = { 2: J, 3: K, 4: L, 5: M },
227
- ub = "pointerdown",
228
- vb = "pointermove pointerup pointercancel";a.MSPointerEvent && (ub = "MSPointerDown", vb = "MSPointerMove MSPointerUp MSPointerCancel"), p(wb, ab, { handler: function (a) {
229
- var b = this.store,
230
- c = !1,
231
- d = a.type.toLowerCase().replace("ms", ""),
232
- e = sb[d],
233
- f = tb[a.pointerType] || a.pointerType,
234
- g = f == J,
235
- h = y(b, a.pointerId, "pointerId");e & O && (0 === a.button || g) ? 0 > h && (b.push(a), h = b.length - 1) : e & (Q | R) && (c = !0), 0 > h || (b[h] = a, this.callback(this.manager, e, { pointers: b, changedPointers: [a], pointerType: f, srcEvent: a }), c && b.splice(h, 1));
236
- } });var xb = { touchstart: O, touchmove: P, touchend: Q, touchcancel: R },
237
- yb = "touchstart",
238
- zb = "touchstart touchmove touchend touchcancel";p(Ab, ab, { handler: function (a) {
239
- var b = xb[a.type];if (b === O && (this.started = !0), this.started) {
240
- var c = Bb.call(this, a, b);b & (Q | R) && 0 === c[0].length - c[1].length && (this.started = !1), this.callback(this.manager, b, { pointers: c[0], changedPointers: c[1], pointerType: J, srcEvent: a });
241
- }
242
- } });var Cb = { touchstart: O, touchmove: P, touchend: Q, touchcancel: R },
243
- Db = "touchstart touchmove touchend touchcancel";p(Eb, ab, { handler: function (a) {
244
- var b = Cb[a.type],
245
- c = Fb.call(this, a, b);c && this.callback(this.manager, b, { pointers: c[0], changedPointers: c[1], pointerType: J, srcEvent: a });
246
- } }), p(Gb, ab, { handler: function (a, b, c) {
247
- var d = c.pointerType == J,
248
- e = c.pointerType == L;if (d) this.mouse.allow = !1;else if (e && !this.mouse.allow) return;b & (Q | R) && (this.mouse.allow = !0), this.callback(a, b, c);
249
- }, destroy: function () {
250
- this.touch.destroy(), this.mouse.destroy();
251
- } });var Hb = B(f.style, "touchAction"),
252
- Ib = Hb !== d,
253
- Jb = "compute",
254
- Kb = "auto",
255
- Lb = "manipulation",
256
- Mb = "none",
257
- Nb = "pan-x",
258
- Ob = "pan-y";Pb.prototype = { set: function (a) {
259
- a == Jb && (a = this.compute()), Ib && (this.manager.element.style[Hb] = a), this.actions = a.toLowerCase().trim();
260
- }, update: function () {
261
- this.set(this.manager.options.touchAction);
262
- }, compute: function () {
263
- var a = [];return m(this.manager.recognizers, function (b) {
264
- r(b.options.enable, [b]) && (a = a.concat(b.getTouchAction()));
265
- }), Qb(a.join(" "));
266
- }, preventDefaults: function (a) {
267
- if (!Ib) {
268
- var b = a.srcEvent,
269
- c = a.offsetDirection;if (this.manager.session.prevented) return b.preventDefault(), void 0;var d = this.actions,
270
- e = w(d, Mb),
271
- f = w(d, Ob),
272
- g = w(d, Nb);return e || f && c & X || g && c & Y ? this.preventSrc(b) : void 0;
273
- }
274
- }, preventSrc: function (a) {
275
- this.manager.session.prevented = !0, a.preventDefault();
276
- } };var Rb = 1,
277
- Sb = 2,
278
- Tb = 4,
279
- Ub = 8,
280
- Vb = Ub,
281
- Wb = 16,
282
- Xb = 32;Yb.prototype = { defaults: {}, set: function (a) {
283
- return n(this.options, a), this.manager && this.manager.touchAction.update(), this;
284
- }, recognizeWith: function (a) {
285
- if (l(a, "recognizeWith", this)) return this;var b = this.simultaneous;return a = _b(a, this), b[a.id] || (b[a.id] = a, a.recognizeWith(this)), this;
286
- }, dropRecognizeWith: function (a) {
287
- return l(a, "dropRecognizeWith", this) ? this : (a = _b(a, this), delete this.simultaneous[a.id], this);
288
- }, requireFailure: function (a) {
289
- if (l(a, "requireFailure", this)) return this;var b = this.requireFail;return a = _b(a, this), -1 === y(b, a) && (b.push(a), a.requireFailure(this)), this;
290
- }, dropRequireFailure: function (a) {
291
- if (l(a, "dropRequireFailure", this)) return this;a = _b(a, this);var b = y(this.requireFail, a);return b > -1 && this.requireFail.splice(b, 1), this;
292
- }, hasRequireFailures: function () {
293
- return this.requireFail.length > 0;
294
- }, canRecognizeWith: function (a) {
295
- return !!this.simultaneous[a.id];
296
- }, emit: function (a) {
297
- function d(d) {
298
- b.manager.emit(b.options.event + (d ? Zb(c) : ""), a);
299
- }var b = this,
300
- c = this.state;Ub > c && d(!0), d(), c >= Ub && d(!0);
301
- }, tryEmit: function (a) {
302
- return this.canEmit() ? this.emit(a) : (this.state = Xb, void 0);
303
- }, canEmit: function () {
304
- for (var a = 0; a < this.requireFail.length;) {
305
- if (!(this.requireFail[a].state & (Xb | Rb))) return !1;a++;
306
- }return !0;
307
- }, recognize: function (a) {
308
- var b = n({}, a);return r(this.options.enable, [this, b]) ? (this.state & (Vb | Wb | Xb) && (this.state = Rb), this.state = this.process(b), this.state & (Sb | Tb | Ub | Wb) && this.tryEmit(b), void 0) : (this.reset(), this.state = Xb, void 0);
309
- }, process: function () {}, getTouchAction: function () {}, reset: function () {} }, p(ac, Yb, { defaults: { pointers: 1 }, attrTest: function (a) {
310
- var b = this.options.pointers;return 0 === b || a.pointers.length === b;
311
- }, process: function (a) {
312
- var b = this.state,
313
- c = a.eventType,
314
- d = b & (Sb | Tb),
315
- e = this.attrTest(a);return d && (c & R || !e) ? b | Wb : d || e ? c & Q ? b | Ub : b & Sb ? b | Tb : Sb : Xb;
316
- } }), p(bc, ac, { defaults: { event: "pan", threshold: 10, pointers: 1, direction: Z }, getTouchAction: function () {
317
- var a = this.options.direction,
318
- b = [];return a & X && b.push(Ob), a & Y && b.push(Nb), b;
319
- }, directionTest: function (a) {
320
- var b = this.options,
321
- c = !0,
322
- d = a.distance,
323
- e = a.direction,
324
- f = a.deltaX,
325
- g = a.deltaY;return e & b.direction || (b.direction & X ? (e = 0 === f ? S : 0 > f ? T : U, c = f != this.pX, d = Math.abs(a.deltaX)) : (e = 0 === g ? S : 0 > g ? V : W, c = g != this.pY, d = Math.abs(a.deltaY))), a.direction = e, c && d > b.threshold && e & b.direction;
326
- }, attrTest: function (a) {
327
- return ac.prototype.attrTest.call(this, a) && (this.state & Sb || !(this.state & Sb) && this.directionTest(a));
328
- }, emit: function (a) {
329
- this.pX = a.deltaX, this.pY = a.deltaY;var b = $b(a.direction);b && this.manager.emit(this.options.event + b, a), this._super.emit.call(this, a);
330
- } }), p(cc, ac, { defaults: { event: "pinch", threshold: 0, pointers: 2 }, getTouchAction: function () {
331
- return [Mb];
332
- }, attrTest: function (a) {
333
- return this._super.attrTest.call(this, a) && (Math.abs(a.scale - 1) > this.options.threshold || this.state & Sb);
334
- }, emit: function (a) {
335
- if (this._super.emit.call(this, a), 1 !== a.scale) {
336
- var b = a.scale < 1 ? "in" : "out";this.manager.emit(this.options.event + b, a);
337
- }
338
- } }), p(dc, Yb, { defaults: { event: "press", pointers: 1, time: 500, threshold: 5 }, getTouchAction: function () {
339
- return [Kb];
340
- }, process: function (a) {
341
- var b = this.options,
342
- c = a.pointers.length === b.pointers,
343
- d = a.distance < b.threshold,
344
- e = a.deltaTime > b.time;if (this._input = a, !d || !c || a.eventType & (Q | R) && !e) this.reset();else if (a.eventType & O) this.reset(), this._timer = k(function () {
345
- this.state = Vb, this.tryEmit();
346
- }, b.time, this);else if (a.eventType & Q) return Vb;return Xb;
347
- }, reset: function () {
348
- clearTimeout(this._timer);
349
- }, emit: function (a) {
350
- this.state === Vb && (a && a.eventType & Q ? this.manager.emit(this.options.event + "up", a) : (this._input.timeStamp = j(), this.manager.emit(this.options.event, this._input)));
351
- } }), p(ec, ac, { defaults: { event: "rotate", threshold: 0, pointers: 2 }, getTouchAction: function () {
352
- return [Mb];
353
- }, attrTest: function (a) {
354
- return this._super.attrTest.call(this, a) && (Math.abs(a.rotation) > this.options.threshold || this.state & Sb);
355
- } }), p(fc, ac, { defaults: { event: "swipe", threshold: 10, velocity: .65, direction: X | Y, pointers: 1 }, getTouchAction: function () {
356
- return bc.prototype.getTouchAction.call(this);
357
- }, attrTest: function (a) {
358
- var c,
359
- b = this.options.direction;return b & (X | Y) ? c = a.velocity : b & X ? c = a.velocityX : b & Y && (c = a.velocityY), this._super.attrTest.call(this, a) && b & a.direction && a.distance > this.options.threshold && i(c) > this.options.velocity && a.eventType & Q;
360
- }, emit: function (a) {
361
- var b = $b(a.direction);b && this.manager.emit(this.options.event + b, a), this.manager.emit(this.options.event, a);
362
- } }), p(gc, Yb, { defaults: { event: "tap", pointers: 1, taps: 1, interval: 300, time: 250, threshold: 2, posThreshold: 10 }, getTouchAction: function () {
363
- return [Lb];
364
- }, process: function (a) {
365
- var b = this.options,
366
- c = a.pointers.length === b.pointers,
367
- d = a.distance < b.threshold,
368
- e = a.deltaTime < b.time;if (this.reset(), a.eventType & O && 0 === this.count) return this.failTimeout();if (d && e && c) {
369
- if (a.eventType != Q) return this.failTimeout();var f = this.pTime ? a.timeStamp - this.pTime < b.interval : !0,
370
- g = !this.pCenter || kb(this.pCenter, a.center) < b.posThreshold;this.pTime = a.timeStamp, this.pCenter = a.center, g && f ? this.count += 1 : this.count = 1, this._input = a;var h = this.count % b.taps;if (0 === h) return this.hasRequireFailures() ? (this._timer = k(function () {
371
- this.state = Vb, this.tryEmit();
372
- }, b.interval, this), Sb) : Vb;
373
- }return Xb;
374
- }, failTimeout: function () {
375
- return this._timer = k(function () {
376
- this.state = Xb;
377
- }, this.options.interval, this), Xb;
378
- }, reset: function () {
379
- clearTimeout(this._timer);
380
- }, emit: function () {
381
- this.state == Vb && (this._input.tapCount = this.count, this.manager.emit(this.options.event, this._input));
382
- } }), hc.VERSION = "2.0.4", hc.defaults = { domEvents: !1, touchAction: Jb, enable: !0, inputTarget: null, inputClass: null, preset: [[ec, { enable: !1 }], [cc, { enable: !1 }, ["rotate"]], [fc, { direction: X }], [bc, { direction: X }, ["swipe"]], [gc], [gc, { event: "doubletap", taps: 2 }, ["tap"]], [dc]], cssProps: { userSelect: "default", touchSelect: "none", touchCallout: "none", contentZooming: "none", userDrag: "none", tapHighlightColor: "rgba(0,0,0,0)" } };var ic = 1,
383
- jc = 2;kc.prototype = { set: function (a) {
384
- return n(this.options, a), a.touchAction && this.touchAction.update(), a.inputTarget && (this.input.destroy(), this.input.target = a.inputTarget, this.input.init()), this;
385
- }, stop: function (a) {
386
- this.session.stopped = a ? jc : ic;
387
- }, recognize: function (a) {
388
- var b = this.session;if (!b.stopped) {
389
- this.touchAction.preventDefaults(a);var c,
390
- d = this.recognizers,
391
- e = b.curRecognizer;(!e || e && e.state & Vb) && (e = b.curRecognizer = null);for (var f = 0; f < d.length;) {
392
- c = d[f], b.stopped === jc || e && c != e && !c.canRecognizeWith(e) ? c.reset() : c.recognize(a), !e && c.state & (Sb | Tb | Ub) && (e = b.curRecognizer = c), f++;
393
- }
394
- }
395
- }, get: function (a) {
396
- if (a instanceof Yb) return a;for (var b = this.recognizers, c = 0; c < b.length; c++) {
397
- if (b[c].options.event == a) return b[c];
398
- }return null;
399
- }, add: function (a) {
400
- if (l(a, "add", this)) return this;var b = this.get(a.options.event);return b && this.remove(b), this.recognizers.push(a), a.manager = this, this.touchAction.update(), a;
401
- }, remove: function (a) {
402
- if (l(a, "remove", this)) return this;var b = this.recognizers;return a = this.get(a), b.splice(y(b, a), 1), this.touchAction.update(), this;
403
- }, on: function (a, b) {
404
- var c = this.handlers;return m(x(a), function (a) {
405
- c[a] = c[a] || [], c[a].push(b);
406
- }), this;
407
- }, off: function (a, b) {
408
- var c = this.handlers;return m(x(a), function (a) {
409
- b ? c[a].splice(y(c[a], b), 1) : delete c[a];
410
- }), this;
411
- }, emit: function (a, b) {
412
- this.options.domEvents && mc(a, b);var c = this.handlers[a] && this.handlers[a].slice();if (c && c.length) {
413
- b.type = a, b.preventDefault = function () {
414
- b.srcEvent.preventDefault();
415
- };for (var d = 0; d < c.length;) {
416
- c[d](b), d++;
417
- }
418
- }
419
- }, destroy: function () {
420
- this.element && lc(this, !1), this.handlers = {}, this.session = {}, this.input.destroy(), this.element = null;
421
- } }, n(hc, { INPUT_START: O, INPUT_MOVE: P, INPUT_END: Q, INPUT_CANCEL: R, STATE_POSSIBLE: Rb, STATE_BEGAN: Sb, STATE_CHANGED: Tb, STATE_ENDED: Ub, STATE_RECOGNIZED: Vb, STATE_CANCELLED: Wb, STATE_FAILED: Xb, DIRECTION_NONE: S, DIRECTION_LEFT: T, DIRECTION_RIGHT: U, DIRECTION_UP: V, DIRECTION_DOWN: W, DIRECTION_HORIZONTAL: X, DIRECTION_VERTICAL: Y, DIRECTION_ALL: Z, Manager: kc, Input: ab, TouchAction: Pb, TouchInput: Eb, MouseInput: rb, PointerEventInput: wb, TouchMouseInput: Gb, SingleTouchInput: Ab, Recognizer: Yb, AttrRecognizer: ac, Tap: gc, Pan: bc, Swipe: fc, Pinch: cc, Rotate: ec, Press: dc, on: t, off: u, each: m, merge: o, extend: n, inherit: p, bindFn: q, prefixed: B }), typeof define == g && define.amd ? define(function () {
422
- return hc;
423
- }) : "undefined" != typeof module && module.exports ? module.exports = hc : a[c] = hc;
424
- }(window, document, "Hammer");