TokiCLI 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (368) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -0
  3. data/CHANGELOG.md +7 -0
  4. data/README.md +56 -10
  5. data/TokiCLI.gemspec +5 -2
  6. data/lib/API/dbapi.rb +104 -67
  7. data/lib/API/helpers.rb +47 -3
  8. data/lib/TokiCLI/app.rb +88 -12
  9. data/lib/TokiCLI/version.rb +1 -1
  10. data/lib/TokiCLI/view.rb +5 -1
  11. data/lib/TokiServer/Gemfile +6 -0
  12. data/lib/TokiServer/README.md +37 -0
  13. data/lib/TokiServer/bower.json +8 -0
  14. data/lib/TokiServer/bower_components/fastclick/.bower.json +23 -0
  15. data/lib/TokiServer/bower_components/fastclick/LICENSE +22 -0
  16. data/lib/TokiServer/bower_components/fastclick/README.md +133 -0
  17. data/lib/TokiServer/bower_components/fastclick/bower.json +13 -0
  18. data/lib/TokiServer/bower_components/fastclick/lib/fastclick.js +790 -0
  19. data/lib/TokiServer/bower_components/foundation/.bower.json +30 -0
  20. data/lib/TokiServer/bower_components/foundation/bower.json +20 -0
  21. data/lib/TokiServer/bower_components/foundation/css/foundation.css +4860 -0
  22. data/lib/TokiServer/bower_components/foundation/css/normalize.css +320 -0
  23. data/lib/TokiServer/bower_components/foundation/js/foundation.js +5543 -0
  24. data/lib/TokiServer/bower_components/foundation/js/foundation.min.js +3 -0
  25. data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.abide.js +299 -0
  26. data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.accordion.js +59 -0
  27. data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.alert.js +43 -0
  28. data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.clearing.js +534 -0
  29. data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.dropdown.js +311 -0
  30. data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.equalizer.js +74 -0
  31. data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.interchange.js +331 -0
  32. data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.joyride.js +843 -0
  33. data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.js +611 -0
  34. data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.magellan.js +178 -0
  35. data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.offcanvas.js +108 -0
  36. data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.orbit.js +610 -0
  37. data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.reveal.js +437 -0
  38. data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.slider.js +199 -0
  39. data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.tab.js +167 -0
  40. data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.tooltip.js +298 -0
  41. data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.topbar.js +425 -0
  42. data/lib/TokiServer/bower_components/foundation/js/vendor/fastclick.js +9 -0
  43. data/lib/TokiServer/bower_components/foundation/js/vendor/jquery.cookie.js +8 -0
  44. data/lib/TokiServer/bower_components/foundation/js/vendor/jquery.js +26 -0
  45. data/lib/TokiServer/bower_components/foundation/js/vendor/modernizr.js +8 -0
  46. data/lib/TokiServer/bower_components/foundation/js/vendor/placeholder.js +2 -0
  47. data/lib/TokiServer/bower_components/foundation/scss/foundation.scss +45 -0
  48. data/lib/TokiServer/bower_components/foundation/scss/foundation/_functions.scss +101 -0
  49. data/lib/TokiServer/bower_components/foundation/scss/foundation/_settings.scss +1289 -0
  50. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_accordion.scss +53 -0
  51. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_alert-boxes.scss +126 -0
  52. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_block-grid.scss +132 -0
  53. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_breadcrumbs.scss +127 -0
  54. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_button-groups.scss +108 -0
  55. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_buttons.scss +222 -0
  56. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_clearing.scss +247 -0
  57. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_dropdown-buttons.scss +129 -0
  58. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_dropdown.scss +248 -0
  59. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_flex-video.scss +51 -0
  60. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_forms.scss +498 -0
  61. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_global.scss +429 -0
  62. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_grid.scss +260 -0
  63. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_inline-lists.scss +57 -0
  64. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_joyride.scss +220 -0
  65. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_keystrokes.scss +61 -0
  66. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_labels.scss +104 -0
  67. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_magellan.scss +34 -0
  68. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_offcanvas.scss +355 -0
  69. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_orbit.scss +423 -0
  70. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_pagination.scss +150 -0
  71. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_panels.scss +90 -0
  72. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_pricing-tables.scss +150 -0
  73. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_progress-bars.scss +79 -0
  74. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_range-slider.scss +148 -0
  75. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_reveal-new.scss +0 -0
  76. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_reveal.scss +216 -0
  77. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_side-nav.scss +115 -0
  78. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_split-buttons.scss +191 -0
  79. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_sub-nav.scss +125 -0
  80. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_switch.scss +294 -0
  81. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_tables.scss +129 -0
  82. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_tabs.scss +109 -0
  83. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_thumbs.scss +68 -0
  84. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_tooltips.scss +140 -0
  85. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_top-bar.scss +644 -0
  86. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_type.scss +511 -0
  87. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_visibility.scss +408 -0
  88. data/lib/TokiServer/bower_components/foundation/scss/normalize.scss +425 -0
  89. data/lib/TokiServer/bower_components/jquery-placeholder/.bower.json +17 -0
  90. data/lib/TokiServer/bower_components/jquery-placeholder/.gitattributes +1 -0
  91. data/lib/TokiServer/bower_components/jquery-placeholder/.gitignore +1 -0
  92. data/lib/TokiServer/bower_components/jquery-placeholder/LICENSE-MIT.txt +20 -0
  93. data/lib/TokiServer/bower_components/jquery-placeholder/README.md +76 -0
  94. data/lib/TokiServer/bower_components/jquery-placeholder/bower.json +5 -0
  95. data/lib/TokiServer/bower_components/jquery-placeholder/demo.html +55 -0
  96. data/lib/TokiServer/bower_components/jquery-placeholder/jquery.placeholder.js +185 -0
  97. data/lib/TokiServer/bower_components/jquery-placeholder/tests/index.html +32 -0
  98. data/lib/TokiServer/bower_components/jquery-placeholder/tests/tests.js +134 -0
  99. data/lib/TokiServer/bower_components/jquery.cookie/.bower.json +28 -0
  100. data/lib/TokiServer/bower_components/jquery.cookie/jquery.cookie.js +117 -0
  101. data/lib/TokiServer/bower_components/jquery/.bower.json +37 -0
  102. data/lib/TokiServer/bower_components/jquery/MIT-LICENSE.txt +21 -0
  103. data/lib/TokiServer/bower_components/jquery/bower.json +27 -0
  104. data/lib/TokiServer/bower_components/jquery/dist/jquery.js +9190 -0
  105. data/lib/TokiServer/bower_components/jquery/dist/jquery.min.js +5 -0
  106. data/lib/TokiServer/bower_components/jquery/dist/jquery.min.map +1 -0
  107. data/lib/TokiServer/bower_components/jquery/src/ajax.js +806 -0
  108. data/lib/TokiServer/bower_components/jquery/src/ajax/jsonp.js +89 -0
  109. data/lib/TokiServer/bower_components/jquery/src/ajax/load.js +75 -0
  110. data/lib/TokiServer/bower_components/jquery/src/ajax/parseJSON.js +13 -0
  111. data/lib/TokiServer/bower_components/jquery/src/ajax/parseXML.js +28 -0
  112. data/lib/TokiServer/bower_components/jquery/src/ajax/script.js +64 -0
  113. data/lib/TokiServer/bower_components/jquery/src/ajax/var/nonce.js +5 -0
  114. data/lib/TokiServer/bower_components/jquery/src/ajax/var/rquery.js +3 -0
  115. data/lib/TokiServer/bower_components/jquery/src/ajax/xhr.js +135 -0
  116. data/lib/TokiServer/bower_components/jquery/src/attributes.js +11 -0
  117. data/lib/TokiServer/bower_components/jquery/src/attributes/attr.js +143 -0
  118. data/lib/TokiServer/bower_components/jquery/src/attributes/classes.js +158 -0
  119. data/lib/TokiServer/bower_components/jquery/src/attributes/prop.js +96 -0
  120. data/lib/TokiServer/bower_components/jquery/src/attributes/support.js +35 -0
  121. data/lib/TokiServer/bower_components/jquery/src/attributes/val.js +163 -0
  122. data/lib/TokiServer/bower_components/jquery/src/callbacks.js +205 -0
  123. data/lib/TokiServer/bower_components/jquery/src/core.js +498 -0
  124. data/lib/TokiServer/bower_components/jquery/src/core/access.js +60 -0
  125. data/lib/TokiServer/bower_components/jquery/src/core/init.js +123 -0
  126. data/lib/TokiServer/bower_components/jquery/src/core/parseHTML.js +39 -0
  127. data/lib/TokiServer/bower_components/jquery/src/core/ready.js +97 -0
  128. data/lib/TokiServer/bower_components/jquery/src/core/var/rsingleTag.js +4 -0
  129. data/lib/TokiServer/bower_components/jquery/src/css.js +451 -0
  130. data/lib/TokiServer/bower_components/jquery/src/css/addGetHookIf.js +24 -0
  131. data/lib/TokiServer/bower_components/jquery/src/css/curCSS.js +57 -0
  132. data/lib/TokiServer/bower_components/jquery/src/css/defaultDisplay.js +70 -0
  133. data/lib/TokiServer/bower_components/jquery/src/css/hiddenVisibleSelectors.js +15 -0
  134. data/lib/TokiServer/bower_components/jquery/src/css/support.js +91 -0
  135. data/lib/TokiServer/bower_components/jquery/src/css/swap.js +28 -0
  136. data/lib/TokiServer/bower_components/jquery/src/css/var/cssExpand.js +3 -0
  137. data/lib/TokiServer/bower_components/jquery/src/css/var/getStyles.js +5 -0
  138. data/lib/TokiServer/bower_components/jquery/src/css/var/isHidden.js +13 -0
  139. data/lib/TokiServer/bower_components/jquery/src/css/var/rmargin.js +3 -0
  140. data/lib/TokiServer/bower_components/jquery/src/css/var/rnumnonpx.js +5 -0
  141. data/lib/TokiServer/bower_components/jquery/src/data.js +179 -0
  142. data/lib/TokiServer/bower_components/jquery/src/data/Data.js +181 -0
  143. data/lib/TokiServer/bower_components/jquery/src/data/accepts.js +20 -0
  144. data/lib/TokiServer/bower_components/jquery/src/data/var/data_priv.js +5 -0
  145. data/lib/TokiServer/bower_components/jquery/src/data/var/data_user.js +5 -0
  146. data/lib/TokiServer/bower_components/jquery/src/deferred.js +149 -0
  147. data/lib/TokiServer/bower_components/jquery/src/deprecated.js +13 -0
  148. data/lib/TokiServer/bower_components/jquery/src/dimensions.js +50 -0
  149. data/lib/TokiServer/bower_components/jquery/src/effects.js +649 -0
  150. data/lib/TokiServer/bower_components/jquery/src/effects/Tween.js +114 -0
  151. data/lib/TokiServer/bower_components/jquery/src/effects/animatedSelector.js +13 -0
  152. data/lib/TokiServer/bower_components/jquery/src/event.js +868 -0
  153. data/lib/TokiServer/bower_components/jquery/src/event/alias.js +39 -0
  154. data/lib/TokiServer/bower_components/jquery/src/event/support.js +9 -0
  155. data/lib/TokiServer/bower_components/jquery/src/exports/amd.js +24 -0
  156. data/lib/TokiServer/bower_components/jquery/src/exports/global.js +32 -0
  157. data/lib/TokiServer/bower_components/jquery/src/intro.js +44 -0
  158. data/lib/TokiServer/bower_components/jquery/src/jquery.js +36 -0
  159. data/lib/TokiServer/bower_components/jquery/src/manipulation.js +582 -0
  160. data/lib/TokiServer/bower_components/jquery/src/manipulation/_evalUrl.js +18 -0
  161. data/lib/TokiServer/bower_components/jquery/src/manipulation/support.js +31 -0
  162. data/lib/TokiServer/bower_components/jquery/src/manipulation/var/rcheckableType.js +3 -0
  163. data/lib/TokiServer/bower_components/jquery/src/offset.js +204 -0
  164. data/lib/TokiServer/bower_components/jquery/src/outro.js +1 -0
  165. data/lib/TokiServer/bower_components/jquery/src/queue.js +142 -0
  166. data/lib/TokiServer/bower_components/jquery/src/queue/delay.js +22 -0
  167. data/lib/TokiServer/bower_components/jquery/src/selector-native.js +172 -0
  168. data/lib/TokiServer/bower_components/jquery/src/selector-sizzle.js +14 -0
  169. data/lib/TokiServer/bower_components/jquery/src/selector.js +1 -0
  170. data/lib/TokiServer/bower_components/jquery/src/serialize.js +111 -0
  171. data/lib/TokiServer/bower_components/jquery/src/sizzle/dist/sizzle.js +2044 -0
  172. data/lib/TokiServer/bower_components/jquery/src/sizzle/dist/sizzle.min.js +3 -0
  173. data/lib/TokiServer/bower_components/jquery/src/sizzle/dist/sizzle.min.map +1 -0
  174. data/lib/TokiServer/bower_components/jquery/src/traversing.js +200 -0
  175. data/lib/TokiServer/bower_components/jquery/src/traversing/findFilter.js +100 -0
  176. data/lib/TokiServer/bower_components/jquery/src/traversing/var/rneedsContext.js +6 -0
  177. data/lib/TokiServer/bower_components/jquery/src/var/arr.js +3 -0
  178. data/lib/TokiServer/bower_components/jquery/src/var/class2type.js +4 -0
  179. data/lib/TokiServer/bower_components/jquery/src/var/concat.js +5 -0
  180. data/lib/TokiServer/bower_components/jquery/src/var/hasOwn.js +5 -0
  181. data/lib/TokiServer/bower_components/jquery/src/var/indexOf.js +5 -0
  182. data/lib/TokiServer/bower_components/jquery/src/var/pnum.js +3 -0
  183. data/lib/TokiServer/bower_components/jquery/src/var/push.js +5 -0
  184. data/lib/TokiServer/bower_components/jquery/src/var/rnotwhite.js +3 -0
  185. data/lib/TokiServer/bower_components/jquery/src/var/slice.js +5 -0
  186. data/lib/TokiServer/bower_components/jquery/src/var/strundefined.js +3 -0
  187. data/lib/TokiServer/bower_components/jquery/src/var/support.js +4 -0
  188. data/lib/TokiServer/bower_components/jquery/src/var/toString.js +5 -0
  189. data/lib/TokiServer/bower_components/jquery/src/wrap.js +78 -0
  190. data/lib/TokiServer/bower_components/modernizr/.bower.json +14 -0
  191. data/lib/TokiServer/bower_components/modernizr/.editorconfig +10 -0
  192. data/lib/TokiServer/bower_components/modernizr/.gitignore +2 -0
  193. data/lib/TokiServer/bower_components/modernizr/.travis.yml +6 -0
  194. data/lib/TokiServer/bower_components/modernizr/feature-detects/a-download.js +8 -0
  195. data/lib/TokiServer/bower_components/modernizr/feature-detects/audio-audiodata-api.js +4 -0
  196. data/lib/TokiServer/bower_components/modernizr/feature-detects/audio-webaudio-api.js +4 -0
  197. data/lib/TokiServer/bower_components/modernizr/feature-detects/battery-api.js +8 -0
  198. data/lib/TokiServer/bower_components/modernizr/feature-detects/battery-level.js +11 -0
  199. data/lib/TokiServer/bower_components/modernizr/feature-detects/blob-constructor.js +10 -0
  200. data/lib/TokiServer/bower_components/modernizr/feature-detects/canvas-todataurl-type.js +28 -0
  201. data/lib/TokiServer/bower_components/modernizr/feature-detects/contenteditable.js +9 -0
  202. data/lib/TokiServer/bower_components/modernizr/feature-detects/contentsecuritypolicy.js +10 -0
  203. data/lib/TokiServer/bower_components/modernizr/feature-detects/contextmenu.js +11 -0
  204. data/lib/TokiServer/bower_components/modernizr/feature-detects/cookies.js +15 -0
  205. data/lib/TokiServer/bower_components/modernizr/feature-detects/cors.js +3 -0
  206. data/lib/TokiServer/bower_components/modernizr/feature-detects/css-backgroundposition-shorthand.js +19 -0
  207. data/lib/TokiServer/bower_components/modernizr/feature-detects/css-backgroundposition-xy.js +15 -0
  208. data/lib/TokiServer/bower_components/modernizr/feature-detects/css-backgroundrepeat.js +31 -0
  209. data/lib/TokiServer/bower_components/modernizr/feature-detects/css-backgroundsizecover.js +10 -0
  210. data/lib/TokiServer/bower_components/modernizr/feature-detects/css-boxsizing.js +9 -0
  211. data/lib/TokiServer/bower_components/modernizr/feature-detects/css-calc.js +12 -0
  212. data/lib/TokiServer/bower_components/modernizr/feature-detects/css-cubicbezierrange.js +8 -0
  213. data/lib/TokiServer/bower_components/modernizr/feature-detects/css-displayrunin.js +18 -0
  214. data/lib/TokiServer/bower_components/modernizr/feature-detects/css-displaytable.js +27 -0
  215. data/lib/TokiServer/bower_components/modernizr/feature-detects/css-filters.js +7 -0
  216. data/lib/TokiServer/bower_components/modernizr/feature-detects/css-hyphens.js +205 -0
  217. data/lib/TokiServer/bower_components/modernizr/feature-detects/css-lastchild.js +11 -0
  218. data/lib/TokiServer/bower_components/modernizr/feature-detects/css-mask.js +12 -0
  219. data/lib/TokiServer/bower_components/modernizr/feature-detects/css-mediaqueries.js +3 -0
  220. data/lib/TokiServer/bower_components/modernizr/feature-detects/css-objectfit.js +6 -0
  221. data/lib/TokiServer/bower_components/modernizr/feature-detects/css-overflow-scrolling.js +9 -0
  222. data/lib/TokiServer/bower_components/modernizr/feature-detects/css-pointerevents.js +25 -0
  223. data/lib/TokiServer/bower_components/modernizr/feature-detects/css-positionsticky.js +13 -0
  224. data/lib/TokiServer/bower_components/modernizr/feature-detects/css-regions.js +55 -0
  225. data/lib/TokiServer/bower_components/modernizr/feature-detects/css-remunit.js +19 -0
  226. data/lib/TokiServer/bower_components/modernizr/feature-detects/css-resize.js +8 -0
  227. data/lib/TokiServer/bower_components/modernizr/feature-detects/css-scrollbars.js +19 -0
  228. data/lib/TokiServer/bower_components/modernizr/feature-detects/css-shapes.js +4 -0
  229. data/lib/TokiServer/bower_components/modernizr/feature-detects/css-subpixelfont.js +23 -0
  230. data/lib/TokiServer/bower_components/modernizr/feature-detects/css-supports.js +6 -0
  231. data/lib/TokiServer/bower_components/modernizr/feature-detects/css-userselect.js +10 -0
  232. data/lib/TokiServer/bower_components/modernizr/feature-detects/css-vhunit.js +14 -0
  233. data/lib/TokiServer/bower_components/modernizr/feature-detects/css-vmaxunit.js +14 -0
  234. data/lib/TokiServer/bower_components/modernizr/feature-detects/css-vminunit.js +14 -0
  235. data/lib/TokiServer/bower_components/modernizr/feature-detects/css-vwunit.js +14 -0
  236. data/lib/TokiServer/bower_components/modernizr/feature-detects/custom-protocol-handler.js +10 -0
  237. data/lib/TokiServer/bower_components/modernizr/feature-detects/dart.js +6 -0
  238. data/lib/TokiServer/bower_components/modernizr/feature-detects/dataview-api.js +4 -0
  239. data/lib/TokiServer/bower_components/modernizr/feature-detects/dom-classlist.js +4 -0
  240. data/lib/TokiServer/bower_components/modernizr/feature-detects/dom-createElement-attrs.js +11 -0
  241. data/lib/TokiServer/bower_components/modernizr/feature-detects/dom-dataset.js +9 -0
  242. data/lib/TokiServer/bower_components/modernizr/feature-detects/dom-microdata.js +4 -0
  243. data/lib/TokiServer/bower_components/modernizr/feature-detects/elem-datalist.js +12 -0
  244. data/lib/TokiServer/bower_components/modernizr/feature-detects/elem-details.js +25 -0
  245. data/lib/TokiServer/bower_components/modernizr/feature-detects/elem-output.js +4 -0
  246. data/lib/TokiServer/bower_components/modernizr/feature-detects/elem-progress-meter.js +11 -0
  247. data/lib/TokiServer/bower_components/modernizr/feature-detects/elem-ruby.js +53 -0
  248. data/lib/TokiServer/bower_components/modernizr/feature-detects/elem-time.js +4 -0
  249. data/lib/TokiServer/bower_components/modernizr/feature-detects/elem-track.js +11 -0
  250. data/lib/TokiServer/bower_components/modernizr/feature-detects/emoji.js +11 -0
  251. data/lib/TokiServer/bower_components/modernizr/feature-detects/es5-strictmode.js +7 -0
  252. data/lib/TokiServer/bower_components/modernizr/feature-detects/event-deviceorientation-motion.js +11 -0
  253. data/lib/TokiServer/bower_components/modernizr/feature-detects/exif-orientation.js +32 -0
  254. data/lib/TokiServer/bower_components/modernizr/feature-detects/file-api.js +12 -0
  255. data/lib/TokiServer/bower_components/modernizr/feature-detects/file-filesystem.js +9 -0
  256. data/lib/TokiServer/bower_components/modernizr/feature-detects/forms-fileinput.js +13 -0
  257. data/lib/TokiServer/bower_components/modernizr/feature-detects/forms-formattribute.js +29 -0
  258. data/lib/TokiServer/bower_components/modernizr/feature-detects/forms-inputnumber-l10n.js +32 -0
  259. data/lib/TokiServer/bower_components/modernizr/feature-detects/forms-placeholder.js +10 -0
  260. data/lib/TokiServer/bower_components/modernizr/feature-detects/forms-speechinput.js +19 -0
  261. data/lib/TokiServer/bower_components/modernizr/feature-detects/forms-validation.js +62 -0
  262. data/lib/TokiServer/bower_components/modernizr/feature-detects/fullscreen-api.js +10 -0
  263. data/lib/TokiServer/bower_components/modernizr/feature-detects/gamepad.js +12 -0
  264. data/lib/TokiServer/bower_components/modernizr/feature-detects/getusermedia.js +5 -0
  265. data/lib/TokiServer/bower_components/modernizr/feature-detects/ie8compat.js +12 -0
  266. data/lib/TokiServer/bower_components/modernizr/feature-detects/iframe-sandbox.js +5 -0
  267. data/lib/TokiServer/bower_components/modernizr/feature-detects/iframe-seamless.js +5 -0
  268. data/lib/TokiServer/bower_components/modernizr/feature-detects/iframe-srcdoc.js +5 -0
  269. data/lib/TokiServer/bower_components/modernizr/feature-detects/img-apng.js +26 -0
  270. data/lib/TokiServer/bower_components/modernizr/feature-detects/img-webp.js +20 -0
  271. data/lib/TokiServer/bower_components/modernizr/feature-detects/json.js +7 -0
  272. data/lib/TokiServer/bower_components/modernizr/feature-detects/lists-reversed.js +6 -0
  273. data/lib/TokiServer/bower_components/modernizr/feature-detects/mathml.js +23 -0
  274. data/lib/TokiServer/bower_components/modernizr/feature-detects/network-connection.js +22 -0
  275. data/lib/TokiServer/bower_components/modernizr/feature-detects/network-eventsource.js +5 -0
  276. data/lib/TokiServer/bower_components/modernizr/feature-detects/network-xhr2.js +13 -0
  277. data/lib/TokiServer/bower_components/modernizr/feature-detects/notification.js +10 -0
  278. data/lib/TokiServer/bower_components/modernizr/feature-detects/performance.js +5 -0
  279. data/lib/TokiServer/bower_components/modernizr/feature-detects/pointerlock-api.js +4 -0
  280. data/lib/TokiServer/bower_components/modernizr/feature-detects/quota-management-api.js +11 -0
  281. data/lib/TokiServer/bower_components/modernizr/feature-detects/requestanimationframe.js +7 -0
  282. data/lib/TokiServer/bower_components/modernizr/feature-detects/script-async.js +3 -0
  283. data/lib/TokiServer/bower_components/modernizr/feature-detects/script-defer.js +3 -0
  284. data/lib/TokiServer/bower_components/modernizr/feature-detects/style-scoped.js +6 -0
  285. data/lib/TokiServer/bower_components/modernizr/feature-detects/svg-filters.js +13 -0
  286. data/lib/TokiServer/bower_components/modernizr/feature-detects/unicode.js +32 -0
  287. data/lib/TokiServer/bower_components/modernizr/feature-detects/url-data-uri.js +26 -0
  288. data/lib/TokiServer/bower_components/modernizr/feature-detects/userdata.js +7 -0
  289. data/lib/TokiServer/bower_components/modernizr/feature-detects/vibration.js +4 -0
  290. data/lib/TokiServer/bower_components/modernizr/feature-detects/web-intents.js +6 -0
  291. data/lib/TokiServer/bower_components/modernizr/feature-detects/webgl-extensions.js +42 -0
  292. data/lib/TokiServer/bower_components/modernizr/feature-detects/websockets-binary.js +20 -0
  293. data/lib/TokiServer/bower_components/modernizr/feature-detects/window-framed.js +8 -0
  294. data/lib/TokiServer/bower_components/modernizr/feature-detects/workers-blobworkers.js +66 -0
  295. data/lib/TokiServer/bower_components/modernizr/feature-detects/workers-dataworkers.js +34 -0
  296. data/lib/TokiServer/bower_components/modernizr/feature-detects/workers-sharedworkers.js +3 -0
  297. data/lib/TokiServer/bower_components/modernizr/grunt.js +69 -0
  298. data/lib/TokiServer/bower_components/modernizr/media/Modernizr 2 Logo.ai +292 -1
  299. data/lib/TokiServer/bower_components/modernizr/media/Modernizr 2 Logo.eps +0 -0
  300. data/lib/TokiServer/bower_components/modernizr/media/Modernizr 2 Logo.pdf +292 -1
  301. data/lib/TokiServer/bower_components/modernizr/media/Modernizr 2 Logo.png +0 -0
  302. data/lib/TokiServer/bower_components/modernizr/media/Modernizr 2 Logo.svg +35 -0
  303. data/lib/TokiServer/bower_components/modernizr/modernizr.js +1406 -0
  304. data/lib/TokiServer/bower_components/modernizr/readme.md +28 -0
  305. data/lib/TokiServer/bower_components/modernizr/test/basic.html +65 -0
  306. data/lib/TokiServer/bower_components/modernizr/test/caniuse.html +1451 -0
  307. data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/Windsong-webfont.eot +0 -0
  308. data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/Windsong-webfont.otf +0 -0
  309. data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/Windsong-webfont.svg +147 -0
  310. data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/Windsong-webfont.ttf +0 -0
  311. data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/Windsong-webfont.woff +0 -0
  312. data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/alpha.png +0 -0
  313. data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/apng_test.png +0 -0
  314. data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/before-after.png +0 -0
  315. data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/form_validation.html +15 -0
  316. data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/ga.js +43 -0
  317. data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/green5x5.png +0 -0
  318. data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/hashchange.html +16 -0
  319. data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/jquery.min.js +18 -0
  320. data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/mathml.html +120 -0
  321. data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/mathml_ref.png +0 -0
  322. data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/modernizr-1.7.min.js +2 -0
  323. data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/png_alpha_result.png +0 -0
  324. data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/pushstate.html +40 -0
  325. data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/red30x30.png +0 -0
  326. data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/ruby.png +0 -0
  327. data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/stroked-text.png +0 -0
  328. data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/style.css +168 -0
  329. data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/svg-html-blur.png +0 -0
  330. data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/svg-img.svg +5 -0
  331. data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/svg-img.svg.1 +5 -0
  332. data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/svg_blur.png +0 -0
  333. data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/table.png +0 -0
  334. data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/text-shadow1.png +0 -0
  335. data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/text-shadow2.png +0 -0
  336. data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/windsong_font.png +0 -0
  337. data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/xhtml.html +14 -0
  338. data/lib/TokiServer/bower_components/modernizr/test/index.html +104 -0
  339. data/lib/TokiServer/bower_components/modernizr/test/js/basic.html +65 -0
  340. data/lib/TokiServer/bower_components/modernizr/test/js/dumpdata.js +75 -0
  341. data/lib/TokiServer/bower_components/modernizr/test/js/lib/detect-global.js +153 -0
  342. data/lib/TokiServer/bower_components/modernizr/test/js/lib/jquery-1.7b2.js +9279 -0
  343. data/lib/TokiServer/bower_components/modernizr/test/js/lib/jsonselect.js +279 -0
  344. data/lib/TokiServer/bower_components/modernizr/test/js/lib/polyfills.js +96 -0
  345. data/lib/TokiServer/bower_components/modernizr/test/js/lib/uaparser.js +215 -0
  346. data/lib/TokiServer/bower_components/modernizr/test/js/setup.js +44 -0
  347. data/lib/TokiServer/bower_components/modernizr/test/js/unit-caniuse.js +191 -0
  348. data/lib/TokiServer/bower_components/modernizr/test/js/unit.js +669 -0
  349. data/lib/TokiServer/bower_components/modernizr/test/qunit/qunit.css +231 -0
  350. data/lib/TokiServer/bower_components/modernizr/test/qunit/qunit.js +1932 -0
  351. data/lib/TokiServer/bower_components/modernizr/test/qunit/run-qunit.js +72 -0
  352. data/lib/TokiServer/config.rb +25 -0
  353. data/lib/TokiServer/humans.txt +8 -0
  354. data/lib/TokiServer/itunesicon.rb +60 -0
  355. data/lib/TokiServer/js/app.js +3 -0
  356. data/lib/TokiServer/public/stylesheets/app.css +8094 -0
  357. data/lib/TokiServer/robots.txt +4 -0
  358. data/lib/TokiServer/scss/_settings.scss +1240 -0
  359. data/lib/TokiServer/scss/app.scss +102 -0
  360. data/lib/TokiServer/tokiserver.rb +377 -0
  361. data/lib/TokiServer/views/apps_total.erb +28 -0
  362. data/lib/TokiServer/views/error.erb +25 -0
  363. data/lib/TokiServer/views/index.erb +191 -0
  364. data/lib/TokiServer/views/layout.erb +20 -0
  365. data/lib/TokiServer/views/name_log.erb +50 -0
  366. data/lib/TokiServer/views/name_split.erb +37 -0
  367. data/lib/TokiServer/views/name_total.erb +34 -0
  368. metadata +416 -4
