type_station 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (175) hide show
  1. checksums.yaml +4 -4
  2. data/lib/type_station/version.rb +1 -1
  3. data/spec/dummy/log/development.log +6757 -0
  4. data/spec/dummy/tmp/cache/assets/development/sass/d51071614a47c21d9e7a31bac67dfe51fed9abe3/_buttons.scssc +0 -0
  5. data/spec/dummy/tmp/cache/assets/development/sass/d51071614a47c21d9e7a31bac67dfe51fed9abe3/_mixins.scssc +0 -0
  6. data/spec/dummy/tmp/cache/assets/development/sass/d51071614a47c21d9e7a31bac67dfe51fed9abe3/_variables.scssc +0 -0
  7. data/spec/dummy/tmp/cache/assets/development/sass/e63a0fef5d60e74f917815e496f07ccb348b5adc/_alerts.scssc +0 -0
  8. data/spec/dummy/tmp/cache/assets/development/sass/e63a0fef5d60e74f917815e496f07ccb348b5adc/_background-variant.scssc +0 -0
  9. data/spec/dummy/tmp/cache/assets/development/sass/e63a0fef5d60e74f917815e496f07ccb348b5adc/_border-radius.scssc +0 -0
  10. data/spec/dummy/tmp/cache/assets/development/sass/e63a0fef5d60e74f917815e496f07ccb348b5adc/_buttons.scssc +0 -0
  11. data/spec/dummy/tmp/cache/assets/development/sass/e63a0fef5d60e74f917815e496f07ccb348b5adc/_center-block.scssc +0 -0
  12. data/spec/dummy/tmp/cache/assets/development/sass/e63a0fef5d60e74f917815e496f07ccb348b5adc/_clearfix.scssc +0 -0
  13. data/spec/dummy/tmp/cache/assets/development/sass/e63a0fef5d60e74f917815e496f07ccb348b5adc/_forms.scssc +0 -0
  14. data/spec/dummy/tmp/cache/assets/development/sass/e63a0fef5d60e74f917815e496f07ccb348b5adc/_gradients.scssc +0 -0
  15. data/spec/dummy/tmp/cache/assets/development/sass/e63a0fef5d60e74f917815e496f07ccb348b5adc/_grid-framework.scssc +0 -0
  16. data/spec/dummy/tmp/cache/assets/development/sass/e63a0fef5d60e74f917815e496f07ccb348b5adc/_grid.scssc +0 -0
  17. data/spec/dummy/tmp/cache/assets/development/sass/e63a0fef5d60e74f917815e496f07ccb348b5adc/_hide-text.scssc +0 -0
  18. data/spec/dummy/tmp/cache/assets/development/sass/e63a0fef5d60e74f917815e496f07ccb348b5adc/_image.scssc +0 -0
  19. data/spec/dummy/tmp/cache/assets/development/sass/e63a0fef5d60e74f917815e496f07ccb348b5adc/_labels.scssc +0 -0
  20. data/spec/dummy/tmp/cache/assets/development/sass/e63a0fef5d60e74f917815e496f07ccb348b5adc/_list-group.scssc +0 -0
  21. data/spec/dummy/tmp/cache/assets/development/sass/e63a0fef5d60e74f917815e496f07ccb348b5adc/_nav-divider.scssc +0 -0
  22. data/spec/dummy/tmp/cache/assets/development/sass/e63a0fef5d60e74f917815e496f07ccb348b5adc/_nav-vertical-align.scssc +0 -0
  23. data/spec/dummy/tmp/cache/assets/development/sass/e63a0fef5d60e74f917815e496f07ccb348b5adc/_opacity.scssc +0 -0
  24. data/spec/dummy/tmp/cache/assets/development/sass/e63a0fef5d60e74f917815e496f07ccb348b5adc/_pagination.scssc +0 -0
  25. data/spec/dummy/tmp/cache/assets/development/sass/e63a0fef5d60e74f917815e496f07ccb348b5adc/_panels.scssc +0 -0
  26. data/spec/dummy/tmp/cache/assets/development/sass/e63a0fef5d60e74f917815e496f07ccb348b5adc/_progress-bar.scssc +0 -0
  27. data/spec/dummy/tmp/cache/assets/development/sass/e63a0fef5d60e74f917815e496f07ccb348b5adc/_reset-filter.scssc +0 -0
  28. data/spec/dummy/tmp/cache/assets/development/sass/e63a0fef5d60e74f917815e496f07ccb348b5adc/_resize.scssc +0 -0
  29. data/spec/dummy/tmp/cache/assets/development/sass/e63a0fef5d60e74f917815e496f07ccb348b5adc/_responsive-visibility.scssc +0 -0
  30. data/spec/dummy/tmp/cache/assets/development/sass/e63a0fef5d60e74f917815e496f07ccb348b5adc/_size.scssc +0 -0
  31. data/spec/dummy/tmp/cache/assets/development/sass/e63a0fef5d60e74f917815e496f07ccb348b5adc/_tab-focus.scssc +0 -0
  32. data/spec/dummy/tmp/cache/assets/development/sass/e63a0fef5d60e74f917815e496f07ccb348b5adc/_table-row.scssc +0 -0
  33. data/spec/dummy/tmp/cache/assets/development/sass/e63a0fef5d60e74f917815e496f07ccb348b5adc/_text-emphasis.scssc +0 -0
  34. data/spec/dummy/tmp/cache/assets/development/sass/e63a0fef5d60e74f917815e496f07ccb348b5adc/_text-overflow.scssc +0 -0
  35. data/spec/dummy/tmp/cache/assets/development/sass/e63a0fef5d60e74f917815e496f07ccb348b5adc/_vendor-prefixes.scssc +0 -0
  36. data/spec/dummy/tmp/cache/assets/development/sass/fde2fd9fd4415e2893f7c202128d5909c847645f/admin_bar.css.scssc +0 -0
  37. data/spec/dummy/tmp/cache/assets/development/sass/fde2fd9fd4415e2893f7c202128d5909c847645f/base.css.scssc +0 -0
  38. data/spec/dummy/tmp/cache/assets/development/sprockets/0825425ebf24766be13ebf4e696dc267 +0 -0
  39. data/spec/dummy/tmp/cache/assets/development/sprockets/0aa47ff15e22d0e74389460968c32717 +0 -0
  40. data/spec/dummy/tmp/cache/assets/development/sprockets/0b495c71c71a2d087e00d9f77c89b537 +0 -0
  41. data/spec/dummy/tmp/cache/assets/development/sprockets/0cbda04368ddbf6d761e788334075e7c +0 -0
  42. data/spec/dummy/tmp/cache/assets/development/sprockets/0d8f54d1682f575aec8f27993d3af45e +0 -0
  43. data/spec/dummy/tmp/cache/assets/development/sprockets/0dd8d5d73e593c919592d3d02deb62e8 +0 -0
  44. data/spec/dummy/tmp/cache/assets/development/sprockets/0e846d0579634bd3924d701ebcd09040 +0 -0
  45. data/spec/dummy/tmp/cache/assets/development/sprockets/127cceefef1ada19384ec7fec980c5ee +0 -0
  46. data/spec/dummy/tmp/cache/assets/development/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
  47. data/spec/dummy/tmp/cache/assets/development/sprockets/147a08ea451b98ff5a28a0088b7d5c89 +0 -0
  48. data/spec/dummy/tmp/cache/assets/development/sprockets/182d8b06dcdb4f799088741f553903d3 +0 -0
  49. data/spec/dummy/tmp/cache/assets/development/sprockets/1b64a5fd92110dbd078f4ea964e2d0ad +0 -0
  50. data/spec/dummy/tmp/cache/assets/development/sprockets/2155dbeb10a65c2519b49179b3bc6f3a +0 -0
  51. data/spec/dummy/tmp/cache/assets/development/sprockets/21f725a9b3479e57849414f8272a905b +0 -0
  52. data/spec/dummy/tmp/cache/assets/development/sprockets/2535956b4e5e79e8fbd3d30f68de7024 +0 -0
  53. data/spec/dummy/tmp/cache/assets/development/sprockets/28ad54c6e5882957dd269b1b2a3c3c75 +0 -0
  54. data/spec/dummy/tmp/cache/assets/development/sprockets/2d0ee72828e0dcbaf2390d3d67595461 +0 -0
  55. data/spec/dummy/tmp/cache/assets/development/sprockets/2d13dd9465026b66cce912e30e142020 +0 -0
  56. data/spec/dummy/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
  57. data/spec/dummy/tmp/cache/assets/development/sprockets/300f6f1e08668cacf691691df4d13889 +0 -0
  58. data/spec/dummy/tmp/cache/assets/development/sprockets/30e3d4f790a4234a26c7f74efba15a2e +0 -0
  59. data/spec/dummy/tmp/cache/assets/development/sprockets/311ffc36d5a7e1d3216e672b3e57e7ed +0 -0
  60. data/spec/dummy/tmp/cache/assets/development/sprockets/33ba18d4294cbb074bd3afee4728e2b9 +0 -0
  61. data/spec/dummy/tmp/cache/assets/development/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
  62. data/spec/dummy/tmp/cache/assets/development/sprockets/3a3d03c0a92f21419e1e85991774a28b +0 -0
  63. data/spec/dummy/tmp/cache/assets/development/sprockets/3dea6de9e06b1e372ebf4790f5eecc48 +0 -0
  64. data/spec/dummy/tmp/cache/assets/development/sprockets/3e7667a45f81a73030337cb8afe0acc3 +0 -0
  65. data/spec/dummy/tmp/cache/assets/development/sprockets/4144b15d96ec80b5c7fb367b57aaeef3 +0 -0
  66. data/spec/dummy/tmp/cache/assets/development/sprockets/4729c7f6ab6a91a079ab04a8f04e932b +0 -0
  67. data/spec/dummy/tmp/cache/assets/development/sprockets/48f052ab53e11ca42b15cc7f40fe2d4c +0 -0
  68. data/spec/dummy/tmp/cache/assets/development/sprockets/4c324a18fe6bf7dbf7a04cccbfdb366e +0 -0
  69. data/spec/dummy/tmp/cache/assets/development/sprockets/4fc791a177c880f50bf425e8d2862c20 +0 -0
  70. data/spec/dummy/tmp/cache/assets/development/sprockets/535f36c50d5b36ff83bc03bc6a19b8fc +0 -0
  71. data/spec/dummy/tmp/cache/assets/development/sprockets/55c2f55c27a62b998b8d33555158da53 +0 -0
  72. data/spec/dummy/tmp/cache/assets/development/sprockets/56afaea2e164564be4d5f5bbc7f81050 +0 -0
  73. data/spec/dummy/tmp/cache/assets/development/sprockets/570677a99f6abc19d74f793d5cb24f5f +0 -0
  74. data/spec/dummy/tmp/cache/assets/development/sprockets/575f0b5d245887cf587b0169d6993308 +0 -0
  75. data/spec/dummy/tmp/cache/assets/development/sprockets/579b1a727fe5b55dfe450b0835c56a65 +0 -0
  76. data/spec/dummy/tmp/cache/assets/development/sprockets/5a806147b739da644a296d2def76c243 +0 -0
  77. data/spec/dummy/tmp/cache/assets/development/sprockets/5c2d0bbd303da757c44328df9bccedf7 +0 -0
  78. data/spec/dummy/tmp/cache/assets/development/sprockets/60b14e8e4c0d91f7af9d162cf4c67a9c +0 -0
  79. data/spec/dummy/tmp/cache/assets/development/sprockets/61d7a0e99e49f7a9917d385223a97015 +0 -0
  80. data/spec/dummy/tmp/cache/assets/development/sprockets/623a22125c47f6f4391fd1a56e40b8a0 +0 -0
  81. data/spec/dummy/tmp/cache/assets/development/sprockets/65cf3864264ab5fd70d6e74a934adf8d +0 -0
  82. data/spec/dummy/tmp/cache/assets/development/sprockets/6e0fcc860289a427d98aa4ee86bd12b7 +0 -0
  83. data/spec/dummy/tmp/cache/assets/development/sprockets/6f7174fb7f1fbb8e01d382a128a979e8 +0 -0
  84. data/spec/dummy/tmp/cache/assets/development/sprockets/70dfe9a7b27467587b0d4d00a7e0f6fb +0 -0
  85. data/spec/dummy/tmp/cache/assets/development/sprockets/71e10ee69b177ab54cb6033385a77ef9 +0 -0
  86. data/spec/dummy/tmp/cache/assets/development/sprockets/73cc8ce397fbfe4408bcac87302a6952 +0 -0
  87. data/spec/dummy/tmp/cache/assets/development/sprockets/740af710fe4125080680a8561398cd43 +0 -0
  88. data/spec/dummy/tmp/cache/assets/development/sprockets/7cfbbb15a3f9dcb4a5ee988ea309504d +0 -0
  89. data/spec/dummy/tmp/cache/assets/development/sprockets/7f14b0b39c11df4f58e03d390b589547 +0 -0
  90. data/spec/dummy/tmp/cache/assets/development/sprockets/7fc9c7161658070c78790a28b4ff590f +0 -0
  91. data/spec/dummy/tmp/cache/assets/development/sprockets/825bd4dba50f1ea2c0ae5e8a3708119e +0 -0
  92. data/spec/dummy/tmp/cache/assets/development/sprockets/85c54085eea77d703dd054b1adcf309d +0 -0
  93. data/spec/dummy/tmp/cache/assets/development/sprockets/85d858ed64f06543161931735cb77748 +0 -0
  94. data/spec/dummy/tmp/cache/assets/development/sprockets/85fe1c52386ac4419fdf124a22228a98 +0 -0
  95. data/spec/dummy/tmp/cache/assets/development/sprockets/8803d0a63bbf3fce683c968d4a900480 +0 -0
  96. data/spec/dummy/tmp/cache/assets/development/sprockets/887e2151ef4cd6e915fd9bfc27c41d7d +0 -0
  97. data/spec/dummy/tmp/cache/assets/development/sprockets/8b33a159429f95c8fbb14e5d45b01967 +0 -0
  98. data/spec/dummy/tmp/cache/assets/development/sprockets/8bec81b5959299e431f5adfc6c410719 +0 -0
  99. data/spec/dummy/tmp/cache/assets/development/sprockets/8caeabedf4518243187dbf20bf76a0d8 +0 -0
  100. data/spec/dummy/tmp/cache/assets/development/sprockets/8e60a95e73cedfb4b58fbf6fc32564b3 +0 -0
  101. data/spec/dummy/tmp/cache/assets/development/sprockets/90c324b461b60cdeb6b549dbf932f162 +0 -0
  102. data/spec/dummy/tmp/cache/assets/development/sprockets/92c1d07e65b1251e6a9f62064f749658 +0 -0
  103. data/spec/dummy/tmp/cache/assets/development/sprockets/92d59399e3f951cc11721f03a2b328fd +0 -0
  104. data/spec/dummy/tmp/cache/assets/development/sprockets/966db607ae0e7aad72cf171b8fec537a +0 -0
  105. data/spec/dummy/tmp/cache/assets/development/sprockets/99fd048521a12239746f91aa138613bf +0 -0
  106. data/spec/dummy/tmp/cache/assets/development/sprockets/9c8cd77db76e28f0a074573a72509ce9 +0 -0
  107. data/spec/dummy/tmp/cache/assets/development/sprockets/a165e7cd7871ea0af12d29ef10193272 +0 -0
  108. data/spec/dummy/tmp/cache/assets/development/sprockets/a2b3a282d5d8a5c20444d1a27f70a61e +0 -0
  109. data/spec/dummy/tmp/cache/assets/development/sprockets/a539d3e91d5fb8eeb973ac8706bbf5c9 +0 -0
  110. data/spec/dummy/tmp/cache/assets/development/sprockets/a87019c62b5fb3b3dc75db921d98ad59 +0 -0
  111. data/spec/dummy/tmp/cache/assets/development/sprockets/a87cf4d10d892fb23f2fc818d7ca7207 +0 -0
  112. data/spec/dummy/tmp/cache/assets/development/sprockets/ab4192212bd78e95967e5a716548236f +0 -0
  113. data/spec/dummy/tmp/cache/assets/development/sprockets/af97ed366de5933460d41b9198ddc99e +0 -0
  114. data/spec/dummy/tmp/cache/assets/development/sprockets/afad1821c4be2be037ae8672c21db00a +0 -0
  115. data/spec/dummy/tmp/cache/assets/development/sprockets/b1a982f644c0350cb843b63d69a9506f +0 -0
  116. data/spec/dummy/tmp/cache/assets/development/sprockets/b6f21db694cacb7f5bcbb93cf45f65ed +0 -0
  117. data/spec/dummy/tmp/cache/assets/development/sprockets/b89a0282f37737eb86781a8ddbdf14a3 +0 -0
  118. data/spec/dummy/tmp/cache/assets/development/sprockets/bc2f1083a88e2e7c4e88f13f025824ed +0 -0
  119. data/spec/dummy/tmp/cache/assets/development/sprockets/bd3113e1418cbc640eb6e1b06d486163 +0 -0
  120. data/spec/dummy/tmp/cache/assets/development/sprockets/c0600b832214f9e16294a1c37c0c3f6e +0 -0
  121. data/spec/dummy/tmp/cache/assets/development/sprockets/c0c85148a1307bb6d6a87139811da3ad +0 -0
  122. data/spec/dummy/tmp/cache/assets/development/sprockets/c4ec64020d1ff391bab8c2f0bbc7cd02 +0 -0
  123. data/spec/dummy/tmp/cache/assets/development/sprockets/cb80f61fc678a70e99e16156ae6e07d1 +0 -0
  124. data/spec/dummy/tmp/cache/assets/development/sprockets/cc9a378dda4e65e86b1f3fd522d019a1 +0 -0
  125. data/spec/dummy/tmp/cache/assets/development/sprockets/ce5a41536c75e4bc37a5b0be19e9f786 +0 -0
  126. data/spec/dummy/tmp/cache/assets/development/sprockets/cf5014041f97c55eee7c67feddf11b81 +0 -0
  127. data/spec/dummy/tmp/cache/assets/development/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
  128. data/spec/dummy/tmp/cache/assets/development/sprockets/d02809f043bce2445374a43a8f64b4b8 +0 -0
  129. data/spec/dummy/tmp/cache/assets/development/sprockets/d05d272f053261f2d5e3dcca85f19172 +0 -0
  130. data/spec/dummy/tmp/cache/assets/development/sprockets/d05d2c6ed489a61e2a9756430af9f48f +0 -0
  131. data/spec/dummy/tmp/cache/assets/development/sprockets/d07ab5a5474c0fb71b3bd351947707e5 +0 -0
  132. data/spec/dummy/tmp/cache/assets/development/sprockets/d1e5823c113c9ee03e6c6d7773eb6fac +0 -0
  133. data/spec/dummy/tmp/cache/assets/development/sprockets/d1f0a2d6fd58a203f3ca66950c822c33 +0 -0
  134. data/spec/dummy/tmp/cache/assets/development/sprockets/d4248f8b11c6b21abffed4a5e718722d +0 -0
  135. data/spec/dummy/tmp/cache/assets/development/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
  136. data/spec/dummy/tmp/cache/assets/development/sprockets/db1a08b3c680b077476f767a8addb44b +0 -0
  137. data/spec/dummy/tmp/cache/assets/development/sprockets/dd9f84cc20227ad66bbd1f26bbc11ccc +0 -0
  138. data/spec/dummy/tmp/cache/assets/development/sprockets/de9d72cab443cce32e1d45e62d2b4c04 +0 -0
  139. data/spec/dummy/tmp/cache/assets/development/sprockets/e03c578b73cf9936edc84ff2b48c07da +0 -0
  140. data/spec/dummy/tmp/cache/assets/development/sprockets/e04691fd3eaee6408ac1d1b7fade69e6 +0 -0
  141. data/spec/dummy/tmp/cache/assets/development/sprockets/e40f49d676971d013ad991bdf2dc344b +0 -0
  142. data/spec/dummy/tmp/cache/assets/development/sprockets/e736f7cd2394078039a3b11e6ee42802 +0 -0
  143. data/spec/dummy/tmp/cache/assets/development/sprockets/ebdd71d1c3cf34d7d174e5c1abb123b7 +0 -0
  144. data/spec/dummy/tmp/cache/assets/development/sprockets/ec22367449630f093cf0449cea0abdfd +0 -0
  145. data/spec/dummy/tmp/cache/assets/development/sprockets/f084a3a159f23d2f0f9943c4a2e5f8e9 +0 -0
  146. data/spec/dummy/tmp/cache/assets/development/sprockets/f14e64162f52a8d2d22ff9e1c1cc4fac +0 -0
  147. data/spec/dummy/tmp/cache/assets/development/sprockets/f566af7037e0e3042b19bd5ee11b21c4 +0 -0
  148. data/spec/dummy/tmp/cache/assets/development/sprockets/f7c0e18cf77ef251a27e9ff91578fb47 +0 -0
  149. data/spec/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
  150. data/spec/dummy/tmp/cache/assets/development/sprockets/fa8cab89937bf25aa48b23445f1b4f64 +0 -0
  151. data/spec/dummy/tmp/cache/assets/development/sprockets/fc5de94b46d8aff03ec5355f912a9a81 +0 -0
  152. data/spec/dummy/tmp/cache/assets/development/sprockets/fd1cae0417fea68172ab7b747a1d6fd8 +0 -0
  153. data/spec/dummy/tmp/cache/assets/development/sprockets/fd2dacd118d6197c3a9325e2103abe7d +0 -0
  154. data/spec/dummy/tmp/cache/assets/development/sprockets/fe43b3c0b7d3233a250ce9c46342919c +0 -0
  155. data/vendor/assets/javascripts/drop.js +1799 -0
  156. data/vendor/assets/javascripts/jquery.cloudinary.js +800 -0
  157. data/vendor/assets/javascripts/medium-editor.js +1920 -0
  158. data/vendor/assets/javascripts/vex.combined.min.js +2 -0
  159. data/vendor/assets/stylesheets/drop-theme-arrows-bounce-dark.css +222 -0
  160. data/vendor/assets/stylesheets/drop-theme-arrows-bounce.css +230 -0
  161. data/vendor/assets/stylesheets/drop-theme-arrows.css +120 -0
  162. data/vendor/assets/stylesheets/medium-editor/medium-editor.css +170 -0
  163. data/vendor/assets/stylesheets/medium-editor/themes/bootstrap.css +67 -0
  164. data/vendor/assets/stylesheets/medium-editor/themes/bootstrap.min.css +1 -0
  165. data/vendor/assets/stylesheets/medium-editor/themes/default.css +60 -0
  166. data/vendor/assets/stylesheets/medium-editor/themes/default.min.css +1 -0
  167. data/vendor/assets/stylesheets/medium-editor/themes/flat.css +56 -0
  168. data/vendor/assets/stylesheets/medium-editor/themes/flat.min.css +1 -0
  169. data/vendor/assets/stylesheets/medium-editor/themes/mani.css +53 -0
  170. data/vendor/assets/stylesheets/medium-editor/themes/mani.min.css +1 -0
  171. data/vendor/assets/stylesheets/medium-editor/themes/roman.css +54 -0
  172. data/vendor/assets/stylesheets/medium-editor/themes/roman.min.css +1 -0
  173. data/vendor/assets/stylesheets/vex-theme-os.css +533 -0
  174. data/vendor/assets/stylesheets/vex.css +335 -0
  175. metadata +326 -2
