pushnote 0.0.4 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -0
  3. data/.rspec +3 -0
  4. data/README.md +11 -30
  5. data/Rakefile +20 -0
  6. data/bin/pushnote +20 -2
  7. data/config.codekit +1005 -0
  8. data/config.ru +2 -0
  9. data/config/database.yml +17 -0
  10. data/db/migrate/20150131202537_create_notes_table.rb +9 -0
  11. data/db/schema.rb +23 -0
  12. data/lib/pushnote.rb +0 -3
  13. data/lib/pushnote/adapters.rb +1 -0
  14. data/lib/pushnote/adapters/base.rb +7 -0
  15. data/lib/pushnote/adapters/local.rb +17 -0
  16. data/lib/pushnote/app.rb +50 -0
  17. data/lib/pushnote/models/note.rb +4 -0
  18. data/lib/pushnote/public/css/foundation.css +6139 -0
  19. data/lib/pushnote/public/css/foundation.min.css +1 -0
  20. data/lib/pushnote/public/css/normalize.css +427 -0
  21. data/lib/pushnote/public/humans.txt +8 -0
  22. data/lib/pushnote/public/img/.gitkeep +1 -0
  23. data/lib/pushnote/public/index.html +166 -0
  24. data/lib/pushnote/public/js/foundation.min.js +5960 -0
  25. data/lib/pushnote/public/js/foundation/foundation.abide.js +318 -0
  26. data/lib/pushnote/public/js/foundation/foundation.accordion.js +67 -0
  27. data/lib/pushnote/public/js/foundation/foundation.alert.js +43 -0
  28. data/lib/pushnote/public/js/foundation/foundation.clearing.js +558 -0
  29. data/lib/pushnote/public/js/foundation/foundation.dropdown.js +439 -0
  30. data/lib/pushnote/public/js/foundation/foundation.equalizer.js +73 -0
  31. data/lib/pushnote/public/js/foundation/foundation.interchange.js +348 -0
  32. data/lib/pushnote/public/js/foundation/foundation.joyride.js +924 -0
  33. data/lib/pushnote/public/js/foundation/foundation.js +690 -0
  34. data/lib/pushnote/public/js/foundation/foundation.magellan.js +198 -0
  35. data/lib/pushnote/public/js/foundation/foundation.offcanvas.js +152 -0
  36. data/lib/pushnote/public/js/foundation/foundation.orbit.js +472 -0
  37. data/lib/pushnote/public/js/foundation/foundation.reveal.js +449 -0
  38. data/lib/pushnote/public/js/foundation/foundation.slider.js +267 -0
  39. data/lib/pushnote/public/js/foundation/foundation.tab.js +217 -0
  40. data/lib/pushnote/public/js/foundation/foundation.tooltip.js +300 -0
  41. data/lib/pushnote/public/js/foundation/foundation.topbar.js +445 -0
  42. data/lib/pushnote/public/js/vendor/fastclick.js +9 -0
  43. data/lib/pushnote/public/js/vendor/jquery.cookie.js +8 -0
  44. data/lib/pushnote/public/js/vendor/jquery.js +26 -0
  45. data/lib/pushnote/public/js/vendor/modernizr.js +8 -0
  46. data/lib/pushnote/public/js/vendor/placeholder.js +2 -0
  47. data/lib/pushnote/public/robots.txt +4 -0
  48. data/lib/pushnote/version.rb +1 -1
  49. data/lib/pushnote/views/index.erb +15 -0
  50. data/lib/pushnote/views/layout.erb +48 -0
  51. data/lib/pushnote/views/show.erb +8 -0
  52. data/pushnote.gemspec +15 -5
  53. data/spec/lib/controllers/notes_spec.rb +21 -0
  54. data/spec/spec_helper.rb +16 -0
  55. metadata +193 -9
  56. data/.pushnote.yml +0 -1
  57. data/lib/pushnote/cli.rb +0 -40
  58. data/lib/pushnote/configuration.rb +0 -12
  59. data/lib/pushnote/note.rb +0 -36