@@ -0,0 +1,790 @@
1
+ /**
2
+ * @preserve FastClick: polyfill to remove click delays on browsers with touch UIs.
3
+ *
4
+ * @version 1.0.2
5
+ * @codingstandard ftlabs-jsv2
6
+ * @copyright The Financial Times Limited [All Rights Reserved]
7
+ * @license MIT License (see LICENSE.txt)
8
+ */
9
+
10
+ /*jslint browser:true, node:true*/
11
+ /*global define, Event, Node*/
12
+
13
+
14
+ /**
15
+ * Instantiate fast-clicking listeners on the specified layer.
16
+ *
17
+ * @constructor
18
+ * @param {Element} layer The layer to listen on
19
+ * @param {Object} options The options to override the defaults
20
+ */
21
+ function FastClick(layer, options) {
22
+ 'use strict';
23
+ var oldOnClick;
24
+
25
+ options = options || {};
26
+
27
+ /**
28
+ * Whether a click is currently being tracked.
29
+ *
30
+ * @type boolean
31
+ */
32
+ this.trackingClick = false;
33
+
34
+
35
+ /**
36
+ * Timestamp for when click tracking started.
37
+ *
38
+ * @type number
39
+ */
40
+ this.trackingClickStart = 0;
41
+
42
+
43
+ /**
44
+ * The element being tracked for a click.
45
+ *
46
+ * @type EventTarget
47
+ */
48
+ this.targetElement = null;
49
+
50
+
51
+ /**
52
+ * X-coordinate of touch start event.
53
+ *
54
+ * @type number
55
+ */
56
+ this.touchStartX = 0;
57
+
58
+
59
+ /**
60
+ * Y-coordinate of touch start event.
61
+ *
62
+ * @type number
63
+ */
64
+ this.touchStartY = 0;
65
+
66
+
67
+ /**
68
+ * ID of the last touch, retrieved from Touch.identifier.
69
+ *
70
+ * @type number
71
+ */
72
+ this.lastTouchIdentifier = 0;
73
+
74
+
75
+ /**
76
+ * Touchmove boundary, beyond which a click will be cancelled.
77
+ *
78
+ * @type number
79
+ */
80
+ this.touchBoundary = options.touchBoundary || 10;
81
+
82
+
83
+ /**
84
+ * The FastClick layer.
85
+ *
86
+ * @type Element
87
+ */
88
+ this.layer = layer;
89
+
90
+ /**
91
+ * The minimum time between tap(touchstart and touchend) events
92
+ *
93
+ * @type number
94
+ */
95
+ this.tapDelay = options.tapDelay || 200;
96
+
97
+ if (FastClick.notNeeded(layer)) {
98
+ return;
99
+ }
100
+
101
+ // Some old versions of Android don't have Function.prototype.bind
102
+ function bind(method, context) {
103
+ return function() { return method.apply(context, arguments); };
104
+ }
105
+
106
+
107
+ var methods = ['onMouse', 'onClick', 'onTouchStart', 'onTouchMove', 'onTouchEnd', 'onTouchCancel'];
108
+ var context = this;
109
+ for (var i = 0, l = methods.length; i < l; i++) {
110
+ context[methods[i]] = bind(context[methods[i]], context);
111
+ }
112
+
113
+ // Set up event handlers as required
114
+ if (deviceIsAndroid) {
115
+ layer.addEventListener('mouseover', this.onMouse, true);
116
+ layer.addEventListener('mousedown', this.onMouse, true);
117
+ layer.addEventListener('mouseup', this.onMouse, true);
118
+ }
119
+
120
+ layer.addEventListener('click', this.onClick, true);
121
+ layer.addEventListener('touchstart', this.onTouchStart, false);
122
+ layer.addEventListener('touchmove', this.onTouchMove, false);
123
+ layer.addEventListener('touchend', this.onTouchEnd, false);
124
+ layer.addEventListener('touchcancel', this.onTouchCancel, false);
125
+
126
+ // Hack is required for browsers that don't support Event#stopImmediatePropagation (e.g. Android 2)
127
+ // which is how FastClick normally stops click events bubbling to callbacks registered on the FastClick
128
+ // layer when they are cancelled.
129
+ if (!Event.prototype.stopImmediatePropagation) {
130
+ layer.removeEventListener = function(type, callback, capture) {
131
+ var rmv = Node.prototype.removeEventListener;
132
+ if (type === 'click') {
133
+ rmv.call(layer, type, callback.hijacked || callback, capture);
134
+ } else {
135
+ rmv.call(layer, type, callback, capture);
136
+ }
137
+ };
138
+
139
+ layer.addEventListener = function(type, callback, capture) {
140
+ var adv = Node.prototype.addEventListener;
141
+ if (type === 'click') {
142
+ adv.call(layer, type, callback.hijacked || (callback.hijacked = function(event) {
143
+ if (!event.propagationStopped) {
144
+ callback(event);
145
+ }
146
+ }), capture);
147
+ } else {
148
+ adv.call(layer, type, callback, capture);
149
+ }
150
+ };
151
+ }
152
+
153
+ // If a handler is already declared in the element's onclick attribute, it will be fired before
154
+ // FastClick's onClick handler. Fix this by pulling out the user-defined handler function and
155
+ // adding it as listener.
156
+ if (typeof layer.onclick === 'function') {
157
+
158
+ // Android browser on at least 3.2 requires a new reference to the function in layer.onclick
159
+ // - the old one won't work if passed to addEventListener directly.
160
+ oldOnClick = layer.onclick;
161
+ layer.addEventListener('click', function(event) {
162
+ oldOnClick(event);
163
+ }, false);
164
+ layer.onclick = null;
165
+ }
166
+ }
167
+
168
+
169
+ /**
170
+ * Android requires exceptions.
171
+ *
172
+ * @type boolean
173
+ */
174
+ var deviceIsAndroid = navigator.userAgent.indexOf('Android') > 0;
175
+
176
+
177
+ /**
178
+ * iOS requires exceptions.
179
+ *
180
+ * @type boolean
181
+ */
182
+ var deviceIsIOS = /iP(ad|hone|od)/.test(navigator.userAgent);
183
+
184
+
185
+ /**
186
+ * iOS 4 requires an exception for select elements.
187
+ *
188
+ * @type boolean
189
+ */
190
+ var deviceIsIOS4 = deviceIsIOS && (/OS 4_\d(_\d)?/).test(navigator.userAgent);
191
+
192
+
193
+ /**
194
+ * iOS 6.0(+?) requires the target element to be manually derived
195
+ *
196
+ * @type boolean
197
+ */
198
+ var deviceIsIOSWithBadTarget = deviceIsIOS && (/OS ([6-9]|\d{2})_\d/).test(navigator.userAgent);
199
+
200
+
201
+ /**
202
+ * Determine whether a given element requires a native click.
203
+ *
204
+ * @param {EventTarget|Element} target Target DOM element
205
+ * @returns {boolean} Returns true if the element needs a native click
206
+ */
207
+ FastClick.prototype.needsClick = function(target) {
208
+ 'use strict';
209
+ switch (target.nodeName.toLowerCase()) {
210
+
211
+ // Don't send a synthetic click to disabled inputs (issue #62)
212
+ case 'button':
213
+ case 'select':
214
+ case 'textarea':
215
+ if (target.disabled) {
216
+ return true;
217
+ }
218
+
219
+ break;
220
+ case 'input':
221
+
222
+ // File inputs need real clicks on iOS 6 due to a browser bug (issue #68)
223
+ if ((deviceIsIOS && target.type === 'file') || target.disabled) {
224
+ return true;
225
+ }
226
+
227
+ break;
228
+ case 'label':
229
+ case 'video':
230
+ return true;
231
+ }
232
+
233
+ return (/\bneedsclick\b/).test(target.className);
234
+ };
235
+
236
+
237
+ /**
238
+ * Determine whether a given element requires a call to focus to simulate click into element.
239
+ *
240
+ * @param {EventTarget|Element} target Target DOM element
241
+ * @returns {boolean} Returns true if the element requires a call to focus to simulate native click.
242
+ */
243
+ FastClick.prototype.needsFocus = function(target) {
244
+ 'use strict';
245
+ switch (target.nodeName.toLowerCase()) {
246
+ case 'textarea':
247
+ return true;
248
+ case 'select':
249
+ return !deviceIsAndroid;
250
+ case 'input':
251
+ switch (target.type) {
252
+ case 'button':
253
+ case 'checkbox':
254
+ case 'file':
255
+ case 'image':
256
+ case 'radio':
257
+ case 'submit':
258
+ return false;
259
+ }
260
+
261
+ // No point in attempting to focus disabled inputs
262
+ return !target.disabled && !target.readOnly;
263
+ default:
264
+ return (/\bneedsfocus\b/).test(target.className);
265
+ }
266
+ };
267
+
268
+
269
+ /**
270
+ * Send a click event to the specified element.
271
+ *
272
+ * @param {EventTarget|Element} targetElement
273
+ * @param {Event} event
274
+ */
275
+ FastClick.prototype.sendClick = function(targetElement, event) {
276
+ 'use strict';
277
+ var clickEvent, touch;
278
+
279
+ // On some Android devices activeElement needs to be blurred otherwise the synthetic click will have no effect (#24)
280
+ if (document.activeElement && document.activeElement !== targetElement) {
281
+ document.activeElement.blur();
282
+ }
283
+
284
+ touch = event.changedTouches[0];
285
+
286
+ // Synthesise a click event, with an extra attribute so it can be tracked
287
+ clickEvent = document.createEvent('MouseEvents');
288
+ clickEvent.initMouseEvent(this.determineEventType(targetElement), true, true, window, 1, touch.screenX, touch.screenY, touch.clientX, touch.clientY, false, false, false, false, 0, null);
289
+ clickEvent.forwardedTouchEvent = true;
290
+ targetElement.dispatchEvent(clickEvent);
291
+ };
292
+
293
+ FastClick.prototype.determineEventType = function(targetElement) {
294
+ 'use strict';
295
+
296
+ //Issue #159: Android Chrome Select Box does not open with a synthetic click event
297
+ if (deviceIsAndroid && targetElement.tagName.toLowerCase() === 'select') {
298
+ return 'mousedown';
299
+ }
300
+
301
+ return 'click';
302
+ };
303
+
304
+
305
+ /**
306
+ * @param {EventTarget|Element} targetElement
307
+ */
308
+ FastClick.prototype.focus = function(targetElement) {
309
+ 'use strict';
310
+ var length;
311
+
312
+ // Issue #160: on iOS 7, some input elements (e.g. date datetime) throw a vague TypeError on setSelectionRange. These elements don't have an integer value for the selectionStart and selectionEnd properties, but unfortunately that can't be used for detection because accessing the properties also throws a TypeError. Just check the type instead. Filed as Apple bug #15122724.
313
+ if (deviceIsIOS && targetElement.setSelectionRange && targetElement.type.indexOf('date') !== 0 && targetElement.type !== 'time') {
314
+ length = targetElement.value.length;
315
+ targetElement.setSelectionRange(length, length);
316
+ } else {
317
+ targetElement.focus();
318
+ }
319
+ };
320
+
321
+
322
+ /**
323
+ * Check whether the given target element is a child of a scrollable layer and if so, set a flag on it.
324
+ *
325
+ * @param {EventTarget|Element} targetElement
326
+ */
327
+ FastClick.prototype.updateScrollParent = function(targetElement) {
328
+ 'use strict';
329
+ var scrollParent, parentElement;
330
+
331
+ scrollParent = targetElement.fastClickScrollParent;
332
+
333
+ // Attempt to discover whether the target element is contained within a scrollable layer. Re-check if the
334
+ // target element was moved to another parent.
335
+ if (!scrollParent || !scrollParent.contains(targetElement)) {
336
+ parentElement = targetElement;
337
+ do {
338
+ if (parentElement.scrollHeight > parentElement.offsetHeight) {
339
+ scrollParent = parentElement;
340
+ targetElement.fastClickScrollParent = parentElement;
341
+ break;
342
+ }
343
+
344
+ parentElement = parentElement.parentElement;
345
+ } while (parentElement);
346
+ }
347
+
348
+ // Always update the scroll top tracker if possible.
349
+ if (scrollParent) {
350
+ scrollParent.fastClickLastScrollTop = scrollParent.scrollTop;
351
+ }
352
+ };
353
+
354
+
355
+ /**
356
+ * @param {EventTarget} targetElement
357
+ * @returns {Element|EventTarget}
358
+ */
359
+ FastClick.prototype.getTargetElementFromEventTarget = function(eventTarget) {
360
+ 'use strict';
361
+
362
+ // On some older browsers (notably Safari on iOS 4.1 - see issue #56) the event target may be a text node.
363
+ if (eventTarget.nodeType === Node.TEXT_NODE) {
364
+ return eventTarget.parentNode;
365
+ }
366
+
367
+ return eventTarget;
368
+ };
369
+
370
+
371
+ /**
372
+ * On touch start, record the position and scroll offset.
373
+ *
374
+ * @param {Event} event
375
+ * @returns {boolean}
376
+ */
377
+ FastClick.prototype.onTouchStart = function(event) {
378
+ 'use strict';
379
+ var targetElement, touch, selection;
380
+
381
+ // Ignore multiple touches, otherwise pinch-to-zoom is prevented if both fingers are on the FastClick element (issue #111).
382
+ if (event.targetTouches.length > 1) {
383
+ return true;
384
+ }
385
+
386
+ targetElement = this.getTargetElementFromEventTarget(event.target);
387
+ touch = event.targetTouches[0];
388
+
389
+ if (deviceIsIOS) {
390
+
391
+ // Only trusted events will deselect text on iOS (issue #49)
392
+ selection = window.getSelection();
393
+ if (selection.rangeCount && !selection.isCollapsed) {
394
+ return true;
395
+ }
396
+
397
+ if (!deviceIsIOS4) {
398
+
399
+ // Weird things happen on iOS when an alert or confirm dialog is opened from a click event callback (issue #23):
400
+ // when the user next taps anywhere else on the page, new touchstart and touchend events are dispatched
401
+ // with the same identifier as the touch event that previously triggered the click that triggered the alert.
402
+ // Sadly, there is an issue on iOS 4 that causes some normal touch events to have the same identifier as an
403
+ // immediately preceeding touch event (issue #52), so this fix is unavailable on that platform.
404
+ if (touch.identifier === this.lastTouchIdentifier) {
405
+ event.preventDefault();
406
+ return false;
407
+ }
408
+
409
+ this.lastTouchIdentifier = touch.identifier;
410
+
411
+ // If the target element is a child of a scrollable layer (using -webkit-overflow-scrolling: touch) and:
412
+ // 1) the user does a fling scroll on the scrollable layer
413
+ // 2) the user stops the fling scroll with another tap
414
+ // then the event.target of the last 'touchend' event will be the element that was under the user's finger
415
+ // when the fling scroll was started, causing FastClick to send a click event to that layer - unless a check
416
+ // is made to ensure that a parent layer was not scrolled before sending a synthetic click (issue #42).
417
+ this.updateScrollParent(targetElement);
418
+ }
419
+ }
420
+
421
+ this.trackingClick = true;
422
+ this.trackingClickStart = event.timeStamp;
423
+ this.targetElement = targetElement;
424
+
425
+ this.touchStartX = touch.pageX;
426
+ this.touchStartY = touch.pageY;
427
+
428
+ // Prevent phantom clicks on fast double-tap (issue #36)
429
+ if ((event.timeStamp - this.lastClickTime) < this.tapDelay) {
430
+ event.preventDefault();
431
+ }
432
+
433
+ return true;
434
+ };
435
+
436
+
437
+ /**
438
+ * Based on a touchmove event object, check whether the touch has moved past a boundary since it started.
439
+ *
440
+ * @param {Event} event
441
+ * @returns {boolean}
442
+ */
443
+ FastClick.prototype.touchHasMoved = function(event) {
444
+ 'use strict';
445
+ var touch = event.changedTouches[0], boundary = this.touchBoundary;
446
+
447
+ if (Math.abs(touch.pageX - this.touchStartX) > boundary || Math.abs(touch.pageY - this.touchStartY) > boundary) {
448
+ return true;
449
+ }
450
+
451
+ return false;
452
+ };
453
+
454
+
455
+ /**
456
+ * Update the last position.
457
+ *
458
+ * @param {Event} event
459
+ * @returns {boolean}
460
+ */
461
+ FastClick.prototype.onTouchMove = function(event) {
462
+ 'use strict';
463
+ if (!this.trackingClick) {
464
+ return true;
465
+ }
466
+
467
+ // If the touch has moved, cancel the click tracking
468
+ if (this.targetElement !== this.getTargetElementFromEventTarget(event.target) || this.touchHasMoved(event)) {
469
+ this.trackingClick = false;
470
+ this.targetElement = null;
471
+ }
472
+
473
+ return true;
474
+ };
475
+
476
+
477
+ /**
478
+ * Attempt to find the labelled control for the given label element.
479
+ *
480
+ * @param {EventTarget|HTMLLabelElement} labelElement
481
+ * @returns {Element|null}
482
+ */
483
+ FastClick.prototype.findControl = function(labelElement) {
484
+ 'use strict';
485
+
486
+ // Fast path for newer browsers supporting the HTML5 control attribute
487
+ if (labelElement.control !== undefined) {
488
+ return labelElement.control;
489
+ }
490
+
491
+ // All browsers under test that support touch events also support the HTML5 htmlFor attribute
492
+ if (labelElement.htmlFor) {
493
+ return document.getElementById(labelElement.htmlFor);
494
+ }
495
+
496
+ // If no for attribute exists, attempt to retrieve the first labellable descendant element
497
+ // the list of which is defined here: http://www.w3.org/TR/html5/forms.html#category-label
498
+ return labelElement.querySelector('button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea');
499
+ };
500
+
501
+
502
+ /**
503
+ * On touch end, determine whether to send a click event at once.
504
+ *
505
+ * @param {Event} event
506
+ * @returns {boolean}
507
+ */
508
+ FastClick.prototype.onTouchEnd = function(event) {
509
+ 'use strict';
510
+ var forElement, trackingClickStart, targetTagName, scrollParent, touch, targetElement = this.targetElement;
511
+
512
+ if (!this.trackingClick) {
513
+ return true;
514
+ }
515
+
516
+ // Prevent phantom clicks on fast double-tap (issue #36)
517
+ if ((event.timeStamp - this.lastClickTime) < this.tapDelay) {
518
+ this.cancelNextClick = true;
519
+ return true;
520
+ }
521
+
522
+ // Reset to prevent wrong click cancel on input (issue #156).
523
+ this.cancelNextClick = false;
524
+
525
+ this.lastClickTime = event.timeStamp;
526
+
527
+ trackingClickStart = this.trackingClickStart;
528
+ this.trackingClick = false;
529
+ this.trackingClickStart = 0;
530
+
531
+ // On some iOS devices, the targetElement supplied with the event is invalid if the layer
532
+ // is performing a transition or scroll, and has to be re-detected manually. Note that
533
+ // for this to function correctly, it must be called *after* the event target is checked!
534
+ // See issue #57; also filed as rdar://13048589 .
535
+ if (deviceIsIOSWithBadTarget) {
536
+ touch = event.changedTouches[0];
537
+
538
+ // In certain cases arguments of elementFromPoint can be negative, so prevent setting targetElement to null
539
+ targetElement = document.elementFromPoint(touch.pageX - window.pageXOffset, touch.pageY - window.pageYOffset) || targetElement;
540
+ targetElement.fastClickScrollParent = this.targetElement.fastClickScrollParent;
541
+ }
542
+
543
+ targetTagName = targetElement.tagName.toLowerCase();
544
+ if (targetTagName === 'label') {
545
+ forElement = this.findControl(targetElement);
546
+ if (forElement) {
547
+ this.focus(targetElement);
548
+ if (deviceIsAndroid) {
549
+ return false;
550
+ }
551
+
552
+ targetElement = forElement;
553
+ }
554
+ } else if (this.needsFocus(targetElement)) {
555
+
556
+ // Case 1: If the touch started a while ago (best guess is 100ms based on tests for issue #36) then focus will be triggered anyway. Return early and unset the target element reference so that the subsequent click will be allowed through.
557
+ // Case 2: Without this exception for input elements tapped when the document is contained in an iframe, then any inputted text won't be visible even though the value attribute is updated as the user types (issue #37).
558
+ if ((event.timeStamp - trackingClickStart) > 100 || (deviceIsIOS && window.top !== window && targetTagName === 'input')) {
559
+ this.targetElement = null;
560
+ return false;
561
+ }
562
+
563
+ this.focus(targetElement);
564
+ this.sendClick(targetElement, event);
565
+
566
+ // Select elements need the event to go through on iOS 4, otherwise the selector menu won't open.
567
+ // Also this breaks opening selects when VoiceOver is active on iOS6, iOS7 (and possibly others)
568
+ if (!deviceIsIOS || targetTagName !== 'select') {
569
+ this.targetElement = null;
570
+ event.preventDefault();
571
+ }
572
+
573
+ return false;
574
+ }
575
+
576
+ if (deviceIsIOS && !deviceIsIOS4) {
577
+
578
+ // Don't send a synthetic click event if the target element is contained within a parent layer that was scrolled
579
+ // and this tap is being used to stop the scrolling (usually initiated by a fling - issue #42).
580
+ scrollParent = targetElement.fastClickScrollParent;
581
+ if (scrollParent && scrollParent.fastClickLastScrollTop !== scrollParent.scrollTop) {
582
+ return true;
583
+ }
584
+ }
585
+
586
+ // Prevent the actual click from going though - unless the target node is marked as requiring
587
+ // real clicks or if it is in the whitelist in which case only non-programmatic clicks are permitted.
588
+ if (!this.needsClick(targetElement)) {
589
+ event.preventDefault();
590
+ this.sendClick(targetElement, event);
591
+ }
592
+
593
+ return false;
594
+ };
595
+
596
+
597
+ /**
598
+ * On touch cancel, stop tracking the click.
599
+ *
600
+ * @returns {void}
601
+ */
602
+ FastClick.prototype.onTouchCancel = function() {
603
+ 'use strict';
604
+ this.trackingClick = false;
605
+ this.targetElement = null;
606
+ };
607
+
608
+
609
+ /**
610
+ * Determine mouse events which should be permitted.
611
+ *
612
+ * @param {Event} event
613
+ * @returns {boolean}
614
+ */
615
+ FastClick.prototype.onMouse = function(event) {
616
+ 'use strict';
617
+
618
+ // If a target element was never set (because a touch event was never fired) allow the event
619
+ if (!this.targetElement) {
620
+ return true;
621
+ }
622
+
623
+ if (event.forwardedTouchEvent) {
624
+ return true;
625
+ }
626
+
627
+ // Programmatically generated events targeting a specific element should be permitted
628
+ if (!event.cancelable) {
629
+ return true;
630
+ }
631
+
632
+ // Derive and check the target element to see whether the mouse event needs to be permitted;
633
+ // unless explicitly enabled, prevent non-touch click events from triggering actions,
634
+ // to prevent ghost/doubleclicks.
635
+ if (!this.needsClick(this.targetElement) || this.cancelNextClick) {
636
+
637
+ // Prevent any user-added listeners declared on FastClick element from being fired.
638
+ if (event.stopImmediatePropagation) {
639
+ event.stopImmediatePropagation();
640
+ } else {
641
+
642
+ // Part of the hack for browsers that don't support Event#stopImmediatePropagation (e.g. Android 2)
643
+ event.propagationStopped = true;
644
+ }
645
+
646
+ // Cancel the event
647
+ event.stopPropagation();
648
+ event.preventDefault();
649
+
650
+ return false;
651
+ }
652
+
653
+ // If the mouse event is permitted, return true for the action to go through.
654
+ return true;
655
+ };
656
+
657
+
658
+ /**
659
+ * On actual clicks, determine whether this is a touch-generated click, a click action occurring
660
+ * naturally after a delay after a touch (which needs to be cancelled to avoid duplication), or
661
+ * an actual click which should be permitted.
662
+ *
663
+ * @param {Event} event
664
+ * @returns {boolean}
665
+ */
666
+ FastClick.prototype.onClick = function(event) {
667
+ 'use strict';
668
+ var permitted;
669
+
670
+ // It's possible for another FastClick-like library delivered with third-party code to fire a click event before FastClick does (issue #44). In that case, set the click-tracking flag back to false and return early. This will cause onTouchEnd to return early.
671
+ if (this.trackingClick) {
672
+ this.targetElement = null;
673
+ this.trackingClick = false;
674
+ return true;
675
+ }
676
+
677
+ // Very odd behaviour on iOS (issue #18): if a submit element is present inside a form and the user hits enter in the iOS simulator or clicks the Go button on the pop-up OS keyboard the a kind of 'fake' click event will be triggered with the submit-type input element as the target.
678
+ if (event.target.type === 'submit' && event.detail === 0) {
679
+ return true;
680
+ }
681
+
682
+ permitted = this.onMouse(event);
683
+
684
+ // Only unset targetElement if the click is not permitted. This will ensure that the check for !targetElement in onMouse fails and the browser's click doesn't go through.
685
+ if (!permitted) {
686
+ this.targetElement = null;
687
+ }
688
+
689
+ // If clicks are permitted, return true for the action to go through.
690
+ return permitted;
691
+ };
692
+
693
+
694
+ /**
695
+ * Remove all FastClick's event listeners.
696
+ *
697
+ * @returns {void}
698
+ */
699
+ FastClick.prototype.destroy = function() {
700
+ 'use strict';
701
+ var layer = this.layer;
702
+
703
+ if (deviceIsAndroid) {
704
+ layer.removeEventListener('mouseover', this.onMouse, true);
705
+ layer.removeEventListener('mousedown', this.onMouse, true);
706
+ layer.removeEventListener('mouseup', this.onMouse, true);
707
+ }
708
+
709
+ layer.removeEventListener('click', this.onClick, true);
710
+ layer.removeEventListener('touchstart', this.onTouchStart, false);
711
+ layer.removeEventListener('touchmove', this.onTouchMove, false);
712
+ layer.removeEventListener('touchend', this.onTouchEnd, false);
713
+ layer.removeEventListener('touchcancel', this.onTouchCancel, false);
714
+ };
715
+
716
+
717
+ /**
718
+ * Check whether FastClick is needed.
719
+ *
720
+ * @param {Element} layer The layer to listen on
721
+ */
722
+ FastClick.notNeeded = function(layer) {
723
+ 'use strict';
724
+ var metaViewport;
725
+ var chromeVersion;
726
+
727
+ // Devices that don't support touch don't need FastClick
728
+ if (typeof window.ontouchstart === 'undefined') {
729
+ return true;
730
+ }
731
+
732
+ // Chrome version - zero for other browsers
733
+ chromeVersion = +(/Chrome\/([0-9]+)/.exec(navigator.userAgent) || [,0])[1];
734
+
735
+ if (chromeVersion) {
736
+
737
+ if (deviceIsAndroid) {
738
+ metaViewport = document.querySelector('meta[name=viewport]');
739
+
740
+ if (metaViewport) {
741
+ // Chrome on Android with user-scalable="no" doesn't need FastClick (issue #89)
742
+ if (metaViewport.content.indexOf('user-scalable=no') !== -1) {
743
+ return true;
744
+ }
745
+ // Chrome 32 and above with width=device-width or less don't need FastClick
746
+ if (chromeVersion > 31 && document.documentElement.scrollWidth <= window.outerWidth) {
747
+ return true;
748
+ }
749
+ }
750
+
751
+ // Chrome desktop doesn't need FastClick (issue #15)
752
+ } else {
753
+ return true;
754
+ }
755
+ }
756
+
757
+ // IE10 with -ms-touch-action: none, which disables double-tap-to-zoom (issue #97)
758
+ if (layer.style.msTouchAction === 'none') {
759
+ return true;
760
+ }
761
+
762
+ return false;
763
+ };
764
+
765
+
766
+ /**
767
+ * Factory method for creating a FastClick object
768
+ *
769
+ * @param {Element} layer The layer to listen on
770
+ * @param {Object} options The options to override the defaults
771
+ */
772
+ FastClick.attach = function(layer, options) {
773
+ 'use strict';
774
+ return new FastClick(layer, options);
775
+ };
776
+
777
+
778
+ if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {
779
+
780
+ // AMD. Register as an anonymous module.
781
+ define(function() {
782
+ 'use strict';
783
+ return FastClick;
784
+ });
785
+ } else if (typeof module !== 'undefined' && module.exports) {
786
+ module.exports = FastClick.attach;
787
+ module.exports.FastClick = FastClick;
788
+ } else {
789
+ window.FastClick = FastClick;
790
+ }