@@ -0,0 +1,1799 @@
1
+ /*! drop 0.5.4 */
2
+ /*! tether 0.6.5 */
3
+
4
+
5
+ (function(root, factory) {
6
+ if (typeof define === 'function' && define.amd) {
7
+ define(factory);
8
+ } else if (typeof exports === 'object') {
9
+ module.exports = factory(require,exports,module);
10
+ } else {
11
+ root.Tether = factory();
12
+ }
13
+ }(this, function(require,exports,module) {
14
+
15
+ (function() {
16
+ var Evented, addClass, defer, deferred, extend, flush, getBounds, getOffsetParent, getOrigin, getScrollBarSize, getScrollParent, hasClass, node, removeClass, uniqueId, updateClasses, zeroPosCache,
17
+ __hasProp = {}.hasOwnProperty,
18
+ __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; },
19
+ __slice = [].slice;
20
+
21
+ if (this.Tether == null) {
22
+ this.Tether = {
23
+ modules: []
24
+ };
25
+ }
26
+
27
+ getScrollParent = function(el) {
28
+ var parent, position, scrollParent, style, _ref;
29
+ position = getComputedStyle(el).position;
30
+ if (position === 'fixed') {
31
+ return el;
32
+ }
33
+ scrollParent = void 0;
34
+ parent = el;
35
+ while (parent = parent.parentNode) {
36
+ try {
37
+ style = getComputedStyle(parent);
38
+ } catch (_error) {}
39
+ if (style == null) {
40
+ return parent;
41
+ }
42
+ if (/(auto|scroll)/.test(style['overflow'] + style['overflow-y'] + style['overflow-x'])) {
43
+ if (position !== 'absolute' || ((_ref = style['position']) === 'relative' || _ref === 'absolute' || _ref === 'fixed')) {
44
+ return parent;
45
+ }
46
+ }
47
+ }
48
+ return document.body;
49
+ };
50
+
51
+ uniqueId = (function() {
52
+ var id;
53
+ id = 0;
54
+ return function() {
55
+ return id++;
56
+ };
57
+ })();
58
+
59
+ zeroPosCache = {};
60
+
61
+ getOrigin = function(doc) {
62
+ var id, k, node, v, _ref;
63
+ node = doc._tetherZeroElement;
64
+ if (node == null) {
65
+ node = doc.createElement('div');
66
+ node.setAttribute('data-tether-id', uniqueId());
67
+ extend(node.style, {
68
+ top: 0,
69
+ left: 0,
70
+ position: 'absolute'
71
+ });
72
+ doc.body.appendChild(node);
73
+ doc._tetherZeroElement = node;
74
+ }
75
+ id = node.getAttribute('data-tether-id');
76
+ if (zeroPosCache[id] == null) {
77
+ zeroPosCache[id] = {};
78
+ _ref = node.getBoundingClientRect();
79
+ for (k in _ref) {
80
+ v = _ref[k];
81
+ zeroPosCache[id][k] = v;
82
+ }
83
+ defer(function() {
84
+ return zeroPosCache[id] = void 0;
85
+ });
86
+ }
87
+ return zeroPosCache[id];
88
+ };
89
+
90
+ node = null;
91
+
92
+ getBounds = function(el) {
93
+ var box, doc, docEl, k, origin, v, _ref;
94
+ if (el === document) {
95
+ doc = document;
96
+ el = document.documentElement;
97
+ } else {
98
+ doc = el.ownerDocument;
99
+ }
100
+ docEl = doc.documentElement;
101
+ box = {};
102
+ _ref = el.getBoundingClientRect();
103
+ for (k in _ref) {
104
+ v = _ref[k];
105
+ box[k] = v;
106
+ }
107
+ origin = getOrigin(doc);
108
+ box.top -= origin.top;
109
+ box.left -= origin.left;
110
+ if (box.width == null) {
111
+ box.width = document.body.scrollWidth - box.left - box.right;
112
+ }
113
+ if (box.height == null) {
114
+ box.height = document.body.scrollHeight - box.top - box.bottom;
115
+ }
116
+ box.top = box.top - docEl.clientTop;
117
+ box.left = box.left - docEl.clientLeft;
118
+ box.right = doc.body.clientWidth - box.width - box.left;
119
+ box.bottom = doc.body.clientHeight - box.height - box.top;
120
+ return box;
121
+ };
122
+
123
+ getOffsetParent = function(el) {
124
+ return el.offsetParent || document.documentElement;
125
+ };
126
+
127
+ getScrollBarSize = function() {
128
+ var inner, outer, width, widthContained, widthScroll;
129
+ inner = document.createElement('div');
130
+ inner.style.width = '100%';
131
+ inner.style.height = '200px';
132
+ outer = document.createElement('div');
133
+ extend(outer.style, {
134
+ position: 'absolute',
135
+ top: 0,
136
+ left: 0,
137
+ pointerEvents: 'none',
138
+ visibility: 'hidden',
139
+ width: '200px',
140
+ height: '150px',
141
+ overflow: 'hidden'
142
+ });
143
+ outer.appendChild(inner);
144
+ document.body.appendChild(outer);
145
+ widthContained = inner.offsetWidth;
146
+ outer.style.overflow = 'scroll';
147
+ widthScroll = inner.offsetWidth;
148
+ if (widthContained === widthScroll) {
149
+ widthScroll = outer.clientWidth;
150
+ }
151
+ document.body.removeChild(outer);
152
+ width = widthContained - widthScroll;
153
+ return {
154
+ width: width,
155
+ height: width
156
+ };
157
+ };
158
+
159
+ extend = function(out) {
160
+ var args, key, obj, val, _i, _len, _ref;
161
+ if (out == null) {
162
+ out = {};
163
+ }
164
+ args = [];
165
+ Array.prototype.push.apply(args, arguments);
166
+ _ref = args.slice(1);
167
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
168
+ obj = _ref[_i];
169
+ if (obj) {
170
+ for (key in obj) {
171
+ if (!__hasProp.call(obj, key)) continue;
172
+ val = obj[key];
173
+ out[key] = val;
174
+ }
175
+ }
176
+ }
177
+ return out;
178
+ };
179
+
180
+ removeClass = function(el, name) {
181
+ var cls, _i, _len, _ref, _results;
182
+ if (el.classList != null) {
183
+ _ref = name.split(' ');
184
+ _results = [];
185
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
186
+ cls = _ref[_i];
187
+ if (cls.trim()) {
188
+ _results.push(el.classList.remove(cls));
189
+ }
190
+ }
191
+ return _results;
192
+ } else {
193
+ return el.className = el.className.replace(new RegExp("(^| )" + (name.split(' ').join('|')) + "( |$)", 'gi'), ' ');
194
+ }
195
+ };
196
+
197
+ addClass = function(el, name) {
198
+ var cls, _i, _len, _ref, _results;
199
+ if (el.classList != null) {
200
+ _ref = name.split(' ');
201
+ _results = [];
202
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
203
+ cls = _ref[_i];
204
+ if (cls.trim()) {
205
+ _results.push(el.classList.add(cls));
206
+ }
207
+ }
208
+ return _results;
209
+ } else {
210
+ removeClass(el, name);
211
+ return el.className += " " + name;
212
+ }
213
+ };
214
+
215
+ hasClass = function(el, name) {
216
+ if (el.classList != null) {
217
+ return el.classList.contains(name);
218
+ } else {
219
+ return new RegExp("(^| )" + name + "( |$)", 'gi').test(el.className);
220
+ }
221
+ };
222
+
223
+ updateClasses = function(el, add, all) {
224
+ var cls, _i, _j, _len, _len1, _results;
225
+ for (_i = 0, _len = all.length; _i < _len; _i++) {
226
+ cls = all[_i];
227
+ if (__indexOf.call(add, cls) < 0) {
228
+ if (hasClass(el, cls)) {
229
+ removeClass(el, cls);
230
+ }
231
+ }
232
+ }
233
+ _results = [];
234
+ for (_j = 0, _len1 = add.length; _j < _len1; _j++) {
235
+ cls = add[_j];
236
+ if (!hasClass(el, cls)) {
237
+ _results.push(addClass(el, cls));
238
+ } else {
239
+ _results.push(void 0);
240
+ }
241
+ }
242
+ return _results;
243
+ };
244
+
245
+ deferred = [];
246
+
247
+ defer = function(fn) {
248
+ return deferred.push(fn);
249
+ };
250
+
251
+ flush = function() {
252
+ var fn, _results;
253
+ _results = [];
254
+ while (fn = deferred.pop()) {
255
+ _results.push(fn());
256
+ }
257
+ return _results;
258
+ };
259
+
260
+ Evented = (function() {
261
+ function Evented() {}
262
+
263
+ Evented.prototype.on = function(event, handler, ctx, once) {
264
+ var _base;
265
+ if (once == null) {
266
+ once = false;
267
+ }
268
+ if (this.bindings == null) {
269
+ this.bindings = {};
270
+ }
271
+ if ((_base = this.bindings)[event] == null) {
272
+ _base[event] = [];
273
+ }
274
+ return this.bindings[event].push({
275
+ handler: handler,
276
+ ctx: ctx,
277
+ once: once
278
+ });
279
+ };
280
+
281
+ Evented.prototype.once = function(event, handler, ctx) {
282
+ return this.on(event, handler, ctx, true);
283
+ };
284
+
285
+ Evented.prototype.off = function(event, handler) {
286
+ var i, _ref, _results;
287
+ if (((_ref = this.bindings) != null ? _ref[event] : void 0) == null) {
288
+ return;
289
+ }
290
+ if (handler == null) {
291
+ return delete this.bindings[event];
292
+ } else {
293
+ i = 0;
294
+ _results = [];
295
+ while (i < this.bindings[event].length) {
296
+ if (this.bindings[event][i].handler === handler) {
297
+ _results.push(this.bindings[event].splice(i, 1));
298
+ } else {
299
+ _results.push(i++);
300
+ }
301
+ }
302
+ return _results;
303
+ }
304
+ };
305
+
306
+ Evented.prototype.trigger = function() {
307
+ var args, ctx, event, handler, i, once, _ref, _ref1, _results;
308
+ event = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
309
+ if ((_ref = this.bindings) != null ? _ref[event] : void 0) {
310
+ i = 0;
311
+ _results = [];
312
+ while (i < this.bindings[event].length) {
313
+ _ref1 = this.bindings[event][i], handler = _ref1.handler, ctx = _ref1.ctx, once = _ref1.once;
314
+ handler.apply(ctx != null ? ctx : this, args);
315
+ if (once) {
316
+ _results.push(this.bindings[event].splice(i, 1));
317
+ } else {
318
+ _results.push(i++);
319
+ }
320
+ }
321
+ return _results;
322
+ }
323
+ };
324
+
325
+ return Evented;
326
+
327
+ })();
328
+
329
+ this.Tether.Utils = {
330
+ getScrollParent: getScrollParent,
331
+ getBounds: getBounds,
332
+ getOffsetParent: getOffsetParent,
333
+ extend: extend,
334
+ addClass: addClass,
335
+ removeClass: removeClass,
336
+ hasClass: hasClass,
337
+ updateClasses: updateClasses,
338
+ defer: defer,
339
+ flush: flush,
340
+ uniqueId: uniqueId,
341
+ Evented: Evented,
342
+ getScrollBarSize: getScrollBarSize
343
+ };
344
+
345
+ }).call(this);
346
+
347
+ (function() {
348
+ var MIRROR_LR, MIRROR_TB, OFFSET_MAP, Tether, addClass, addOffset, attachmentToOffset, autoToFixedAttachment, defer, extend, flush, getBounds, getOffsetParent, getOuterSize, getScrollBarSize, getScrollParent, getSize, now, offsetToPx, parseAttachment, parseOffset, position, removeClass, tethers, transformKey, updateClasses, within, _Tether, _ref,
349
+ __slice = [].slice,
350
+ __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
351
+
352
+ if (this.Tether == null) {
353
+ throw new Error("You must include the utils.js file before tether.js");
354
+ }
355
+
356
+ Tether = this.Tether;
357
+
358
+ _ref = Tether.Utils, getScrollParent = _ref.getScrollParent, getSize = _ref.getSize, getOuterSize = _ref.getOuterSize, getBounds = _ref.getBounds, getOffsetParent = _ref.getOffsetParent, extend = _ref.extend, addClass = _ref.addClass, removeClass = _ref.removeClass, updateClasses = _ref.updateClasses, defer = _ref.defer, flush = _ref.flush, getScrollBarSize = _ref.getScrollBarSize;
359
+
360
+ within = function(a, b, diff) {
361
+ if (diff == null) {
362
+ diff = 1;
363
+ }
364
+ return (a + diff >= b && b >= a - diff);
365
+ };
366
+
367
+ transformKey = (function() {
368
+ var el, key, _i, _len, _ref1;
369
+ el = document.createElement('div');
370
+ _ref1 = ['transform', 'webkitTransform', 'OTransform', 'MozTransform', 'msTransform'];
371
+ for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
372
+ key = _ref1[_i];
373
+ if (el.style[key] !== void 0) {
374
+ return key;
375
+ }
376
+ }
377
+ })();
378
+
379
+ tethers = [];
380
+
381
+ position = function() {
382
+ var tether, _i, _len;
383
+ for (_i = 0, _len = tethers.length; _i < _len; _i++) {
384
+ tether = tethers[_i];
385
+ tether.position(false);
386
+ }
387
+ return flush();
388
+ };
389
+
390
+ now = function() {
391
+ var _ref1;
392
+ return (_ref1 = typeof performance !== "undefined" && performance !== null ? typeof performance.now === "function" ? performance.now() : void 0 : void 0) != null ? _ref1 : +(new Date);
393
+ };
394
+
395
+ (function() {
396
+ var event, lastCall, lastDuration, pendingTimeout, tick, _i, _len, _ref1, _results;
397
+ lastCall = null;
398
+ lastDuration = null;
399
+ pendingTimeout = null;
400
+ tick = function() {
401
+ if ((lastDuration != null) && lastDuration > 16) {
402
+ lastDuration = Math.min(lastDuration - 16, 250);
403
+ pendingTimeout = setTimeout(tick, 250);
404
+ return;
405
+ }
406
+ if ((lastCall != null) && (now() - lastCall) < 10) {
407
+ return;
408
+ }
409
+ if (pendingTimeout != null) {
410
+ clearTimeout(pendingTimeout);
411
+ pendingTimeout = null;
412
+ }
413
+ lastCall = now();
414
+ position();
415
+ return lastDuration = now() - lastCall;
416
+ };
417
+ _ref1 = ['resize', 'scroll', 'touchmove'];
418
+ _results = [];
419
+ for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
420
+ event = _ref1[_i];
421
+ _results.push(window.addEventListener(event, tick));
422
+ }
423
+ return _results;
424
+ })();
425
+
426
+ MIRROR_LR = {
427
+ center: 'center',
428
+ left: 'right',
429
+ right: 'left'
430
+ };
431
+
432
+ MIRROR_TB = {
433
+ middle: 'middle',
434
+ top: 'bottom',
435
+ bottom: 'top'
436
+ };
437
+
438
+ OFFSET_MAP = {
439
+ top: 0,
440
+ left: 0,
441
+ middle: '50%',
442
+ center: '50%',
443
+ bottom: '100%',
444
+ right: '100%'
445
+ };
446
+
447
+ autoToFixedAttachment = function(attachment, relativeToAttachment) {
448
+ var left, top;
449
+ left = attachment.left, top = attachment.top;
450
+ if (left === 'auto') {
451
+ left = MIRROR_LR[relativeToAttachment.left];
452
+ }
453
+ if (top === 'auto') {
454
+ top = MIRROR_TB[relativeToAttachment.top];
455
+ }
456
+ return {
457
+ left: left,
458
+ top: top
459
+ };
460
+ };
461
+
462
+ attachmentToOffset = function(attachment) {
463
+ var _ref1, _ref2;
464
+ return {
465
+ left: (_ref1 = OFFSET_MAP[attachment.left]) != null ? _ref1 : attachment.left,
466
+ top: (_ref2 = OFFSET_MAP[attachment.top]) != null ? _ref2 : attachment.top
467
+ };
468
+ };
469
+
470
+ addOffset = function() {
471
+ var left, offsets, out, top, _i, _len, _ref1;
472
+ offsets = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
473
+ out = {
474
+ top: 0,
475
+ left: 0
476
+ };
477
+ for (_i = 0, _len = offsets.length; _i < _len; _i++) {
478
+ _ref1 = offsets[_i], top = _ref1.top, left = _ref1.left;
479
+ if (typeof top === 'string') {
480
+ top = parseFloat(top, 10);
481
+ }
482
+ if (typeof left === 'string') {
483
+ left = parseFloat(left, 10);
484
+ }
485
+ out.top += top;
486
+ out.left += left;
487
+ }
488
+ return out;
489
+ };
490
+
491
+ offsetToPx = function(offset, size) {
492
+ if (typeof offset.left === 'string' && offset.left.indexOf('%') !== -1) {
493
+ offset.left = parseFloat(offset.left, 10) / 100 * size.width;
494
+ }
495
+ if (typeof offset.top === 'string' && offset.top.indexOf('%') !== -1) {
496
+ offset.top = parseFloat(offset.top, 10) / 100 * size.height;
497
+ }
498
+ return offset;
499
+ };
500
+
501
+ parseAttachment = parseOffset = function(value) {
502
+ var left, top, _ref1;
503
+ _ref1 = value.split(' '), top = _ref1[0], left = _ref1[1];
504
+ return {
505
+ top: top,
506
+ left: left
507
+ };
508
+ };
509
+
510
+ _Tether = (function() {
511
+ _Tether.modules = [];
512
+
513
+ function _Tether(options) {
514
+ this.position = __bind(this.position, this);
515
+ var module, _i, _len, _ref1, _ref2;
516
+ tethers.push(this);
517
+ this.history = [];
518
+ this.setOptions(options, false);
519
+ _ref1 = Tether.modules;
520
+ for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
521
+ module = _ref1[_i];
522
+ if ((_ref2 = module.initialize) != null) {
523
+ _ref2.call(this);
524
+ }
525
+ }
526
+ this.position();
527
+ }
528
+
529
+ _Tether.prototype.getClass = function(key) {
530
+ var _ref1, _ref2;
531
+ if ((_ref1 = this.options.classes) != null ? _ref1[key] : void 0) {
532
+ return this.options.classes[key];
533
+ } else if (((_ref2 = this.options.classes) != null ? _ref2[key] : void 0) !== false) {
534
+ if (this.options.classPrefix) {
535
+ return "" + this.options.classPrefix + "-" + key;
536
+ } else {
537
+ return key;
538
+ }
539
+ } else {
540
+ return '';
541
+ }
542
+ };
543
+
544
+ _Tether.prototype.setOptions = function(options, position) {
545
+ var defaults, key, _i, _len, _ref1, _ref2;
546
+ this.options = options;
547
+ if (position == null) {
548
+ position = true;
549
+ }
550
+ defaults = {
551
+ offset: '0 0',
552
+ targetOffset: '0 0',
553
+ targetAttachment: 'auto auto',
554
+ classPrefix: 'tether'
555
+ };
556
+ this.options = extend(defaults, this.options);
557
+ _ref1 = this.options, this.element = _ref1.element, this.target = _ref1.target, this.targetModifier = _ref1.targetModifier;
558
+ if (this.target === 'viewport') {
559
+ this.target = document.body;
560
+ this.targetModifier = 'visible';
561
+ } else if (this.target === 'scroll-handle') {
562
+ this.target = document.body;
563
+ this.targetModifier = 'scroll-handle';
564
+ }
565
+ _ref2 = ['element', 'target'];
566
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
567
+ key = _ref2[_i];
568
+ if (this[key] == null) {
569
+ throw new Error("Tether Error: Both element and target must be defined");
570
+ }
571
+ if (this[key].jquery != null) {
572
+ this[key] = this[key][0];
573
+ } else if (typeof this[key] === 'string') {
574
+ this[key] = document.querySelector(this[key]);
575
+ }
576
+ }
577
+ addClass(this.element, this.getClass('element'));
578
+ addClass(this.target, this.getClass('target'));
579
+ if (!this.options.attachment) {
580
+ throw new Error("Tether Error: You must provide an attachment");
581
+ }
582
+ this.targetAttachment = parseAttachment(this.options.targetAttachment);
583
+ this.attachment = parseAttachment(this.options.attachment);
584
+ this.offset = parseOffset(this.options.offset);
585
+ this.targetOffset = parseOffset(this.options.targetOffset);
586
+ if (this.scrollParent != null) {
587
+ this.disable();
588
+ }
589
+ if (this.targetModifier === 'scroll-handle') {
590
+ this.scrollParent = this.target;
591
+ } else {
592
+ this.scrollParent = getScrollParent(this.target);
593
+ }
594
+ if (this.options.enabled !== false) {
595
+ return this.enable(position);
596
+ }
597
+ };
598
+
599
+ _Tether.prototype.getTargetBounds = function() {
600
+ var bounds, fitAdj, hasBottomScroll, height, out, scrollBottom, scrollPercentage, style, target;
601
+ if (this.targetModifier != null) {
602
+ switch (this.targetModifier) {
603
+ case 'visible':
604
+ if (this.target === document.body) {
605
+ return {
606
+ top: pageYOffset,
607
+ left: pageXOffset,
608
+ height: innerHeight,
609
+ width: innerWidth
610
+ };
611
+ } else {
612
+ bounds = getBounds(this.target);
613
+ out = {
614
+ height: bounds.height,
615
+ width: bounds.width,
616
+ top: bounds.top,
617
+ left: bounds.left
618
+ };
619
+ out.height = Math.min(out.height, bounds.height - (pageYOffset - bounds.top));
620
+ out.height = Math.min(out.height, bounds.height - ((bounds.top + bounds.height) - (pageYOffset + innerHeight)));
621
+ out.height = Math.min(innerHeight, out.height);
622
+ out.height -= 2;
623
+ out.width = Math.min(out.width, bounds.width - (pageXOffset - bounds.left));
624
+ out.width = Math.min(out.width, bounds.width - ((bounds.left + bounds.width) - (pageXOffset + innerWidth)));
625
+ out.width = Math.min(innerWidth, out.width);
626
+ out.width -= 2;
627
+ if (out.top < pageYOffset) {
628
+ out.top = pageYOffset;
629
+ }
630
+ if (out.left < pageXOffset) {
631
+ out.left = pageXOffset;
632
+ }
633
+ return out;
634
+ }
635
+ break;
636
+ case 'scroll-handle':
637
+ target = this.target;
638
+ if (target === document.body) {
639
+ target = document.documentElement;
640
+ bounds = {
641
+ left: pageXOffset,
642
+ top: pageYOffset,
643
+ height: innerHeight,
644
+ width: innerWidth
645
+ };
646
+ } else {
647
+ bounds = getBounds(target);
648
+ }
649
+ style = getComputedStyle(target);
650
+ hasBottomScroll = target.scrollWidth > target.clientWidth || 'scroll' === [style.overflow, style.overflowX] || this.target !== document.body;
651
+ scrollBottom = 0;
652
+ if (hasBottomScroll) {
653
+ scrollBottom = 15;
654
+ }
655
+ height = bounds.height - parseFloat(style.borderTopWidth) - parseFloat(style.borderBottomWidth) - scrollBottom;
656
+ out = {
657
+ width: 15,
658
+ height: height * 0.975 * (height / target.scrollHeight),
659
+ left: bounds.left + bounds.width - parseFloat(style.borderLeftWidth) - 15
660
+ };
661
+ fitAdj = 0;
662
+ if (height < 408 && this.target === document.body) {
663
+ fitAdj = -0.00011 * Math.pow(height, 2) - 0.00727 * height + 22.58;
664
+ }
665
+ if (this.target !== document.body) {
666
+ out.height = Math.max(out.height, 24);
667
+ }
668
+ scrollPercentage = this.target.scrollTop / (target.scrollHeight - height);
669
+ out.top = scrollPercentage * (height - out.height - fitAdj) + bounds.top + parseFloat(style.borderTopWidth);
670
+ if (this.target === document.body) {
671
+ out.height = Math.max(out.height, 24);
672
+ }
673
+ return out;
674
+ }
675
+ } else {
676
+ return getBounds(this.target);
677
+ }
678
+ };
679
+
680
+ _Tether.prototype.clearCache = function() {
681
+ return this._cache = {};
682
+ };
683
+
684
+ _Tether.prototype.cache = function(k, getter) {
685
+ if (this._cache == null) {
686
+ this._cache = {};
687
+ }
688
+ if (this._cache[k] == null) {
689
+ this._cache[k] = getter.call(this);
690
+ }
691
+ return this._cache[k];
692
+ };
693
+
694
+ _Tether.prototype.enable = function(position) {
695
+ if (position == null) {
696
+ position = true;
697
+ }
698
+ addClass(this.target, this.getClass('enabled'));
699
+ addClass(this.element, this.getClass('enabled'));
700
+ this.enabled = true;
701
+ if (this.scrollParent !== document) {
702
+ this.scrollParent.addEventListener('scroll', this.position);
703
+ }
704
+ if (position) {
705
+ return this.position();
706
+ }
707
+ };
708
+
709
+ _Tether.prototype.disable = function() {
710
+ removeClass(this.target, this.getClass('enabled'));
711
+ removeClass(this.element, this.getClass('enabled'));
712
+ this.enabled = false;
713
+ if (this.scrollParent != null) {
714
+ return this.scrollParent.removeEventListener('scroll', this.position);
715
+ }
716
+ };
717
+
718
+ _Tether.prototype.destroy = function() {
719
+ var i, tether, _i, _len, _results;
720
+ this.disable();
721
+ _results = [];
722
+ for (i = _i = 0, _len = tethers.length; _i < _len; i = ++_i) {
723
+ tether = tethers[i];
724
+ if (tether === this) {
725
+ tethers.splice(i, 1);
726
+ break;
727
+ } else {
728
+ _results.push(void 0);
729
+ }
730
+ }
731
+ return _results;
732
+ };
733
+
734
+ _Tether.prototype.updateAttachClasses = function(elementAttach, targetAttach) {
735
+ var add, all, side, sides, _i, _j, _len, _len1, _ref1,
736
+ _this = this;
737
+ if (elementAttach == null) {
738
+ elementAttach = this.attachment;
739
+ }
740
+ if (targetAttach == null) {
741
+ targetAttach = this.targetAttachment;
742
+ }
743
+ sides = ['left', 'top', 'bottom', 'right', 'middle', 'center'];
744
+ if ((_ref1 = this._addAttachClasses) != null ? _ref1.length : void 0) {
745
+ this._addAttachClasses.splice(0, this._addAttachClasses.length);
746
+ }
747
+ add = this._addAttachClasses != null ? this._addAttachClasses : this._addAttachClasses = [];
748
+ if (elementAttach.top) {
749
+ add.push("" + (this.getClass('element-attached')) + "-" + elementAttach.top);
750
+ }
751
+ if (elementAttach.left) {
752
+ add.push("" + (this.getClass('element-attached')) + "-" + elementAttach.left);
753
+ }
754
+ if (targetAttach.top) {
755
+ add.push("" + (this.getClass('target-attached')) + "-" + targetAttach.top);
756
+ }
757
+ if (targetAttach.left) {
758
+ add.push("" + (this.getClass('target-attached')) + "-" + targetAttach.left);
759
+ }
760
+ all = [];
761
+ for (_i = 0, _len = sides.length; _i < _len; _i++) {
762
+ side = sides[_i];
763
+ all.push("" + (this.getClass('element-attached')) + "-" + side);
764
+ }
765
+ for (_j = 0, _len1 = sides.length; _j < _len1; _j++) {
766
+ side = sides[_j];
767
+ all.push("" + (this.getClass('target-attached')) + "-" + side);
768
+ }
769
+ return defer(function() {
770
+ if (_this._addAttachClasses == null) {
771
+ return;
772
+ }
773
+ updateClasses(_this.element, _this._addAttachClasses, all);
774
+ updateClasses(_this.target, _this._addAttachClasses, all);
775
+ return _this._addAttachClasses = void 0;
776
+ });
777
+ };
778
+
779
+ _Tether.prototype.position = function(flushChanges) {
780
+ var elementPos, elementStyle, height, left, manualOffset, manualTargetOffset, module, next, offset, offsetBorder, offsetParent, offsetParentSize, offsetParentStyle, offsetPosition, ret, scrollLeft, scrollTop, scrollbarSize, side, targetAttachment, targetOffset, targetPos, targetSize, top, width, _i, _j, _len, _len1, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6,
781
+ _this = this;
782
+ if (flushChanges == null) {
783
+ flushChanges = true;
784
+ }
785
+ if (!this.enabled) {
786
+ return;
787
+ }
788
+ this.clearCache();
789
+ targetAttachment = autoToFixedAttachment(this.targetAttachment, this.attachment);
790
+ this.updateAttachClasses(this.attachment, targetAttachment);
791
+ elementPos = this.cache('element-bounds', function() {
792
+ return getBounds(_this.element);
793
+ });
794
+ width = elementPos.width, height = elementPos.height;
795
+ if (width === 0 && height === 0 && (this.lastSize != null)) {
796
+ _ref1 = this.lastSize, width = _ref1.width, height = _ref1.height;
797
+ } else {
798
+ this.lastSize = {
799
+ width: width,
800
+ height: height
801
+ };
802
+ }
803
+ targetSize = targetPos = this.cache('target-bounds', function() {
804
+ return _this.getTargetBounds();
805
+ });
806
+ offset = offsetToPx(attachmentToOffset(this.attachment), {
807
+ width: width,
808
+ height: height
809
+ });
810
+ targetOffset = offsetToPx(attachmentToOffset(targetAttachment), targetSize);
811
+ manualOffset = offsetToPx(this.offset, {
812
+ width: width,
813
+ height: height
814
+ });
815
+ manualTargetOffset = offsetToPx(this.targetOffset, targetSize);
816
+ offset = addOffset(offset, manualOffset);
817
+ targetOffset = addOffset(targetOffset, manualTargetOffset);
818
+ left = targetPos.left + targetOffset.left - offset.left;
819
+ top = targetPos.top + targetOffset.top - offset.top;
820
+ _ref2 = Tether.modules;
821
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
822
+ module = _ref2[_i];
823
+ ret = module.position.call(this, {
824
+ left: left,
825
+ top: top,
826
+ targetAttachment: targetAttachment,
827
+ targetPos: targetPos,
828
+ attachment: this.attachment,
829
+ elementPos: elementPos,
830
+ offset: offset,
831
+ targetOffset: targetOffset,
832
+ manualOffset: manualOffset,
833
+ manualTargetOffset: manualTargetOffset,
834
+ scrollbarSize: scrollbarSize
835
+ });
836
+ if ((ret == null) || typeof ret !== 'object') {
837
+ continue;
838
+ } else if (ret === false) {
839
+ return false;
840
+ } else {
841
+ top = ret.top, left = ret.left;
842
+ }
843
+ }
844
+ next = {
845
+ page: {
846
+ top: top,
847
+ left: left
848
+ },
849
+ viewport: {
850
+ top: top - pageYOffset,
851
+ bottom: pageYOffset - top - height + innerHeight,
852
+ left: left - pageXOffset,
853
+ right: pageXOffset - left - width + innerWidth
854
+ }
855
+ };
856
+ if (document.body.scrollWidth > window.innerWidth) {
857
+ scrollbarSize = this.cache('scrollbar-size', getScrollBarSize);
858
+ next.viewport.bottom -= scrollbarSize.height;
859
+ }
860
+ if (document.body.scrollHeight > window.innerHeight) {
861
+ scrollbarSize = this.cache('scrollbar-size', getScrollBarSize);
862
+ next.viewport.right -= scrollbarSize.width;
863
+ }
864
+ if (((_ref3 = document.body.style.position) !== '' && _ref3 !== 'static') || ((_ref4 = document.body.parentElement.style.position) !== '' && _ref4 !== 'static')) {
865
+ next.page.bottom = document.body.scrollHeight - top - height;
866
+ next.page.right = document.body.scrollWidth - left - width;
867
+ }
868
+ if (((_ref5 = this.options.optimizations) != null ? _ref5.moveElement : void 0) !== false && (this.targetModifier == null)) {
869
+ offsetParent = this.cache('target-offsetparent', function() {
870
+ return getOffsetParent(_this.target);
871
+ });
872
+ offsetPosition = this.cache('target-offsetparent-bounds', function() {
873
+ return getBounds(offsetParent);
874
+ });
875
+ offsetParentStyle = getComputedStyle(offsetParent);
876
+ elementStyle = getComputedStyle(this.element);
877
+ offsetParentSize = offsetPosition;
878
+ offsetBorder = {};
879
+ _ref6 = ['Top', 'Left', 'Bottom', 'Right'];
880
+ for (_j = 0, _len1 = _ref6.length; _j < _len1; _j++) {
881
+ side = _ref6[_j];
882
+ offsetBorder[side.toLowerCase()] = parseFloat(offsetParentStyle["border" + side + "Width"]);
883
+ }
884
+ offsetPosition.right = document.body.scrollWidth - offsetPosition.left - offsetParentSize.width + offsetBorder.right;
885
+ offsetPosition.bottom = document.body.scrollHeight - offsetPosition.top - offsetParentSize.height + offsetBorder.bottom;
886
+ if (next.page.top >= (offsetPosition.top + offsetBorder.top) && next.page.bottom >= offsetPosition.bottom) {
887
+ if (next.page.left >= (offsetPosition.left + offsetBorder.left) && next.page.right >= offsetPosition.right) {
888
+ scrollTop = offsetParent.scrollTop;
889
+ scrollLeft = offsetParent.scrollLeft;
890
+ next.offset = {
891
+ top: next.page.top - offsetPosition.top + scrollTop - offsetBorder.top,
892
+ left: next.page.left - offsetPosition.left + scrollLeft - offsetBorder.left
893
+ };
894
+ }
895
+ }
896
+ }
897
+ this.move(next);
898
+ this.history.unshift(next);
899
+ if (this.history.length > 3) {
900
+ this.history.pop();
901
+ }
902
+ if (flushChanges) {
903
+ flush();
904
+ }
905
+ return true;
906
+ };
907
+
908
+ _Tether.prototype.move = function(position) {
909
+ var css, elVal, found, key, moved, offsetParent, point, same, transcribe, type, val, write, writeCSS, _i, _len, _ref1, _ref2,
910
+ _this = this;
911
+ if (this.element.parentNode == null) {
912
+ return;
913
+ }
914
+ same = {};
915
+ for (type in position) {
916
+ same[type] = {};
917
+ for (key in position[type]) {
918
+ found = false;
919
+ _ref1 = this.history;
920
+ for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
921
+ point = _ref1[_i];
922
+ if (!within((_ref2 = point[type]) != null ? _ref2[key] : void 0, position[type][key])) {
923
+ found = true;
924
+ break;
925
+ }
926
+ }
927
+ if (!found) {
928
+ same[type][key] = true;
929
+ }
930
+ }
931
+ }
932
+ css = {
933
+ top: '',
934
+ left: '',
935
+ right: '',
936
+ bottom: ''
937
+ };
938
+ transcribe = function(same, pos) {
939
+ var xPos, yPos, _ref3;
940
+ if (((_ref3 = _this.options.optimizations) != null ? _ref3.gpu : void 0) !== false) {
941
+ if (same.top) {
942
+ css.top = 0;
943
+ yPos = pos.top;
944
+ } else {
945
+ css.bottom = 0;
946
+ yPos = -pos.bottom;
947
+ }
948
+ if (same.left) {
949
+ css.left = 0;
950
+ xPos = pos.left;
951
+ } else {
952
+ css.right = 0;
953
+ xPos = -pos.right;
954
+ }
955
+ css[transformKey] = "translateX(" + (Math.round(xPos)) + "px) translateY(" + (Math.round(yPos)) + "px)";
956
+ if (transformKey !== 'msTransform') {
957
+ return css[transformKey] += " translateZ(0)";
958
+ }
959
+ } else {
960
+ if (same.top) {
961
+ css.top = "" + pos.top + "px";
962
+ } else {
963
+ css.bottom = "" + pos.bottom + "px";
964
+ }
965
+ if (same.left) {
966
+ return css.left = "" + pos.left + "px";
967
+ } else {
968
+ return css.right = "" + pos.right + "px";
969
+ }
970
+ }
971
+ };
972
+ moved = false;
973
+ if ((same.page.top || same.page.bottom) && (same.page.left || same.page.right)) {
974
+ css.position = 'absolute';
975
+ transcribe(same.page, position.page);
976
+ } else if ((same.viewport.top || same.viewport.bottom) && (same.viewport.left || same.viewport.right)) {
977
+ css.position = 'fixed';
978
+ transcribe(same.viewport, position.viewport);
979
+ } else if ((same.offset != null) && same.offset.top && same.offset.left) {
980
+ css.position = 'absolute';
981
+ offsetParent = this.cache('target-offsetparent', function() {
982
+ return getOffsetParent(_this.target);
983
+ });
984
+ if (getOffsetParent(this.element) !== offsetParent) {
985
+ defer(function() {
986
+ _this.element.parentNode.removeChild(_this.element);
987
+ return offsetParent.appendChild(_this.element);
988
+ });
989
+ }
990
+ transcribe(same.offset, position.offset);
991
+ moved = true;
992
+ } else {
993
+ css.position = 'absolute';
994
+ transcribe({
995
+ top: true,
996
+ left: true
997
+ }, position.page);
998
+ }
999
+ if (!moved && this.element.parentNode.tagName !== 'BODY') {
1000
+ this.element.parentNode.removeChild(this.element);
1001
+ document.body.appendChild(this.element);
1002
+ }
1003
+ writeCSS = {};
1004
+ write = false;
1005
+ for (key in css) {
1006
+ val = css[key];
1007
+ elVal = this.element.style[key];
1008
+ if (elVal !== '' && val !== '' && (key === 'top' || key === 'left' || key === 'bottom' || key === 'right')) {
1009
+ elVal = parseFloat(elVal);
1010
+ val = parseFloat(val);
1011
+ }
1012
+ if (elVal !== val) {
1013
+ write = true;
1014
+ writeCSS[key] = css[key];
1015
+ }
1016
+ }
1017
+ if (write) {
1018
+ return defer(function() {
1019
+ return extend(_this.element.style, writeCSS);
1020
+ });
1021
+ }
1022
+ };
1023
+
1024
+ return _Tether;
1025
+
1026
+ })();
1027
+
1028
+ Tether.position = position;
1029
+
1030
+ this.Tether = extend(_Tether, Tether);
1031
+
1032
+ }).call(this);
1033
+
1034
+ (function() {
1035
+ var BOUNDS_FORMAT, MIRROR_ATTACH, defer, extend, getBoundingRect, getBounds, getOuterSize, getSize, updateClasses, _ref,
1036
+ __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
1037
+
1038
+ _ref = this.Tether.Utils, getOuterSize = _ref.getOuterSize, getBounds = _ref.getBounds, getSize = _ref.getSize, extend = _ref.extend, updateClasses = _ref.updateClasses, defer = _ref.defer;
1039
+
1040
+ MIRROR_ATTACH = {
1041
+ left: 'right',
1042
+ right: 'left',
1043
+ top: 'bottom',
1044
+ bottom: 'top',
1045
+ middle: 'middle'
1046
+ };
1047
+
1048
+ BOUNDS_FORMAT = ['left', 'top', 'right', 'bottom'];
1049
+
1050
+ getBoundingRect = function(tether, to) {
1051
+ var i, pos, side, size, style, _i, _len;
1052
+ if (to === 'scrollParent') {
1053
+ to = tether.scrollParent;
1054
+ } else if (to === 'window') {
1055
+ to = [pageXOffset, pageYOffset, innerWidth + pageXOffset, innerHeight + pageYOffset];
1056
+ }
1057
+ if (to === document) {
1058
+ to = to.documentElement;
1059
+ }
1060
+ if (to.nodeType != null) {
1061
+ pos = size = getBounds(to);
1062
+ style = getComputedStyle(to);
1063
+ to = [pos.left, pos.top, size.width + pos.left, size.height + pos.top];
1064
+ for (i = _i = 0, _len = BOUNDS_FORMAT.length; _i < _len; i = ++_i) {
1065
+ side = BOUNDS_FORMAT[i];
1066
+ side = side[0].toUpperCase() + side.substr(1);
1067
+ if (side === 'Top' || side === 'Left') {
1068
+ to[i] += parseFloat(style["border" + side + "Width"]);
1069
+ } else {
1070
+ to[i] -= parseFloat(style["border" + side + "Width"]);
1071
+ }
1072
+ }
1073
+ }
1074
+ return to;
1075
+ };
1076
+
1077
+ this.Tether.modules.push({
1078
+ position: function(_arg) {
1079
+ var addClasses, allClasses, attachment, bounds, changeAttachX, changeAttachY, cls, constraint, eAttachment, height, left, oob, oobClass, p, pin, pinned, pinnedClass, removeClass, side, tAttachment, targetAttachment, targetHeight, targetSize, targetWidth, to, top, width, _i, _j, _k, _l, _len, _len1, _len2, _len3, _len4, _len5, _m, _n, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8,
1080
+ _this = this;
1081
+ top = _arg.top, left = _arg.left, targetAttachment = _arg.targetAttachment;
1082
+ if (!this.options.constraints) {
1083
+ return true;
1084
+ }
1085
+ removeClass = function(prefix) {
1086
+ var side, _i, _len, _results;
1087
+ _this.removeClass(prefix);
1088
+ _results = [];
1089
+ for (_i = 0, _len = BOUNDS_FORMAT.length; _i < _len; _i++) {
1090
+ side = BOUNDS_FORMAT[_i];
1091
+ _results.push(_this.removeClass("" + prefix + "-" + side));
1092
+ }
1093
+ return _results;
1094
+ };
1095
+ _ref1 = this.cache('element-bounds', function() {
1096
+ return getBounds(_this.element);
1097
+ }), height = _ref1.height, width = _ref1.width;
1098
+ if (width === 0 && height === 0 && (this.lastSize != null)) {
1099
+ _ref2 = this.lastSize, width = _ref2.width, height = _ref2.height;
1100
+ }
1101
+ targetSize = this.cache('target-bounds', function() {
1102
+ return _this.getTargetBounds();
1103
+ });
1104
+ targetHeight = targetSize.height;
1105
+ targetWidth = targetSize.width;
1106
+ tAttachment = {};
1107
+ eAttachment = {};
1108
+ allClasses = [this.getClass('pinned'), this.getClass('out-of-bounds')];
1109
+ _ref3 = this.options.constraints;
1110
+ for (_i = 0, _len = _ref3.length; _i < _len; _i++) {
1111
+ constraint = _ref3[_i];
1112
+ if (constraint.outOfBoundsClass) {
1113
+ allClasses.push(constraint.outOfBoundsClass);
1114
+ }
1115
+ if (constraint.pinnedClass) {
1116
+ allClasses.push(constraint.pinnedClass);
1117
+ }
1118
+ }
1119
+ for (_j = 0, _len1 = allClasses.length; _j < _len1; _j++) {
1120
+ cls = allClasses[_j];
1121
+ _ref4 = ['left', 'top', 'right', 'bottom'];
1122
+ for (_k = 0, _len2 = _ref4.length; _k < _len2; _k++) {
1123
+ side = _ref4[_k];
1124
+ allClasses.push("" + cls + "-" + side);
1125
+ }
1126
+ }
1127
+ addClasses = [];
1128
+ tAttachment = extend({}, targetAttachment);
1129
+ eAttachment = extend({}, this.attachment);
1130
+ _ref5 = this.options.constraints;
1131
+ for (_l = 0, _len3 = _ref5.length; _l < _len3; _l++) {
1132
+ constraint = _ref5[_l];
1133
+ to = constraint.to, attachment = constraint.attachment, pin = constraint.pin;
1134
+ if (attachment == null) {
1135
+ attachment = '';
1136
+ }
1137
+ if (__indexOf.call(attachment, ' ') >= 0) {
1138
+ _ref6 = attachment.split(' '), changeAttachY = _ref6[0], changeAttachX = _ref6[1];
1139
+ } else {
1140
+ changeAttachX = changeAttachY = attachment;
1141
+ }
1142
+ bounds = getBoundingRect(this, to);
1143
+ if (changeAttachY === 'target' || changeAttachY === 'both') {
1144
+ if (top < bounds[1] && tAttachment.top === 'top') {
1145
+ top += targetHeight;
1146
+ tAttachment.top = 'bottom';
1147
+ }
1148
+ if (top + height > bounds[3] && tAttachment.top === 'bottom') {
1149
+ top -= targetHeight;
1150
+ tAttachment.top = 'top';
1151
+ }
1152
+ }
1153
+ if (changeAttachY === 'together') {
1154
+ if (top < bounds[1] && tAttachment.top === 'top') {
1155
+ if (eAttachment.top === 'bottom') {
1156
+ top += targetHeight;
1157
+ tAttachment.top = 'bottom';
1158
+ top += height;
1159
+ eAttachment.top = 'top';
1160
+ } else if (eAttachment.top === 'top') {
1161
+ top += targetHeight;
1162
+ tAttachment.top = 'bottom';
1163
+ top -= height;
1164
+ eAttachment.top = 'bottom';
1165
+ }
1166
+ }
1167
+ if (top + height > bounds[3] && tAttachment.top === 'bottom') {
1168
+ if (eAttachment.top === 'top') {
1169
+ top -= targetHeight;
1170
+ tAttachment.top = 'top';
1171
+ top -= height;
1172
+ eAttachment.top = 'bottom';
1173
+ } else if (eAttachment.top === 'bottom') {
1174
+ top -= targetHeight;
1175
+ tAttachment.top = 'top';
1176
+ top += height;
1177
+ eAttachment.top = 'top';
1178
+ }
1179
+ }
1180
+ if (tAttachment.top === 'middle') {
1181
+ if (top + height > bounds[3] && eAttachment.top === 'top') {
1182
+ top -= height;
1183
+ eAttachment.top = 'bottom';
1184
+ } else if (top < bounds[1] && eAttachment.top === 'bottom') {
1185
+ top += height;
1186
+ eAttachment.top = 'top';
1187
+ }
1188
+ }
1189
+ }
1190
+ if (changeAttachX === 'target' || changeAttachX === 'both') {
1191
+ if (left < bounds[0] && tAttachment.left === 'left') {
1192
+ left += targetWidth;
1193
+ tAttachment.left = 'right';
1194
+ }
1195
+ if (left + width > bounds[2] && tAttachment.left === 'right') {
1196
+ left -= targetWidth;
1197
+ tAttachment.left = 'left';
1198
+ }
1199
+ }
1200
+ if (changeAttachX === 'together') {
1201
+ if (left < bounds[0] && tAttachment.left === 'left') {
1202
+ if (eAttachment.left === 'right') {
1203
+ left += targetWidth;
1204
+ tAttachment.left = 'right';
1205
+ left += width;
1206
+ eAttachment.left = 'left';
1207
+ } else if (eAttachment.left === 'left') {
1208
+ left += targetWidth;
1209
+ tAttachment.left = 'right';
1210
+ left -= width;
1211
+ eAttachment.left = 'right';
1212
+ }
1213
+ } else if (left + width > bounds[2] && tAttachment.left === 'right') {
1214
+ if (eAttachment.left === 'left') {
1215
+ left -= targetWidth;
1216
+ tAttachment.left = 'left';
1217
+ left -= width;
1218
+ eAttachment.left = 'right';
1219
+ } else if (eAttachment.left === 'right') {
1220
+ left -= targetWidth;
1221
+ tAttachment.left = 'left';
1222
+ left += width;
1223
+ eAttachment.left = 'left';
1224
+ }
1225
+ } else if (tAttachment.left === 'center') {
1226
+ if (left + width > bounds[2] && eAttachment.left === 'left') {
1227
+ left -= width;
1228
+ eAttachment.left = 'right';
1229
+ } else if (left < bounds[0] && eAttachment.left === 'right') {
1230
+ left += width;
1231
+ eAttachment.left = 'left';
1232
+ }
1233
+ }
1234
+ }
1235
+ if (changeAttachY === 'element' || changeAttachY === 'both') {
1236
+ if (top < bounds[1] && eAttachment.top === 'bottom') {
1237
+ top += height;
1238
+ eAttachment.top = 'top';
1239
+ }
1240
+ if (top + height > bounds[3] && eAttachment.top === 'top') {
1241
+ top -= height;
1242
+ eAttachment.top = 'bottom';
1243
+ }
1244
+ }
1245
+ if (changeAttachX === 'element' || changeAttachX === 'both') {
1246
+ if (left < bounds[0] && eAttachment.left === 'right') {
1247
+ left += width;
1248
+ eAttachment.left = 'left';
1249
+ }
1250
+ if (left + width > bounds[2] && eAttachment.left === 'left') {
1251
+ left -= width;
1252
+ eAttachment.left = 'right';
1253
+ }
1254
+ }
1255
+ if (typeof pin === 'string') {
1256
+ pin = (function() {
1257
+ var _len4, _m, _ref7, _results;
1258
+ _ref7 = pin.split(',');
1259
+ _results = [];
1260
+ for (_m = 0, _len4 = _ref7.length; _m < _len4; _m++) {
1261
+ p = _ref7[_m];
1262
+ _results.push(p.trim());
1263
+ }
1264
+ return _results;
1265
+ })();
1266
+ } else if (pin === true) {
1267
+ pin = ['top', 'left', 'right', 'bottom'];
1268
+ }
1269
+ pin || (pin = []);
1270
+ pinned = [];
1271
+ oob = [];
1272
+ if (top < bounds[1]) {
1273
+ if (__indexOf.call(pin, 'top') >= 0) {
1274
+ top = bounds[1];
1275
+ pinned.push('top');
1276
+ } else {
1277
+ oob.push('top');
1278
+ }
1279
+ }
1280
+ if (top + height > bounds[3]) {
1281
+ if (__indexOf.call(pin, 'bottom') >= 0) {
1282
+ top = bounds[3] - height;
1283
+ pinned.push('bottom');
1284
+ } else {
1285
+ oob.push('bottom');
1286
+ }
1287
+ }
1288
+ if (left < bounds[0]) {
1289
+ if (__indexOf.call(pin, 'left') >= 0) {
1290
+ left = bounds[0];
1291
+ pinned.push('left');
1292
+ } else {
1293
+ oob.push('left');
1294
+ }
1295
+ }
1296
+ if (left + width > bounds[2]) {
1297
+ if (__indexOf.call(pin, 'right') >= 0) {
1298
+ left = bounds[2] - width;
1299
+ pinned.push('right');
1300
+ } else {
1301
+ oob.push('right');
1302
+ }
1303
+ }
1304
+ if (pinned.length) {
1305
+ pinnedClass = (_ref7 = this.options.pinnedClass) != null ? _ref7 : this.getClass('pinned');
1306
+ addClasses.push(pinnedClass);
1307
+ for (_m = 0, _len4 = pinned.length; _m < _len4; _m++) {
1308
+ side = pinned[_m];
1309
+ addClasses.push("" + pinnedClass + "-" + side);
1310
+ }
1311
+ }
1312
+ if (oob.length) {
1313
+ oobClass = (_ref8 = this.options.outOfBoundsClass) != null ? _ref8 : this.getClass('out-of-bounds');
1314
+ addClasses.push(oobClass);
1315
+ for (_n = 0, _len5 = oob.length; _n < _len5; _n++) {
1316
+ side = oob[_n];
1317
+ addClasses.push("" + oobClass + "-" + side);
1318
+ }
1319
+ }
1320
+ if (__indexOf.call(pinned, 'left') >= 0 || __indexOf.call(pinned, 'right') >= 0) {
1321
+ eAttachment.left = tAttachment.left = false;
1322
+ }
1323
+ if (__indexOf.call(pinned, 'top') >= 0 || __indexOf.call(pinned, 'bottom') >= 0) {
1324
+ eAttachment.top = tAttachment.top = false;
1325
+ }
1326
+ if (tAttachment.top !== targetAttachment.top || tAttachment.left !== targetAttachment.left || eAttachment.top !== this.attachment.top || eAttachment.left !== this.attachment.left) {
1327
+ this.updateAttachClasses(eAttachment, tAttachment);
1328
+ }
1329
+ }
1330
+ defer(function() {
1331
+ updateClasses(_this.target, addClasses, allClasses);
1332
+ return updateClasses(_this.element, addClasses, allClasses);
1333
+ });
1334
+ return {
1335
+ top: top,
1336
+ left: left
1337
+ };
1338
+ }
1339
+ });
1340
+
1341
+ }).call(this);
1342
+
1343
+ (function() {
1344
+ var defer, getBounds, updateClasses, _ref;
1345
+
1346
+ _ref = this.Tether.Utils, getBounds = _ref.getBounds, updateClasses = _ref.updateClasses, defer = _ref.defer;
1347
+
1348
+ this.Tether.modules.push({
1349
+ position: function(_arg) {
1350
+ var abutted, addClasses, allClasses, bottom, height, left, right, side, sides, targetPos, top, width, _i, _j, _k, _l, _len, _len1, _len2, _len3, _ref1, _ref2, _ref3, _ref4, _ref5,
1351
+ _this = this;
1352
+ top = _arg.top, left = _arg.left;
1353
+ _ref1 = this.cache('element-bounds', function() {
1354
+ return getBounds(_this.element);
1355
+ }), height = _ref1.height, width = _ref1.width;
1356
+ targetPos = this.getTargetBounds();
1357
+ bottom = top + height;
1358
+ right = left + width;
1359
+ abutted = [];
1360
+ if (top <= targetPos.bottom && bottom >= targetPos.top) {
1361
+ _ref2 = ['left', 'right'];
1362
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
1363
+ side = _ref2[_i];
1364
+ if ((_ref3 = targetPos[side]) === left || _ref3 === right) {
1365
+ abutted.push(side);
1366
+ }
1367
+ }
1368
+ }
1369
+ if (left <= targetPos.right && right >= targetPos.left) {
1370
+ _ref4 = ['top', 'bottom'];
1371
+ for (_j = 0, _len1 = _ref4.length; _j < _len1; _j++) {
1372
+ side = _ref4[_j];
1373
+ if ((_ref5 = targetPos[side]) === top || _ref5 === bottom) {
1374
+ abutted.push(side);
1375
+ }
1376
+ }
1377
+ }
1378
+ allClasses = [];
1379
+ addClasses = [];
1380
+ sides = ['left', 'top', 'right', 'bottom'];
1381
+ allClasses.push(this.getClass('abutted'));
1382
+ for (_k = 0, _len2 = sides.length; _k < _len2; _k++) {
1383
+ side = sides[_k];
1384
+ allClasses.push("" + (this.getClass('abutted')) + "-" + side);
1385
+ }
1386
+ if (abutted.length) {
1387
+ addClasses.push(this.getClass('abutted'));
1388
+ }
1389
+ for (_l = 0, _len3 = abutted.length; _l < _len3; _l++) {
1390
+ side = abutted[_l];
1391
+ addClasses.push("" + (this.getClass('abutted')) + "-" + side);
1392
+ }
1393
+ defer(function() {
1394
+ updateClasses(_this.target, addClasses, allClasses);
1395
+ return updateClasses(_this.element, addClasses, allClasses);
1396
+ });
1397
+ return true;
1398
+ }
1399
+ });
1400
+
1401
+ }).call(this);
1402
+
1403
+ (function() {
1404
+ this.Tether.modules.push({
1405
+ position: function(_arg) {
1406
+ var left, result, shift, shiftLeft, shiftTop, top, _ref;
1407
+ top = _arg.top, left = _arg.left;
1408
+ if (!this.options.shift) {
1409
+ return;
1410
+ }
1411
+ result = function(val) {
1412
+ if (typeof val === 'function') {
1413
+ return val.call(this, {
1414
+ top: top,
1415
+ left: left
1416
+ });
1417
+ } else {
1418
+ return val;
1419
+ }
1420
+ };
1421
+ shift = result(this.options.shift);
1422
+ if (typeof shift === 'string') {
1423
+ shift = shift.split(' ');
1424
+ shift[1] || (shift[1] = shift[0]);
1425
+ shiftTop = shift[0], shiftLeft = shift[1];
1426
+ shiftTop = parseFloat(shiftTop, 10);
1427
+ shiftLeft = parseFloat(shiftLeft, 10);
1428
+ } else {
1429
+ _ref = [shift.top, shift.left], shiftTop = _ref[0], shiftLeft = _ref[1];
1430
+ }
1431
+ top += shiftTop;
1432
+ left += shiftLeft;
1433
+ return {
1434
+ top: top,
1435
+ left: left
1436
+ };
1437
+ }
1438
+ });
1439
+
1440
+ }).call(this);
1441
+
1442
+ return this.Tether;
1443
+
1444
+ }));
1445
+
1446
+ (function() {
1447
+ var Evented, MIRROR_ATTACH, addClass, allDrops, clickEvents, createContext, extend, hasClass, removeClass, removeFromArray, sortAttach, touchDevice, _ref,
1448
+ __hasProp = {}.hasOwnProperty,
1449
+ __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
1450
+ __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
1451
+
1452
+ _ref = Tether.Utils, extend = _ref.extend, addClass = _ref.addClass, removeClass = _ref.removeClass, hasClass = _ref.hasClass, Evented = _ref.Evented;
1453
+
1454
+ touchDevice = 'ontouchstart' in document.documentElement;
1455
+
1456
+ clickEvents = ['click'];
1457
+
1458
+ if (touchDevice) {
1459
+ clickEvents.push('touchstart');
1460
+ }
1461
+
1462
+ sortAttach = function(str) {
1463
+ var first, second, _ref1, _ref2;
1464
+ _ref1 = str.split(' '), first = _ref1[0], second = _ref1[1];
1465
+ if (first === 'left' || first === 'right') {
1466
+ _ref2 = [second, first], first = _ref2[0], second = _ref2[1];
1467
+ }
1468
+ return [first, second].join(' ');
1469
+ };
1470
+
1471
+ MIRROR_ATTACH = {
1472
+ left: 'right',
1473
+ right: 'left',
1474
+ top: 'bottom',
1475
+ bottom: 'top',
1476
+ middle: 'middle',
1477
+ center: 'center'
1478
+ };
1479
+
1480
+ allDrops = {};
1481
+
1482
+ removeFromArray = function(arr, item) {
1483
+ var index, _results;
1484
+ _results = [];
1485
+ while ((index = arr.indexOf(item)) !== -1) {
1486
+ _results.push(arr.splice(index, 1));
1487
+ }
1488
+ return _results;
1489
+ };
1490
+
1491
+ createContext = function(options) {
1492
+ var DropInstance, defaultOptions, drop, _name;
1493
+ if (options == null) {
1494
+ options = {};
1495
+ }
1496
+ drop = function() {
1497
+ return (function(func, args, ctor) {
1498
+ ctor.prototype = func.prototype;
1499
+ var child = new ctor, result = func.apply(child, args);
1500
+ return Object(result) === result ? result : child;
1501
+ })(DropInstance, arguments, function(){});
1502
+ };
1503
+ extend(drop, {
1504
+ createContext: createContext,
1505
+ drops: [],
1506
+ defaults: {}
1507
+ });
1508
+ defaultOptions = {
1509
+ classPrefix: 'drop',
1510
+ defaults: {
1511
+ position: 'bottom left',
1512
+ openOn: 'click',
1513
+ constrainToScrollParent: true,
1514
+ constrainToWindow: true,
1515
+ classes: '',
1516
+ remove: false,
1517
+ tetherOptions: {}
1518
+ }
1519
+ };
1520
+ extend(drop, defaultOptions, options);
1521
+ extend(drop.defaults, defaultOptions.defaults, options.defaults);
1522
+ if (allDrops[_name = drop.classPrefix] == null) {
1523
+ allDrops[_name] = [];
1524
+ }
1525
+ drop.updateBodyClasses = function() {
1526
+ var anyOpen, _drop, _i, _len, _ref1;
1527
+ anyOpen = false;
1528
+ _ref1 = allDrops[drop.classPrefix];
1529
+ for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
1530
+ _drop = _ref1[_i];
1531
+ if (!(_drop.isOpened())) {
1532
+ continue;
1533
+ }
1534
+ anyOpen = true;
1535
+ break;
1536
+ }
1537
+ if (anyOpen) {
1538
+ return addClass(document.body, "" + drop.classPrefix + "-open");
1539
+ } else {
1540
+ return removeClass(document.body, "" + drop.classPrefix + "-open");
1541
+ }
1542
+ };
1543
+ DropInstance = (function(_super) {
1544
+ __extends(DropInstance, _super);
1545
+
1546
+ function DropInstance(options) {
1547
+ this.options = options;
1548
+ this.options = extend({}, drop.defaults, this.options);
1549
+ this.target = this.options.target;
1550
+ if (this.target == null) {
1551
+ throw new Error('Drop Error: You must provide a target.');
1552
+ }
1553
+ if (this.options.classes) {
1554
+ addClass(this.target, this.options.classes);
1555
+ }
1556
+ drop.drops.push(this);
1557
+ allDrops[drop.classPrefix].push(this);
1558
+ this._boundEvents = [];
1559
+ this.setupElements();
1560
+ this.setupEvents();
1561
+ this.setupTether();
1562
+ }
1563
+
1564
+ DropInstance.prototype._on = function(element, event, handler) {
1565
+ this._boundEvents.push({
1566
+ element: element,
1567
+ event: event,
1568
+ handler: handler
1569
+ });
1570
+ return element.addEventListener(event, handler);
1571
+ };
1572
+
1573
+ DropInstance.prototype.setupElements = function() {
1574
+ this.drop = document.createElement('div');
1575
+ addClass(this.drop, drop.classPrefix);
1576
+ if (this.options.classes) {
1577
+ addClass(this.drop, this.options.classes);
1578
+ }
1579
+ this.content = document.createElement('div');
1580
+ addClass(this.content, "" + drop.classPrefix + "-content");
1581
+ if (typeof this.options.content === 'object') {
1582
+ this.content.appendChild(this.options.content);
1583
+ } else {
1584
+ this.content.innerHTML = this.options.content;
1585
+ }
1586
+ return this.drop.appendChild(this.content);
1587
+ };
1588
+
1589
+ DropInstance.prototype.setupTether = function() {
1590
+ var constraints, dropAttach;
1591
+ dropAttach = this.options.position.split(' ');
1592
+ dropAttach[0] = MIRROR_ATTACH[dropAttach[0]];
1593
+ dropAttach = dropAttach.join(' ');
1594
+ constraints = [];
1595
+ if (this.options.constrainToScrollParent) {
1596
+ constraints.push({
1597
+ to: 'scrollParent',
1598
+ pin: 'top, bottom',
1599
+ attachment: 'together none'
1600
+ });
1601
+ } else {
1602
+ constraints.push({
1603
+ to: 'scrollParent'
1604
+ });
1605
+ }
1606
+ if (this.options.constrainToWindow !== false) {
1607
+ constraints.push({
1608
+ to: 'window',
1609
+ attachment: 'together'
1610
+ });
1611
+ } else {
1612
+ constraints.push({
1613
+ to: 'window'
1614
+ });
1615
+ }
1616
+ options = {
1617
+ element: this.drop,
1618
+ target: this.target,
1619
+ attachment: sortAttach(dropAttach),
1620
+ targetAttachment: sortAttach(this.options.position),
1621
+ classPrefix: drop.classPrefix,
1622
+ offset: '0 0',
1623
+ targetOffset: '0 0',
1624
+ enabled: false,
1625
+ constraints: constraints
1626
+ };
1627
+ if (this.options.tetherOptions !== false) {
1628
+ return this.tether = new Tether(extend({}, options, this.options.tetherOptions));
1629
+ }
1630
+ };
1631
+
1632
+ DropInstance.prototype.setupEvents = function() {
1633
+ var clickEvent, closeHandler, events, onUs, openHandler, out, outTimeout, over, _i, _len,
1634
+ _this = this;
1635
+ if (!this.options.openOn) {
1636
+ return;
1637
+ }
1638
+ if (this.options.openOn === 'always') {
1639
+ setTimeout(this.open.bind(this));
1640
+ return;
1641
+ }
1642
+ events = this.options.openOn.split(' ');
1643
+ if (__indexOf.call(events, 'click') >= 0) {
1644
+ openHandler = function(event) {
1645
+ _this.toggle();
1646
+ return event.preventDefault();
1647
+ };
1648
+ closeHandler = function(event) {
1649
+ if (!_this.isOpened()) {
1650
+ return;
1651
+ }
1652
+ if (event.target === _this.drop || _this.drop.contains(event.target)) {
1653
+ return;
1654
+ }
1655
+ if (event.target === _this.target || _this.target.contains(event.target)) {
1656
+ return;
1657
+ }
1658
+ return _this.close();
1659
+ };
1660
+ for (_i = 0, _len = clickEvents.length; _i < _len; _i++) {
1661
+ clickEvent = clickEvents[_i];
1662
+ this._on(this.target, clickEvent, openHandler);
1663
+ this._on(document, clickEvent, closeHandler);
1664
+ }
1665
+ }
1666
+ if (__indexOf.call(events, 'hover') >= 0) {
1667
+ onUs = false;
1668
+ over = function() {
1669
+ onUs = true;
1670
+ return _this.open();
1671
+ };
1672
+ outTimeout = null;
1673
+ out = function() {
1674
+ onUs = false;
1675
+ if (outTimeout != null) {
1676
+ clearTimeout(outTimeout);
1677
+ }
1678
+ return outTimeout = setTimeout(function() {
1679
+ if (!onUs) {
1680
+ _this.close();
1681
+ }
1682
+ return outTimeout = null;
1683
+ }, 50);
1684
+ };
1685
+ this._on(this.target, 'mouseover', over);
1686
+ this._on(this.drop, 'mouseover', over);
1687
+ this._on(this.target, 'mouseout', out);
1688
+ return this._on(this.drop, 'mouseout', out);
1689
+ }
1690
+ };
1691
+
1692
+ DropInstance.prototype.isOpened = function() {
1693
+ if (this.drop) {
1694
+ return hasClass(this.drop, "" + drop.classPrefix + "-open");
1695
+ }
1696
+ };
1697
+
1698
+ DropInstance.prototype.toggle = function() {
1699
+ if (this.isOpened()) {
1700
+ return this.close();
1701
+ } else {
1702
+ return this.open();
1703
+ }
1704
+ };
1705
+
1706
+ DropInstance.prototype.open = function() {
1707
+ var _ref1, _ref2,
1708
+ _this = this;
1709
+ if (this.isOpened()) {
1710
+ return;
1711
+ }
1712
+ if (!this.drop.parentNode) {
1713
+ document.body.appendChild(this.drop);
1714
+ }
1715
+ if ((_ref1 = this.tether) != null) {
1716
+ _ref1.enable();
1717
+ }
1718
+ addClass(this.drop, "" + drop.classPrefix + "-open");
1719
+ addClass(this.drop, "" + drop.classPrefix + "-open-transitionend");
1720
+ setTimeout(function() {
1721
+ return addClass(_this.drop, "" + drop.classPrefix + "-after-open");
1722
+ });
1723
+ if ((_ref2 = this.tether) != null) {
1724
+ _ref2.position();
1725
+ }
1726
+ this.trigger('open');
1727
+ return drop.updateBodyClasses();
1728
+ };
1729
+
1730
+ DropInstance.prototype.close = function() {
1731
+ var handler, _ref1,
1732
+ _this = this;
1733
+ if (!this.isOpened()) {
1734
+ return;
1735
+ }
1736
+ removeClass(this.drop, "" + drop.classPrefix + "-open");
1737
+ removeClass(this.drop, "" + drop.classPrefix + "-after-open");
1738
+ this.drop.addEventListener('transitionend', handler = function() {
1739
+ if (!hasClass(_this.drop, "" + drop.classPrefix + "-open")) {
1740
+ removeClass(_this.drop, "" + drop.classPrefix + "-open-transitionend");
1741
+ }
1742
+ return _this.drop.removeEventListener('transitionend', handler);
1743
+ });
1744
+ this.trigger('close');
1745
+ if ((_ref1 = this.tether) != null) {
1746
+ _ref1.disable();
1747
+ }
1748
+ drop.updateBodyClasses();
1749
+ if (this.options.remove) {
1750
+ return this.remove();
1751
+ }
1752
+ };
1753
+
1754
+ DropInstance.prototype.remove = function() {
1755
+ var _ref1;
1756
+ this.close();
1757
+ return (_ref1 = this.drop.parentNode) != null ? _ref1.removeChild(this.drop) : void 0;
1758
+ };
1759
+
1760
+ DropInstance.prototype.position = function() {
1761
+ var _ref1;
1762
+ if (this.isOpened()) {
1763
+ return (_ref1 = this.tether) != null ? _ref1.position() : void 0;
1764
+ }
1765
+ };
1766
+
1767
+ DropInstance.prototype.destroy = function() {
1768
+ var element, event, handler, _i, _len, _ref1, _ref2, _ref3;
1769
+ this.remove();
1770
+ if ((_ref1 = this.tether) != null) {
1771
+ _ref1.destroy();
1772
+ }
1773
+ _ref2 = this._boundEvents;
1774
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
1775
+ _ref3 = _ref2[_i], element = _ref3.element, event = _ref3.event, handler = _ref3.handler;
1776
+ element.removeEventListener(event, handler);
1777
+ }
1778
+ this._boundEvents = [];
1779
+ this.tether = null;
1780
+ this.drop = null;
1781
+ this.content = null;
1782
+ this.target = null;
1783
+ removeFromArray(allDrops[drop.classPrefix], this);
1784
+ return removeFromArray(drop.drops, this);
1785
+ };
1786
+
1787
+ return DropInstance;
1788
+
1789
+ })(Evented);
1790
+ return drop;
1791
+ };
1792
+
1793
+ window.Drop = createContext();
1794
+
1795
+ document.addEventListener('DOMContentLoaded', function() {
1796
+ return Drop.updateBodyClasses();
1797
+ });
1798
+
1799
+ }).call(this);