@@ -0,0 +1,445 @@
1
+ ;(function ($, window, document, undefined) {
2
+ 'use strict';
3
+
4
+ Foundation.libs.topbar = {
5
+ name : 'topbar',
6
+
7
+ version: '5.5.0',
8
+
9
+ settings : {
10
+ index : 0,
11
+ sticky_class : 'sticky',
12
+ custom_back_text: true,
13
+ back_text: 'Back',
14
+ mobile_show_parent_link: true,
15
+ is_hover: true,
16
+ scrolltop : true, // jump to top when sticky nav menu toggle is clicked
17
+ sticky_on : 'all'
18
+ },
19
+
20
+ init : function (section, method, options) {
21
+ Foundation.inherit(this, 'add_custom_rule register_media throttle');
22
+ var self = this;
23
+
24
+ self.register_media('topbar', 'foundation-mq-topbar');
25
+
26
+ this.bindings(method, options);
27
+
28
+ self.S('[' + this.attr_name() + ']', this.scope).each(function () {
29
+ var topbar = $(this),
30
+ settings = topbar.data(self.attr_name(true) + '-init'),
31
+ section = self.S('section, .top-bar-section', this);
32
+ topbar.data('index', 0);
33
+ var topbarContainer = topbar.parent();
34
+ if (topbarContainer.hasClass('fixed') || self.is_sticky(topbar, topbarContainer, settings) ) {
35
+ self.settings.sticky_class = settings.sticky_class;
36
+ self.settings.sticky_topbar = topbar;
37
+ topbar.data('height', topbarContainer.outerHeight());
38
+ topbar.data('stickyoffset', topbarContainer.offset().top);
39
+ } else {
40
+ topbar.data('height', topbar.outerHeight());
41
+ }
42
+
43
+ if (!settings.assembled) {
44
+ self.assemble(topbar);
45
+ }
46
+
47
+ if (settings.is_hover) {
48
+ self.S('.has-dropdown', topbar).addClass('not-click');
49
+ } else {
50
+ self.S('.has-dropdown', topbar).removeClass('not-click');
51
+ }
52
+
53
+ // Pad body when sticky (scrolled) or fixed.
54
+ self.add_custom_rule('.f-topbar-fixed { padding-top: ' + topbar.data('height') + 'px }');
55
+
56
+ if (topbarContainer.hasClass('fixed')) {
57
+ self.S('body').addClass('f-topbar-fixed');
58
+ }
59
+ });
60
+
61
+ },
62
+
63
+ is_sticky: function (topbar, topbarContainer, settings) {
64
+ var sticky = topbarContainer.hasClass(settings.sticky_class);
65
+
66
+ if (sticky && settings.sticky_on === 'all') {
67
+ return true;
68
+ } else if (sticky && this.small() && settings.sticky_on === 'small') {
69
+ return (matchMedia(Foundation.media_queries.small).matches && !matchMedia(Foundation.media_queries.medium).matches &&
70
+ !matchMedia(Foundation.media_queries.large).matches);
71
+ //return true;
72
+ } else if (sticky && this.medium() && settings.sticky_on === 'medium') {
73
+ return (matchMedia(Foundation.media_queries.small).matches && matchMedia(Foundation.media_queries.medium).matches &&
74
+ !matchMedia(Foundation.media_queries.large).matches);
75
+ //return true;
76
+ } else if(sticky && this.large() && settings.sticky_on === 'large') {
77
+ return (matchMedia(Foundation.media_queries.small).matches && matchMedia(Foundation.media_queries.medium).matches &&
78
+ matchMedia(Foundation.media_queries.large).matches);
79
+ //return true;
80
+ }
81
+
82
+ return false;
83
+ },
84
+
85
+ toggle: function (toggleEl) {
86
+ var self = this,
87
+ topbar;
88
+
89
+ if (toggleEl) {
90
+ topbar = self.S(toggleEl).closest('[' + this.attr_name() + ']');
91
+ } else {
92
+ topbar = self.S('[' + this.attr_name() + ']');
93
+ }
94
+
95
+ var settings = topbar.data(this.attr_name(true) + '-init');
96
+
97
+ var section = self.S('section, .top-bar-section', topbar);
98
+
99
+ if (self.breakpoint()) {
100
+ if (!self.rtl) {
101
+ section.css({left: '0%'});
102
+ $('>.name', section).css({left: '100%'});
103
+ } else {
104
+ section.css({right: '0%'});
105
+ $('>.name', section).css({right: '100%'});
106
+ }
107
+
108
+ self.S('li.moved', section).removeClass('moved');
109
+ topbar.data('index', 0);
110
+
111
+ topbar
112
+ .toggleClass('expanded')
113
+ .css('height', '');
114
+ }
115
+
116
+ if (settings.scrolltop) {
117
+ if (!topbar.hasClass('expanded')) {
118
+ if (topbar.hasClass('fixed')) {
119
+ topbar.parent().addClass('fixed');
120
+ topbar.removeClass('fixed');
121
+ self.S('body').addClass('f-topbar-fixed');
122
+ }
123
+ } else if (topbar.parent().hasClass('fixed')) {
124
+ if (settings.scrolltop) {
125
+ topbar.parent().removeClass('fixed');
126
+ topbar.addClass('fixed');
127
+ self.S('body').removeClass('f-topbar-fixed');
128
+
129
+ window.scrollTo(0,0);
130
+ } else {
131
+ topbar.parent().removeClass('expanded');
132
+ }
133
+ }
134
+ } else {
135
+ if (self.is_sticky(topbar, topbar.parent(), settings)) {
136
+ topbar.parent().addClass('fixed');
137
+ }
138
+
139
+ if (topbar.parent().hasClass('fixed')) {
140
+ if (!topbar.hasClass('expanded')) {
141
+ topbar.removeClass('fixed');
142
+ topbar.parent().removeClass('expanded');
143
+ self.update_sticky_positioning();
144
+ } else {
145
+ topbar.addClass('fixed');
146
+ topbar.parent().addClass('expanded');
147
+ self.S('body').addClass('f-topbar-fixed');
148
+ }
149
+ }
150
+ }
151
+ },
152
+
153
+ timer : null,
154
+
155
+ events : function (bar) {
156
+ var self = this,
157
+ S = this.S;
158
+
159
+ S(this.scope)
160
+ .off('.topbar')
161
+ .on('click.fndtn.topbar', '[' + this.attr_name() + '] .toggle-topbar', function (e) {
162
+ e.preventDefault();
163
+ self.toggle(this);
164
+ })
165
+ .on('click.fndtn.topbar','.top-bar .top-bar-section li a[href^="#"],[' + this.attr_name() + '] .top-bar-section li a[href^="#"]',function (e) {
166
+ var li = $(this).closest('li');
167
+ if(self.breakpoint() && !li.hasClass('back') && !li.hasClass('has-dropdown'))
168
+ {
169
+ self.toggle();
170
+ }
171
+ })
172
+ .on('click.fndtn.topbar', '[' + this.attr_name() + '] li.has-dropdown', function (e) {
173
+ var li = S(this),
174
+ target = S(e.target),
175
+ topbar = li.closest('[' + self.attr_name() + ']'),
176
+ settings = topbar.data(self.attr_name(true) + '-init');
177
+
178
+ if(target.data('revealId')) {
179
+ self.toggle();
180
+ return;
181
+ }
182
+
183
+ if (self.breakpoint()) return;
184
+ if (settings.is_hover && !Modernizr.touch) return;
185
+
186
+ e.stopImmediatePropagation();
187
+
188
+ if (li.hasClass('hover')) {
189
+ li
190
+ .removeClass('hover')
191
+ .find('li')
192
+ .removeClass('hover');
193
+
194
+ li.parents('li.hover')
195
+ .removeClass('hover');
196
+ } else {
197
+ li.addClass('hover');
198
+
199
+ $(li).siblings().removeClass('hover');
200
+
201
+ if (target[0].nodeName === 'A' && target.parent().hasClass('has-dropdown')) {
202
+ e.preventDefault();
203
+ }
204
+ }
205
+ })
206
+ .on('click.fndtn.topbar', '[' + this.attr_name() + '] .has-dropdown>a', function (e) {
207
+ if (self.breakpoint()) {
208
+
209
+ e.preventDefault();
210
+
211
+ var $this = S(this),
212
+ topbar = $this.closest('[' + self.attr_name() + ']'),
213
+ section = topbar.find('section, .top-bar-section'),
214
+ dropdownHeight = $this.next('.dropdown').outerHeight(),
215
+ $selectedLi = $this.closest('li');
216
+
217
+ topbar.data('index', topbar.data('index') + 1);
218
+ $selectedLi.addClass('moved');
219
+
220
+ if (!self.rtl) {
221
+ section.css({left: -(100 * topbar.data('index')) + '%'});
222
+ section.find('>.name').css({left: 100 * topbar.data('index') + '%'});
223
+ } else {
224
+ section.css({right: -(100 * topbar.data('index')) + '%'});
225
+ section.find('>.name').css({right: 100 * topbar.data('index') + '%'});
226
+ }
227
+
228
+ topbar.css('height', $this.siblings('ul').outerHeight(true) + topbar.data('height'));
229
+ }
230
+ });
231
+
232
+ S(window).off('.topbar').on('resize.fndtn.topbar', self.throttle(function() {
233
+ self.resize.call(self);
234
+ }, 50)).trigger('resize').trigger('resize.fndtn.topbar').load(function(){
235
+ // Ensure that the offset is calculated after all of the pages resources have loaded
236
+ S(this).trigger('resize.fndtn.topbar');
237
+ });
238
+
239
+ S('body').off('.topbar').on('click.fndtn.topbar', function (e) {
240
+ var parent = S(e.target).closest('li').closest('li.hover');
241
+
242
+ if (parent.length > 0) {
243
+ return;
244
+ }
245
+
246
+ S('[' + self.attr_name() + '] li.hover').removeClass('hover');
247
+ });
248
+
249
+ // Go up a level on Click
250
+ S(this.scope).on('click.fndtn.topbar', '[' + this.attr_name() + '] .has-dropdown .back', function (e) {
251
+ e.preventDefault();
252
+
253
+ var $this = S(this),
254
+ topbar = $this.closest('[' + self.attr_name() + ']'),
255
+ section = topbar.find('section, .top-bar-section'),
256
+ settings = topbar.data(self.attr_name(true) + '-init'),
257
+ $movedLi = $this.closest('li.moved'),
258
+ $previousLevelUl = $movedLi.parent();
259
+
260
+ topbar.data('index', topbar.data('index') - 1);
261
+
262
+ if (!self.rtl) {
263
+ section.css({left: -(100 * topbar.data('index')) + '%'});
264
+ section.find('>.name').css({left: 100 * topbar.data('index') + '%'});
265
+ } else {
266
+ section.css({right: -(100 * topbar.data('index')) + '%'});
267
+ section.find('>.name').css({right: 100 * topbar.data('index') + '%'});
268
+ }
269
+
270
+ if (topbar.data('index') === 0) {
271
+ topbar.css('height', '');
272
+ } else {
273
+ topbar.css('height', $previousLevelUl.outerHeight(true) + topbar.data('height'));
274
+ }
275
+
276
+ setTimeout(function () {
277
+ $movedLi.removeClass('moved');
278
+ }, 300);
279
+ });
280
+
281
+ // Show dropdown menus when their items are focused
282
+ S(this.scope).find('.dropdown a')
283
+ .focus(function() {
284
+ $(this).parents('.has-dropdown').addClass('hover');
285
+ })
286
+ .blur(function() {
287
+ $(this).parents('.has-dropdown').removeClass('hover');
288
+ });
289
+ },
290
+
291
+ resize : function () {
292
+ var self = this;
293
+ self.S('[' + this.attr_name() + ']').each(function () {
294
+ var topbar = self.S(this),
295
+ settings = topbar.data(self.attr_name(true) + '-init');
296
+
297
+ var stickyContainer = topbar.parent('.' + self.settings.sticky_class);
298
+ var stickyOffset;
299
+
300
+ if (!self.breakpoint()) {
301
+ var doToggle = topbar.hasClass('expanded');
302
+ topbar
303
+ .css('height', '')
304
+ .removeClass('expanded')
305
+ .find('li')
306
+ .removeClass('hover');
307
+
308
+ if(doToggle) {
309
+ self.toggle(topbar);
310
+ }
311
+ }
312
+
313
+ if(self.is_sticky(topbar, stickyContainer, settings)) {
314
+ if(stickyContainer.hasClass('fixed')) {
315
+ // Remove the fixed to allow for correct calculation of the offset.
316
+ stickyContainer.removeClass('fixed');
317
+
318
+ stickyOffset = stickyContainer.offset().top;
319
+ if(self.S(document.body).hasClass('f-topbar-fixed')) {
320
+ stickyOffset -= topbar.data('height');
321
+ }
322
+
323
+ topbar.data('stickyoffset', stickyOffset);
324
+ stickyContainer.addClass('fixed');
325
+ } else {
326
+ stickyOffset = stickyContainer.offset().top;
327
+ topbar.data('stickyoffset', stickyOffset);
328
+ }
329
+ }
330
+
331
+ });
332
+ },
333
+
334
+ breakpoint : function () {
335
+ return !matchMedia(Foundation.media_queries['topbar']).matches;
336
+ },
337
+
338
+ small : function () {
339
+ return matchMedia(Foundation.media_queries['small']).matches;
340
+ },
341
+
342
+ medium : function () {
343
+ return matchMedia(Foundation.media_queries['medium']).matches;
344
+ },
345
+
346
+ large : function () {
347
+ return matchMedia(Foundation.media_queries['large']).matches;
348
+ },
349
+
350
+ assemble : function (topbar) {
351
+ var self = this,
352
+ settings = topbar.data(this.attr_name(true) + '-init'),
353
+ section = self.S('section, .top-bar-section', topbar);
354
+
355
+ // Pull element out of the DOM for manipulation
356
+ section.detach();
357
+
358
+ self.S('.has-dropdown>a', section).each(function () {
359
+ var $link = self.S(this),
360
+ $dropdown = $link.siblings('.dropdown'),
361
+ url = $link.attr('href'),
362
+ $titleLi;
363
+
364
+
365
+ if (!$dropdown.find('.title.back').length) {
366
+
367
+ if (settings.mobile_show_parent_link == true && url) {
368
+ $titleLi = $('<li class="title back js-generated"><h5><a href="javascript:void(0)"></a></h5></li><li class="parent-link show-for-small-only"><a class="parent-link js-generated" href="' + url + '">' + $link.html() +'</a></li>');
369
+ } else {
370
+ $titleLi = $('<li class="title back js-generated"><h5><a href="javascript:void(0)"></a></h5>');
371
+ }
372
+
373
+ // Copy link to subnav
374
+ if (settings.custom_back_text == true) {
375
+ $('h5>a', $titleLi).html(settings.back_text);
376
+ } else {
377
+ $('h5>a', $titleLi).html('&laquo; ' + $link.html());
378
+ }
379
+ $dropdown.prepend($titleLi);
380
+ }
381
+ });
382
+
383
+ // Put element back in the DOM
384
+ section.appendTo(topbar);
385
+
386
+ // check for sticky
387
+ this.sticky();
388
+
389
+ this.assembled(topbar);
390
+ },
391
+
392
+ assembled : function (topbar) {
393
+ topbar.data(this.attr_name(true), $.extend({}, topbar.data(this.attr_name(true)), {assembled: true}));
394
+ },
395
+
396
+ height : function (ul) {
397
+ var total = 0,
398
+ self = this;
399
+
400
+ $('> li', ul).each(function () {
401
+ total += self.S(this).outerHeight(true);
402
+ });
403
+
404
+ return total;
405
+ },
406
+
407
+ sticky : function () {
408
+ var self = this;
409
+
410
+ this.S(window).on('scroll', function() {
411
+ self.update_sticky_positioning();
412
+ });
413
+ },
414
+
415
+ update_sticky_positioning: function() {
416
+ var klass = '.' + this.settings.sticky_class,
417
+ $window = this.S(window),
418
+ self = this;
419
+
420
+ if (self.settings.sticky_topbar && self.is_sticky(this.settings.sticky_topbar,this.settings.sticky_topbar.parent(), this.settings)) {
421
+ var distance = this.settings.sticky_topbar.data('stickyoffset');
422
+ if (!self.S(klass).hasClass('expanded')) {
423
+ if ($window.scrollTop() > (distance)) {
424
+ if (!self.S(klass).hasClass('fixed')) {
425
+ self.S(klass).addClass('fixed');
426
+ self.S('body').addClass('f-topbar-fixed');
427
+ }
428
+ } else if ($window.scrollTop() <= distance) {
429
+ if (self.S(klass).hasClass('fixed')) {
430
+ self.S(klass).removeClass('fixed');
431
+ self.S('body').removeClass('f-topbar-fixed');
432
+ }
433
+ }
434
+ }
435
+ }
436
+ },
437
+
438
+ off : function () {
439
+ this.S(this.scope).off('.fndtn.topbar');
440
+ this.S(window).off('.fndtn.topbar');
441
+ },
442
+
443
+ reflow : function () {}
444
+ };
445
+ }(jQuery, window, window.document));
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @preserve FastClick: polyfill to remove click delays on browsers with touch UIs.
3
+ *
4
+ * @version 1.0.3
5
+ * @codingstandard ftlabs-jsv2
6
+ * @copyright The Financial Times Limited [All Rights Reserved]
7
+ * @license MIT License (see LICENSE.txt)
8
+ */
9
+ function FastClick(a,b){"use strict";function c(a,b){return function(){return a.apply(b,arguments)}}var d;if(b=b||{},this.trackingClick=!1,this.trackingClickStart=0,this.targetElement=null,this.touchStartX=0,this.touchStartY=0,this.lastTouchIdentifier=0,this.touchBoundary=b.touchBoundary||10,this.layer=a,this.tapDelay=b.tapDelay||200,!FastClick.notNeeded(a)){for(var e=["onMouse","onClick","onTouchStart","onTouchMove","onTouchEnd","onTouchCancel"],f=this,g=0,h=e.length;h>g;g++)f[e[g]]=c(f[e[g]],f);deviceIsAndroid&&(a.addEventListener("mouseover",this.onMouse,!0),a.addEventListener("mousedown",this.onMouse,!0),a.addEventListener("mouseup",this.onMouse,!0)),a.addEventListener("click",this.onClick,!0),a.addEventListener("touchstart",this.onTouchStart,!1),a.addEventListener("touchmove",this.onTouchMove,!1),a.addEventListener("touchend",this.onTouchEnd,!1),a.addEventListener("touchcancel",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(a.removeEventListener=function(b,c,d){var e=Node.prototype.removeEventListener;"click"===b?e.call(a,b,c.hijacked||c,d):e.call(a,b,c,d)},a.addEventListener=function(b,c,d){var e=Node.prototype.addEventListener;"click"===b?e.call(a,b,c.hijacked||(c.hijacked=function(a){a.propagationStopped||c(a)}),d):e.call(a,b,c,d)}),"function"==typeof a.onclick&&(d=a.onclick,a.addEventListener("click",function(a){d(a)},!1),a.onclick=null)}}var deviceIsAndroid=navigator.userAgent.indexOf("Android")>0,deviceIsIOS=/iP(ad|hone|od)/.test(navigator.userAgent),deviceIsIOS4=deviceIsIOS&&/OS 4_\d(_\d)?/.test(navigator.userAgent),deviceIsIOSWithBadTarget=deviceIsIOS&&/OS ([6-9]|\d{2})_\d/.test(navigator.userAgent),deviceIsBlackBerry10=navigator.userAgent.indexOf("BB10")>0;FastClick.prototype.needsClick=function(a){"use strict";switch(a.nodeName.toLowerCase()){case"button":case"select":case"textarea":if(a.disabled)return!0;break;case"input":if(deviceIsIOS&&"file"===a.type||a.disabled)return!0;break;case"label":case"video":return!0}return/\bneedsclick\b/.test(a.className)},FastClick.prototype.needsFocus=function(a){"use strict";switch(a.nodeName.toLowerCase()){case"textarea":return!0;case"select":return!deviceIsAndroid;case"input":switch(a.type){case"button":case"checkbox":case"file":case"image":case"radio":case"submit":return!1}return!a.disabled&&!a.readOnly;default:return/\bneedsfocus\b/.test(a.className)}},FastClick.prototype.sendClick=function(a,b){"use strict";var c,d;document.activeElement&&document.activeElement!==a&&document.activeElement.blur(),d=b.changedTouches[0],c=document.createEvent("MouseEvents"),c.initMouseEvent(this.determineEventType(a),!0,!0,window,1,d.screenX,d.screenY,d.clientX,d.clientY,!1,!1,!1,!1,0,null),c.forwardedTouchEvent=!0,a.dispatchEvent(c)},FastClick.prototype.determineEventType=function(a){"use strict";return deviceIsAndroid&&"select"===a.tagName.toLowerCase()?"mousedown":"click"},FastClick.prototype.focus=function(a){"use strict";var b;deviceIsIOS&&a.setSelectionRange&&0!==a.type.indexOf("date")&&"time"!==a.type?(b=a.value.length,a.setSelectionRange(b,b)):a.focus()},FastClick.prototype.updateScrollParent=function(a){"use strict";var b,c;if(b=a.fastClickScrollParent,!b||!b.contains(a)){c=a;do{if(c.scrollHeight>c.offsetHeight){b=c,a.fastClickScrollParent=c;break}c=c.parentElement}while(c)}b&&(b.fastClickLastScrollTop=b.scrollTop)},FastClick.prototype.getTargetElementFromEventTarget=function(a){"use strict";return a.nodeType===Node.TEXT_NODE?a.parentNode:a},FastClick.prototype.onTouchStart=function(a){"use strict";var b,c,d;if(a.targetTouches.length>1)return!0;if(b=this.getTargetElementFromEventTarget(a.target),c=a.targetTouches[0],deviceIsIOS){if(d=window.getSelection(),d.rangeCount&&!d.isCollapsed)return!0;if(!deviceIsIOS4){if(c.identifier&&c.identifier===this.lastTouchIdentifier)return a.preventDefault(),!1;this.lastTouchIdentifier=c.identifier,this.updateScrollParent(b)}}return this.trackingClick=!0,this.trackingClickStart=a.timeStamp,this.targetElement=b,this.touchStartX=c.pageX,this.touchStartY=c.pageY,a.timeStamp-this.lastClickTime<this.tapDelay&&a.preventDefault(),!0},FastClick.prototype.touchHasMoved=function(a){"use strict";var b=a.changedTouches[0],c=this.touchBoundary;return Math.abs(b.pageX-this.touchStartX)>c||Math.abs(b.pageY-this.touchStartY)>c?!0:!1},FastClick.prototype.onTouchMove=function(a){"use strict";return this.trackingClick?((this.targetElement!==this.getTargetElementFromEventTarget(a.target)||this.touchHasMoved(a))&&(this.trackingClick=!1,this.targetElement=null),!0):!0},FastClick.prototype.findControl=function(a){"use strict";return void 0!==a.control?a.control:a.htmlFor?document.getElementById(a.htmlFor):a.querySelector("button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea")},FastClick.prototype.onTouchEnd=function(a){"use strict";var b,c,d,e,f,g=this.targetElement;if(!this.trackingClick)return!0;if(a.timeStamp-this.lastClickTime<this.tapDelay)return this.cancelNextClick=!0,!0;if(this.cancelNextClick=!1,this.lastClickTime=a.timeStamp,c=this.trackingClickStart,this.trackingClick=!1,this.trackingClickStart=0,deviceIsIOSWithBadTarget&&(f=a.changedTouches[0],g=document.elementFromPoint(f.pageX-window.pageXOffset,f.pageY-window.pageYOffset)||g,g.fastClickScrollParent=this.targetElement.fastClickScrollParent),d=g.tagName.toLowerCase(),"label"===d){if(b=this.findControl(g)){if(this.focus(g),deviceIsAndroid)return!1;g=b}}else if(this.needsFocus(g))return a.timeStamp-c>100||deviceIsIOS&&window.top!==window&&"input"===d?(this.targetElement=null,!1):(this.focus(g),this.sendClick(g,a),deviceIsIOS&&"select"===d||(this.targetElement=null,a.preventDefault()),!1);return deviceIsIOS&&!deviceIsIOS4&&(e=g.fastClickScrollParent,e&&e.fastClickLastScrollTop!==e.scrollTop)?!0:(this.needsClick(g)||(a.preventDefault(),this.sendClick(g,a)),!1)},FastClick.prototype.onTouchCancel=function(){"use strict";this.trackingClick=!1,this.targetElement=null},FastClick.prototype.onMouse=function(a){"use strict";return this.targetElement?a.forwardedTouchEvent?!0:a.cancelable&&(!this.needsClick(this.targetElement)||this.cancelNextClick)?(a.stopImmediatePropagation?a.stopImmediatePropagation():a.propagationStopped=!0,a.stopPropagation(),a.preventDefault(),!1):!0:!0},FastClick.prototype.onClick=function(a){"use strict";var b;return this.trackingClick?(this.targetElement=null,this.trackingClick=!1,!0):"submit"===a.target.type&&0===a.detail?!0:(b=this.onMouse(a),b||(this.targetElement=null),b)},FastClick.prototype.destroy=function(){"use strict";var a=this.layer;deviceIsAndroid&&(a.removeEventListener("mouseover",this.onMouse,!0),a.removeEventListener("mousedown",this.onMouse,!0),a.removeEventListener("mouseup",this.onMouse,!0)),a.removeEventListener("click",this.onClick,!0),a.removeEventListener("touchstart",this.onTouchStart,!1),a.removeEventListener("touchmove",this.onTouchMove,!1),a.removeEventListener("touchend",this.onTouchEnd,!1),a.removeEventListener("touchcancel",this.onTouchCancel,!1)},FastClick.notNeeded=function(a){"use strict";var b,c,d;if("undefined"==typeof window.ontouchstart)return!0;if(c=+(/Chrome\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1]){if(!deviceIsAndroid)return!0;if(b=document.querySelector("meta[name=viewport]")){if(-1!==b.content.indexOf("user-scalable=no"))return!0;if(c>31&&document.documentElement.scrollWidth<=window.outerWidth)return!0}}if(deviceIsBlackBerry10&&(d=navigator.userAgent.match(/Version\/([0-9]*)\.([0-9]*)/),d[1]>=10&&d[2]>=3&&(b=document.querySelector("meta[name=viewport]")))){if(-1!==b.content.indexOf("user-scalable=no"))return!0;if(document.documentElement.scrollWidth<=window.outerWidth)return!0}return"none"===a.style.msTouchAction?!0:!1},FastClick.attach=function(a,b){"use strict";return new FastClick(a,b)},"function"==typeof define&&"object"==typeof define.amd&&define.amd?define(function(){"use strict";return FastClick}):"undefined"!=typeof module&&module.exports?(module.exports=FastClick.attach,module.exports.FastClick=FastClick):window.FastClick=FastClick;