praxis 0.16.1 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (399) hide show
  1. checksums.yaml +4 -4
  2. data/.rspec +0 -1
  3. data/.ruby-version +1 -1
  4. data/.travis.yml +2 -1
  5. data/CHANGELOG.md +41 -0
  6. data/CONTRIBUTING.md +3 -0
  7. data/lib/api_browser/Gruntfile.js +20 -4
  8. data/lib/api_browser/app/bower_components/angular-mocks/.bower.json +6 -6
  9. data/lib/api_browser/app/bower_components/angular-mocks/README.md +11 -5
  10. data/lib/api_browser/app/bower_components/angular-mocks/angular-mocks.js +475 -216
  11. data/lib/api_browser/app/bower_components/angular-mocks/bower.json +2 -2
  12. data/lib/api_browser/app/bower_components/angular-mocks/ngAnimateMock.js +2 -0
  13. data/lib/api_browser/app/bower_components/angular-mocks/ngMock.js +2 -0
  14. data/lib/api_browser/app/bower_components/angular-mocks/ngMockE2E.js +2 -0
  15. data/lib/api_browser/app/bower_components/angular-mocks/package.json +1 -1
  16. data/lib/api_browser/app/bower_components/angular-sanitize/.bower.json +8 -8
  17. data/lib/api_browser/app/bower_components/angular-sanitize/README.md +19 -5
  18. data/lib/api_browser/app/bower_components/angular-sanitize/angular-sanitize.js +186 -127
  19. data/lib/api_browser/app/bower_components/angular-sanitize/angular-sanitize.min.js +12 -10
  20. data/lib/api_browser/app/bower_components/angular-sanitize/angular-sanitize.min.js.map +3 -3
  21. data/lib/api_browser/app/bower_components/angular-sanitize/bower.json +3 -2
  22. data/lib/api_browser/app/bower_components/angular-sanitize/index.js +2 -0
  23. data/lib/api_browser/app/bower_components/angular-sanitize/package.json +26 -0
  24. data/lib/api_browser/app/bower_components/angular-ui-bootstrap-bower/.bower.json +15 -8
  25. data/lib/api_browser/app/bower_components/angular-ui-bootstrap-bower/bower.json +11 -3
  26. data/lib/api_browser/app/bower_components/angular-ui-bootstrap-bower/ui-bootstrap-csp.css +6 -0
  27. data/lib/api_browser/app/bower_components/angular-ui-bootstrap-bower/ui-bootstrap-tpls.js +1177 -453
  28. data/lib/api_browser/app/bower_components/angular-ui-bootstrap-bower/ui-bootstrap-tpls.min.js +4 -4
  29. data/lib/api_browser/app/bower_components/angular-ui-bootstrap-bower/ui-bootstrap.js +1066 -404
  30. data/lib/api_browser/app/bower_components/angular-ui-bootstrap-bower/ui-bootstrap.min.js +3 -3
  31. data/lib/api_browser/app/bower_components/angular-ui-router/.bower.json +5 -6
  32. data/lib/api_browser/app/bower_components/angular-ui-router/CHANGELOG.md +208 -3
  33. data/lib/api_browser/app/bower_components/angular-ui-router/CONTRIBUTING.md +65 -0
  34. data/lib/api_browser/app/bower_components/angular-ui-router/LICENSE +1 -1
  35. data/lib/api_browser/app/bower_components/angular-ui-router/README.md +36 -71
  36. data/lib/api_browser/app/bower_components/angular-ui-router/api/angular-ui-router.d.ts +126 -0
  37. data/lib/api_browser/app/bower_components/angular-ui-router/bower.json +1 -1
  38. data/lib/api_browser/app/bower_components/angular-ui-router/release/angular-ui-router.js +1902 -755
  39. data/lib/api_browser/app/bower_components/angular-ui-router/release/angular-ui-router.min.js +2 -2
  40. data/lib/api_browser/app/bower_components/angular-ui-router/src/common.js +69 -23
  41. data/lib/api_browser/app/bower_components/angular-ui-router/src/resolve.js +15 -5
  42. data/lib/api_browser/app/bower_components/angular-ui-router/src/state.js +556 -295
  43. data/lib/api_browser/app/bower_components/angular-ui-router/src/stateDirectives.js +101 -42
  44. data/lib/api_browser/app/bower_components/angular-ui-router/src/stateFilters.js +6 -2
  45. data/lib/api_browser/app/bower_components/angular-ui-router/src/templateFactory.js +2 -2
  46. data/lib/api_browser/app/bower_components/angular-ui-router/src/urlMatcherFactory.js +822 -97
  47. data/lib/api_browser/app/bower_components/angular-ui-router/src/urlRouter.js +274 -120
  48. data/lib/api_browser/app/bower_components/angular-ui-router/src/viewDirective.js +33 -20
  49. data/lib/api_browser/app/bower_components/angular-ui-router/src/viewScroll.js +1 -1
  50. data/lib/api_browser/app/bower_components/angular/.bower.json +5 -5
  51. data/lib/api_browser/app/bower_components/angular/README.md +2 -5
  52. data/lib/api_browser/app/bower_components/angular/angular-csp.css +5 -8
  53. data/lib/api_browser/app/bower_components/angular/angular.js +12975 -6996
  54. data/lib/api_browser/app/bower_components/angular/angular.min.js +285 -213
  55. data/lib/api_browser/app/bower_components/angular/angular.min.js.gzip +0 -0
  56. data/lib/api_browser/app/bower_components/angular/angular.min.js.map +3 -3
  57. data/lib/api_browser/app/bower_components/angular/bower.json +1 -1
  58. data/lib/api_browser/app/bower_components/angular/index.js +2 -0
  59. data/lib/api_browser/app/bower_components/angular/package.json +2 -2
  60. data/lib/api_browser/app/bower_components/bootstrap-sass/.bower.json +31 -16
  61. data/lib/api_browser/app/bower_components/bootstrap-sass/CHANGELOG.md +108 -0
  62. data/lib/api_browser/app/bower_components/bootstrap-sass/CONTRIBUTING.md +55 -37
  63. data/lib/api_browser/app/bower_components/bootstrap-sass/README.md +147 -206
  64. data/lib/api_browser/app/bower_components/bootstrap-sass/bower.json +19 -8
  65. data/lib/api_browser/app/bower_components/bootstrap-sass/{dist/fonts → vendor/assets/fonts/bootstrap}/glyphicons-halflings-regular.eot +0 -0
  66. data/lib/api_browser/app/bower_components/bootstrap-sass/{dist/fonts → vendor/assets/fonts/bootstrap}/glyphicons-halflings-regular.svg +0 -0
  67. data/lib/api_browser/app/bower_components/bootstrap-sass/{dist/fonts → vendor/assets/fonts/bootstrap}/glyphicons-halflings-regular.ttf +0 -0
  68. data/lib/api_browser/app/bower_components/bootstrap-sass/{dist/fonts → vendor/assets/fonts/bootstrap}/glyphicons-halflings-regular.woff +0 -0
  69. data/lib/api_browser/app/bower_components/bootstrap-sass/vendor/assets/javascripts/bootstrap.js +12 -0
  70. data/lib/api_browser/app/bower_components/bootstrap-sass/{js → vendor/assets/javascripts/bootstrap}/affix.js +1 -1
  71. data/lib/api_browser/app/bower_components/bootstrap-sass/{js → vendor/assets/javascripts/bootstrap}/alert.js +1 -1
  72. data/lib/api_browser/app/bower_components/bootstrap-sass/{js → vendor/assets/javascripts/bootstrap}/button.js +11 -5
  73. data/lib/api_browser/app/bower_components/bootstrap-sass/{js → vendor/assets/javascripts/bootstrap}/carousel.js +5 -5
  74. data/lib/api_browser/app/bower_components/bootstrap-sass/{js → vendor/assets/javascripts/bootstrap}/collapse.js +1 -1
  75. data/lib/api_browser/app/bower_components/bootstrap-sass/{js → vendor/assets/javascripts/bootstrap}/dropdown.js +5 -5
  76. data/lib/api_browser/app/bower_components/bootstrap-sass/{js → vendor/assets/javascripts/bootstrap}/modal.js +1 -1
  77. data/lib/api_browser/app/bower_components/bootstrap-sass/{js → vendor/assets/javascripts/bootstrap}/popover.js +1 -1
  78. data/lib/api_browser/app/bower_components/bootstrap-sass/{js → vendor/assets/javascripts/bootstrap}/scrollspy.js +2 -2
  79. data/lib/api_browser/app/bower_components/bootstrap-sass/{js → vendor/assets/javascripts/bootstrap}/tab.js +1 -1
  80. data/lib/api_browser/app/bower_components/bootstrap-sass/{js → vendor/assets/javascripts/bootstrap}/tooltip.js +1 -1
  81. data/lib/api_browser/app/bower_components/bootstrap-sass/{js → vendor/assets/javascripts/bootstrap}/transition.js +1 -1
  82. data/lib/api_browser/app/bower_components/bootstrap-sass/vendor/assets/stylesheets/bootstrap.scss +1 -0
  83. data/lib/api_browser/app/bower_components/bootstrap-sass/{lib → vendor/assets/stylesheets/bootstrap}/_alerts.scss +0 -0
  84. data/lib/api_browser/app/bower_components/bootstrap-sass/{lib → vendor/assets/stylesheets/bootstrap}/_badges.scss +6 -6
  85. data/lib/api_browser/app/bower_components/bootstrap-sass/{lib → vendor/assets/stylesheets/bootstrap}/_breadcrumbs.scss +0 -0
  86. data/lib/api_browser/app/bower_components/bootstrap-sass/{lib → vendor/assets/stylesheets/bootstrap}/_button-groups.scss +7 -33
  87. data/lib/api_browser/app/bower_components/bootstrap-sass/{lib → vendor/assets/stylesheets/bootstrap}/_buttons.scss +2 -5
  88. data/lib/api_browser/app/bower_components/bootstrap-sass/{lib → vendor/assets/stylesheets/bootstrap}/_carousel.scss +1 -0
  89. data/lib/api_browser/app/bower_components/bootstrap-sass/{lib → vendor/assets/stylesheets/bootstrap}/_close.scss +0 -0
  90. data/lib/api_browser/app/bower_components/bootstrap-sass/{lib → vendor/assets/stylesheets/bootstrap}/_code.scss +0 -0
  91. data/lib/api_browser/app/bower_components/bootstrap-sass/{lib → vendor/assets/stylesheets/bootstrap}/_component-animations.scss +0 -0
  92. data/lib/api_browser/app/bower_components/bootstrap-sass/{lib → vendor/assets/stylesheets/bootstrap}/_dropdowns.scss +3 -8
  93. data/lib/api_browser/app/bower_components/bootstrap-sass/{lib → vendor/assets/stylesheets/bootstrap}/_forms.scss +11 -0
  94. data/lib/api_browser/app/bower_components/bootstrap-sass/{lib → vendor/assets/stylesheets/bootstrap}/_glyphicons.scss +5 -5
  95. data/lib/api_browser/app/bower_components/bootstrap-sass/{lib → vendor/assets/stylesheets/bootstrap}/_grid.scss +12 -26
  96. data/lib/api_browser/app/bower_components/bootstrap-sass/{lib → vendor/assets/stylesheets/bootstrap}/_input-groups.scss +1 -1
  97. data/lib/api_browser/app/bower_components/bootstrap-sass/{lib → vendor/assets/stylesheets/bootstrap}/_jumbotron.scss +8 -2
  98. data/lib/api_browser/app/bower_components/bootstrap-sass/{lib → vendor/assets/stylesheets/bootstrap}/_labels.scss +6 -0
  99. data/lib/api_browser/app/bower_components/bootstrap-sass/{lib → vendor/assets/stylesheets/bootstrap}/_list-group.scss +0 -0
  100. data/lib/api_browser/app/bower_components/bootstrap-sass/{lib → vendor/assets/stylesheets/bootstrap}/_media.scss +0 -0
  101. data/lib/api_browser/app/bower_components/bootstrap-sass/{lib → vendor/assets/stylesheets/bootstrap}/_mixins.scss +38 -51
  102. data/lib/api_browser/app/bower_components/bootstrap-sass/{lib → vendor/assets/stylesheets/bootstrap}/_modals.scss +2 -5
  103. data/lib/api_browser/app/bower_components/bootstrap-sass/{lib → vendor/assets/stylesheets/bootstrap}/_navbar.scss +41 -53
  104. data/lib/api_browser/app/bower_components/bootstrap-sass/{lib → vendor/assets/stylesheets/bootstrap}/_navs.scss +0 -20
  105. data/lib/api_browser/app/bower_components/bootstrap-sass/{lib → vendor/assets/stylesheets/bootstrap}/_normalize.scss +0 -0
  106. data/lib/api_browser/app/bower_components/bootstrap-sass/{lib → vendor/assets/stylesheets/bootstrap}/_pager.scss +0 -0
  107. data/lib/api_browser/app/bower_components/bootstrap-sass/{lib → vendor/assets/stylesheets/bootstrap}/_pagination.scss +0 -0
  108. data/lib/api_browser/app/bower_components/bootstrap-sass/{lib → vendor/assets/stylesheets/bootstrap}/_panels.scss +11 -1
  109. data/lib/api_browser/app/bower_components/bootstrap-sass/{lib → vendor/assets/stylesheets/bootstrap}/_popovers.scss +0 -0
  110. data/lib/api_browser/app/bower_components/bootstrap-sass/{lib → vendor/assets/stylesheets/bootstrap}/_print.scss +0 -0
  111. data/lib/api_browser/app/bower_components/bootstrap-sass/{lib → vendor/assets/stylesheets/bootstrap}/_progress-bars.scss +0 -12
  112. data/lib/api_browser/app/bower_components/bootstrap-sass/{lib → vendor/assets/stylesheets/bootstrap}/_responsive-utilities.scss +0 -0
  113. data/lib/api_browser/app/bower_components/bootstrap-sass/{lib → vendor/assets/stylesheets/bootstrap}/_scaffolding.scss +0 -0
  114. data/lib/api_browser/app/bower_components/bootstrap-sass/{lib → vendor/assets/stylesheets/bootstrap}/_tables.scss +5 -18
  115. data/lib/api_browser/app/bower_components/bootstrap-sass/{lib → vendor/assets/stylesheets/bootstrap}/_theme.scss +2 -2
  116. data/lib/api_browser/app/bower_components/bootstrap-sass/{lib → vendor/assets/stylesheets/bootstrap}/_thumbnails.scss +9 -3
  117. data/lib/api_browser/app/bower_components/bootstrap-sass/{lib → vendor/assets/stylesheets/bootstrap}/_tooltip.scss +0 -0
  118. data/lib/api_browser/app/bower_components/bootstrap-sass/{lib → vendor/assets/stylesheets/bootstrap}/_type.scss +54 -52
  119. data/lib/api_browser/app/bower_components/bootstrap-sass/{lib → vendor/assets/stylesheets/bootstrap}/_utilities.scss +0 -0
  120. data/lib/api_browser/app/bower_components/bootstrap-sass/{lib → vendor/assets/stylesheets/bootstrap}/_variables.scss +20 -11
  121. data/lib/api_browser/app/bower_components/bootstrap-sass/{lib → vendor/assets/stylesheets/bootstrap}/_wells.scss +0 -0
  122. data/lib/api_browser/app/bower_components/bootstrap-sass/{lib → vendor/assets/stylesheets/bootstrap}/bootstrap.scss +0 -0
  123. data/lib/api_browser/app/bower_components/lodash/.bower.json +9 -13
  124. data/lib/api_browser/app/bower_components/lodash/LICENSE.txt +3 -3
  125. data/lib/api_browser/app/bower_components/lodash/bower.json +4 -7
  126. data/lib/api_browser/app/bower_components/lodash/lodash.js +12235 -0
  127. data/lib/api_browser/app/bower_components/lodash/lodash.min.js +98 -0
  128. data/lib/api_browser/app/index.html +0 -1
  129. data/lib/api_browser/app/js/app.js +2 -5
  130. data/lib/api_browser/app/js/controllers/action.js +21 -37
  131. data/lib/api_browser/app/js/controllers/controller.js +23 -1
  132. data/lib/api_browser/app/js/controllers/menu.js +46 -14
  133. data/lib/api_browser/app/js/controllers/type.js +2 -9
  134. data/lib/api_browser/app/js/directives/attribute_description.js +15 -5
  135. data/lib/api_browser/app/js/directives/attribute_table.js +6 -6
  136. data/lib/api_browser/app/js/directives/fixed_if_fits.js +20 -0
  137. data/lib/api_browser/app/js/directives/no_container.js +6 -6
  138. data/lib/api_browser/app/js/directives/type_placeholder.js +21 -0
  139. data/lib/api_browser/app/js/factories/Configuration.js +13 -0
  140. data/lib/api_browser/app/js/factories/Documentation.js +0 -3
  141. data/lib/api_browser/app/js/factories/normalize_attributes.js +19 -0
  142. data/lib/api_browser/app/js/factories/template_for.js +113 -0
  143. data/lib/api_browser/app/sass/modules/_body.scss +26 -4
  144. data/lib/api_browser/app/sass/modules/_sidebar.scss +68 -1
  145. data/lib/api_browser/app/sass/praxis.scss +1 -5
  146. data/lib/api_browser/app/sass/variables/_bootstrap-variables.scss +13 -4
  147. data/lib/api_browser/app/views/action.html +13 -17
  148. data/lib/api_browser/app/views/controller.html +32 -4
  149. data/lib/api_browser/app/views/directives/attribute_description.html +1 -1
  150. data/lib/api_browser/app/views/directives/attribute_description/{_default.html → default.html} +0 -0
  151. data/lib/api_browser/app/views/directives/attribute_description/example.html +13 -0
  152. data/lib/api_browser/app/views/directives/attribute_description/headers.html +8 -0
  153. data/lib/api_browser/app/views/directives/attribute_description/member_options.html +4 -0
  154. data/lib/api_browser/app/views/directives/attribute_description/values.html +14 -0
  155. data/lib/api_browser/app/views/directives/attribute_table.html +2 -2
  156. data/lib/api_browser/app/views/home.html +1 -3
  157. data/lib/api_browser/app/views/layout.html +3 -36
  158. data/lib/api_browser/app/views/menu.html +45 -0
  159. data/lib/api_browser/app/views/navbar.html +1 -1
  160. data/lib/api_browser/app/views/type.html +2 -2
  161. data/lib/api_browser/app/views/type/{_details.html → details.html} +6 -6
  162. data/lib/api_browser/app/views/types/embedded/default.html +10 -0
  163. data/lib/api_browser/app/views/types/embedded/links.html +11 -0
  164. data/lib/api_browser/app/views/types/embedded/struct.html +2 -0
  165. data/lib/api_browser/app/views/types/label/link.html +1 -0
  166. data/lib/api_browser/app/views/types/label/primitive.html +1 -0
  167. data/lib/api_browser/app/views/types/label/primitive_collection.html +1 -0
  168. data/lib/api_browser/app/views/types/label/type.html +1 -0
  169. data/lib/api_browser/app/views/types/label/type_collection.html +1 -0
  170. data/lib/api_browser/app/views/{directives/request_body/_default.html → types/standalone/default.html} +1 -1
  171. data/lib/api_browser/app/views/types/standalone/struct.html +1 -0
  172. data/lib/api_browser/bower.json +9 -9
  173. data/lib/api_browser/package.json +1 -1
  174. data/lib/praxis.rb +10 -4
  175. data/lib/praxis/action_definition.rb +16 -4
  176. data/lib/praxis/action_definition/headers_dsl_compiler.rb +5 -2
  177. data/lib/praxis/api_definition.rb +3 -1
  178. data/lib/praxis/api_general_info.rb +49 -5
  179. data/lib/praxis/application.rb +12 -4
  180. data/lib/praxis/bootloader.rb +1 -0
  181. data/lib/praxis/bootloader_stages/environment.rb +2 -0
  182. data/lib/praxis/bootloader_stages/routing.rb +1 -1
  183. data/lib/praxis/bootloader_stages/subgroup_loader.rb +1 -0
  184. data/lib/praxis/exceptions/validation.rb +7 -0
  185. data/lib/praxis/handlers/plain.rb +16 -0
  186. data/lib/praxis/handlers/xml.rb +4 -4
  187. data/lib/praxis/links.rb +13 -3
  188. data/lib/praxis/media_type_identifier.rb +3 -0
  189. data/lib/praxis/multipart/parser.rb +41 -48
  190. data/lib/praxis/multipart/part.rb +196 -3
  191. data/lib/praxis/request.rb +14 -11
  192. data/lib/praxis/request_stages/request_stage.rb +4 -0
  193. data/lib/praxis/request_stages/response.rb +10 -9
  194. data/lib/praxis/request_stages/validate.rb +1 -7
  195. data/lib/praxis/request_stages/validate_params_and_headers.rb +30 -5
  196. data/lib/praxis/request_stages/validate_payload.rb +14 -5
  197. data/lib/praxis/resource_definition.rb +117 -15
  198. data/lib/praxis/response.rb +6 -5
  199. data/lib/praxis/response_definition.rb +51 -5
  200. data/lib/praxis/responses/http.rb +5 -0
  201. data/lib/praxis/responses/multipart_ok.rb +51 -0
  202. data/lib/praxis/responses/validation_error.rb +7 -7
  203. data/lib/praxis/restful_doc_generator.rb +9 -4
  204. data/lib/praxis/route.rb +3 -2
  205. data/lib/praxis/router.rb +26 -16
  206. data/lib/praxis/router/rack.rb +51 -0
  207. data/lib/praxis/router/simple.rb +146 -0
  208. data/lib/praxis/routing_config.rb +2 -2
  209. data/lib/praxis/trait.rb +1 -1
  210. data/lib/praxis/types/fuzzy_hash.rb +49 -0
  211. data/lib/praxis/types/media_type_common.rb +1 -1
  212. data/lib/praxis/types/multipart.rb +47 -12
  213. data/lib/praxis/types/multipart_array.rb +320 -0
  214. data/lib/praxis/types/multipart_array/part_definition.rb +52 -0
  215. data/lib/praxis/validation_handler.rb +10 -0
  216. data/lib/praxis/version.rb +2 -2
  217. data/praxis.gemspec +3 -3
  218. data/spec/api_browser/directives/type_placeholder_spec.js +134 -0
  219. data/spec/api_browser/factories/normalize_attributes_spec.js +97 -0
  220. data/spec/api_browser/factories/template_for_spec.js +67 -0
  221. data/spec/functional_spec.rb +111 -45
  222. data/spec/praxis/action_definition_spec.rb +31 -7
  223. data/spec/praxis/api_definition_spec.rb +2 -2
  224. data/spec/praxis/api_general_info_spec.rb +25 -0
  225. data/spec/praxis/application_spec.rb +24 -11
  226. data/spec/praxis/handlers/xml_spec.rb +55 -33
  227. data/spec/praxis/links_spec.rb +18 -1
  228. data/spec/praxis/media_type_collection_spec.rb +1 -1
  229. data/spec/praxis/media_type_spec.rb +2 -2
  230. data/spec/praxis/multipart/parser_spec.rb +21 -13
  231. data/spec/praxis/plugins/praxis_mapper_plugin_spec.rb +1 -1
  232. data/spec/praxis/request_spec.rb +52 -24
  233. data/spec/praxis/{request_stages_action_spec.rb → request_stages/action_spec.rb} +1 -1
  234. data/spec/praxis/{request_stage_spec.rb → request_stages/request_stage_spec.rb} +0 -0
  235. data/spec/praxis/{request_stages_validate_spec.rb → request_stages/validate_spec.rb} +1 -1
  236. data/spec/praxis/resource_definition_spec.rb +30 -4
  237. data/spec/praxis/response_definition_spec.rb +60 -19
  238. data/spec/praxis/response_spec.rb +2 -2
  239. data/spec/praxis/responses/validation_error_spec.rb +33 -16
  240. data/spec/praxis/route_spec.rb +4 -2
  241. data/spec/praxis/router_spec.rb +28 -12
  242. data/spec/praxis/routing_config_spec.rb +11 -5
  243. data/spec/praxis/types/collection_spec.rb +1 -1
  244. data/spec/praxis/types/fuzzy_hash_spec.rb +20 -0
  245. data/spec/praxis/types/multipart_array/part_definition_spec.rb +5 -0
  246. data/spec/praxis/types/multipart_array_spec.rb +334 -0
  247. data/spec/praxis/types/multipart_spec.rb +14 -5
  248. data/spec/spec_app/app/controllers/instances.rb +20 -10
  249. data/spec/spec_app/app/controllers/volumes.rb +8 -4
  250. data/spec/spec_app/app/responses/bulk_response.rb +0 -6
  251. data/spec/spec_app/config/environment.rb +13 -0
  252. data/spec/spec_app/design/api.rb +7 -10
  253. data/spec/spec_app/design/media_types/instance.rb +3 -1
  254. data/spec/spec_app/design/resources/instances.rb +50 -41
  255. data/spec/spec_app/design/resources/volume_snapshots.rb +39 -0
  256. data/spec/spec_app/design/resources/volumes.rb +11 -6
  257. data/spec/spec_helper.rb +3 -1
  258. metadata +125 -218
  259. data/lib/api_browser/app/bower_components/angular-ui-router/src/compat.js +0 -146
  260. data/lib/api_browser/app/bower_components/bootstrap-sass/CNAME +0 -1
  261. data/lib/api_browser/app/bower_components/bootstrap-sass/DOCS-LICENSE +0 -319
  262. data/lib/api_browser/app/bower_components/bootstrap-sass/Gemfile +0 -5
  263. data/lib/api_browser/app/bower_components/bootstrap-sass/Gemfile.lock +0 -14
  264. data/lib/api_browser/app/bower_components/bootstrap-sass/Gruntfile.js +0 -244
  265. data/lib/api_browser/app/bower_components/bootstrap-sass/LICENSE +0 -176
  266. data/lib/api_browser/app/bower_components/bootstrap-sass/LICENSE-MIT +0 -21
  267. data/lib/api_browser/app/bower_components/bootstrap-sass/Rakefile +0 -44
  268. data/lib/api_browser/app/bower_components/bootstrap-sass/_config.yml +0 -25
  269. data/lib/api_browser/app/bower_components/bootstrap-sass/_includes/ads.html +0 -1
  270. data/lib/api_browser/app/bower_components/bootstrap-sass/_includes/footer.html +0 -34
  271. data/lib/api_browser/app/bower_components/bootstrap-sass/_includes/header.html +0 -42
  272. data/lib/api_browser/app/bower_components/bootstrap-sass/_includes/nav-about.html +0 -12
  273. data/lib/api_browser/app/bower_components/bootstrap-sass/_includes/nav-components.html +0 -137
  274. data/lib/api_browser/app/bower_components/bootstrap-sass/_includes/nav-css.html +0 -99
  275. data/lib/api_browser/app/bower_components/bootstrap-sass/_includes/nav-customize.html +0 -40
  276. data/lib/api_browser/app/bower_components/bootstrap-sass/_includes/nav-getting-started.html +0 -44
  277. data/lib/api_browser/app/bower_components/bootstrap-sass/_includes/nav-javascript.html +0 -88
  278. data/lib/api_browser/app/bower_components/bootstrap-sass/_includes/nav-main.html +0 -37
  279. data/lib/api_browser/app/bower_components/bootstrap-sass/_includes/old-bs-docs.html +0 -8
  280. data/lib/api_browser/app/bower_components/bootstrap-sass/_includes/social-buttons.html +0 -16
  281. data/lib/api_browser/app/bower_components/bootstrap-sass/_layouts/default.html +0 -79
  282. data/lib/api_browser/app/bower_components/bootstrap-sass/_layouts/home.html +0 -47
  283. data/lib/api_browser/app/bower_components/bootstrap-sass/about.html +0 -93
  284. data/lib/api_browser/app/bower_components/bootstrap-sass/browserstack.json +0 -37
  285. data/lib/api_browser/app/bower_components/bootstrap-sass/components.html +0 -3689
  286. data/lib/api_browser/app/bower_components/bootstrap-sass/composer.json +0 -28
  287. data/lib/api_browser/app/bower_components/bootstrap-sass/css.html +0 -2674
  288. data/lib/api_browser/app/bower_components/bootstrap-sass/customize.html +0 -1715
  289. data/lib/api_browser/app/bower_components/bootstrap-sass/dist/css/bootstrap-theme.css +0 -427
  290. data/lib/api_browser/app/bower_components/bootstrap-sass/dist/css/bootstrap-theme.min.css +0 -1
  291. data/lib/api_browser/app/bower_components/bootstrap-sass/dist/css/bootstrap.css +0 -6350
  292. data/lib/api_browser/app/bower_components/bootstrap-sass/dist/css/bootstrap.min.css +0 -1
  293. data/lib/api_browser/app/bower_components/bootstrap-sass/dist/js/bootstrap.js +0 -2002
  294. data/lib/api_browser/app/bower_components/bootstrap-sass/dist/js/bootstrap.min.js +0 -9
  295. data/lib/api_browser/app/bower_components/bootstrap-sass/docs-assets/css/docs.css +0 -1195
  296. data/lib/api_browser/app/bower_components/bootstrap-sass/docs-assets/css/pygments-manni.css +0 -66
  297. data/lib/api_browser/app/bower_components/bootstrap-sass/docs-assets/ico/apple-touch-icon-144-precomposed.png +0 -0
  298. data/lib/api_browser/app/bower_components/bootstrap-sass/docs-assets/ico/favicon.png +0 -0
  299. data/lib/api_browser/app/bower_components/bootstrap-sass/docs-assets/js/application.js +0 -103
  300. data/lib/api_browser/app/bower_components/bootstrap-sass/docs-assets/js/customizer.js +0 -332
  301. data/lib/api_browser/app/bower_components/bootstrap-sass/docs-assets/js/filesaver.js +0 -169
  302. data/lib/api_browser/app/bower_components/bootstrap-sass/docs-assets/js/holder.js +0 -404
  303. data/lib/api_browser/app/bower_components/bootstrap-sass/docs-assets/js/ie8-responsive-file-warning.js +0 -12
  304. data/lib/api_browser/app/bower_components/bootstrap-sass/docs-assets/js/jszip.js +0 -1467
  305. data/lib/api_browser/app/bower_components/bootstrap-sass/docs-assets/js/less.js +0 -9
  306. data/lib/api_browser/app/bower_components/bootstrap-sass/docs-assets/js/raw-files.js +0 -3
  307. data/lib/api_browser/app/bower_components/bootstrap-sass/docs-assets/js/uglify.js +0 -14
  308. data/lib/api_browser/app/bower_components/bootstrap-sass/examples/carousel/carousel.css +0 -148
  309. data/lib/api_browser/app/bower_components/bootstrap-sass/examples/carousel/index.html +0 -206
  310. data/lib/api_browser/app/bower_components/bootstrap-sass/examples/grid/grid.css +0 -28
  311. data/lib/api_browser/app/bower_components/bootstrap-sass/examples/grid/index.html +0 -148
  312. data/lib/api_browser/app/bower_components/bootstrap-sass/examples/jumbotron-narrow/index.html +0 -82
  313. data/lib/api_browser/app/bower_components/bootstrap-sass/examples/jumbotron-narrow/jumbotron-narrow.css +0 -79
  314. data/lib/api_browser/app/bower_components/bootstrap-sass/examples/jumbotron/index.html +0 -99
  315. data/lib/api_browser/app/bower_components/bootstrap-sass/examples/jumbotron/jumbotron.css +0 -5
  316. data/lib/api_browser/app/bower_components/bootstrap-sass/examples/justified-nav/index.html +0 -83
  317. data/lib/api_browser/app/bower_components/bootstrap-sass/examples/justified-nav/justified-nav.css +0 -88
  318. data/lib/api_browser/app/bower_components/bootstrap-sass/examples/navbar-fixed-top/index.html +0 -91
  319. data/lib/api_browser/app/bower_components/bootstrap-sass/examples/navbar-fixed-top/navbar-fixed-top.css +0 -4
  320. data/lib/api_browser/app/bower_components/bootstrap-sass/examples/navbar-static-top/index.html +0 -92
  321. data/lib/api_browser/app/bower_components/bootstrap-sass/examples/navbar-static-top/navbar-static-top.css +0 -7
  322. data/lib/api_browser/app/bower_components/bootstrap-sass/examples/navbar/index.html +0 -88
  323. data/lib/api_browser/app/bower_components/bootstrap-sass/examples/navbar/navbar.css +0 -8
  324. data/lib/api_browser/app/bower_components/bootstrap-sass/examples/non-responsive/index.html +0 -101
  325. data/lib/api_browser/app/bower_components/bootstrap-sass/examples/non-responsive/non-responsive.css +0 -116
  326. data/lib/api_browser/app/bower_components/bootstrap-sass/examples/offcanvas/index.html +0 -130
  327. data/lib/api_browser/app/bower_components/bootstrap-sass/examples/offcanvas/offcanvas.css +0 -50
  328. data/lib/api_browser/app/bower_components/bootstrap-sass/examples/offcanvas/offcanvas.js +0 -5
  329. data/lib/api_browser/app/bower_components/bootstrap-sass/examples/screenshots/carousel.jpg +0 -0
  330. data/lib/api_browser/app/bower_components/bootstrap-sass/examples/screenshots/grid.jpg +0 -0
  331. data/lib/api_browser/app/bower_components/bootstrap-sass/examples/screenshots/jumbotron-narrow.jpg +0 -0
  332. data/lib/api_browser/app/bower_components/bootstrap-sass/examples/screenshots/jumbotron.jpg +0 -0
  333. data/lib/api_browser/app/bower_components/bootstrap-sass/examples/screenshots/justified-nav.jpg +0 -0
  334. data/lib/api_browser/app/bower_components/bootstrap-sass/examples/screenshots/navbar-fixed.jpg +0 -0
  335. data/lib/api_browser/app/bower_components/bootstrap-sass/examples/screenshots/navbar-static.jpg +0 -0
  336. data/lib/api_browser/app/bower_components/bootstrap-sass/examples/screenshots/navbar.jpg +0 -0
  337. data/lib/api_browser/app/bower_components/bootstrap-sass/examples/screenshots/non-responsive.jpg +0 -0
  338. data/lib/api_browser/app/bower_components/bootstrap-sass/examples/screenshots/offcanvas.jpg +0 -0
  339. data/lib/api_browser/app/bower_components/bootstrap-sass/examples/screenshots/sign-in.jpg +0 -0
  340. data/lib/api_browser/app/bower_components/bootstrap-sass/examples/screenshots/starter-template.jpg +0 -0
  341. data/lib/api_browser/app/bower_components/bootstrap-sass/examples/screenshots/sticky-footer-navbar.jpg +0 -0
  342. data/lib/api_browser/app/bower_components/bootstrap-sass/examples/screenshots/sticky-footer.jpg +0 -0
  343. data/lib/api_browser/app/bower_components/bootstrap-sass/examples/screenshots/theme.jpg +0 -0
  344. data/lib/api_browser/app/bower_components/bootstrap-sass/examples/signin/index.html +0 -50
  345. data/lib/api_browser/app/bower_components/bootstrap-sass/examples/signin/signin.css +0 -40
  346. data/lib/api_browser/app/bower_components/bootstrap-sass/examples/starter-template/index.html +0 -68
  347. data/lib/api_browser/app/bower_components/bootstrap-sass/examples/starter-template/starter-template.css +0 -7
  348. data/lib/api_browser/app/bower_components/bootstrap-sass/examples/sticky-footer-navbar/index.html +0 -91
  349. data/lib/api_browser/app/bower_components/bootstrap-sass/examples/sticky-footer-navbar/sticky-footer-navbar.css +0 -45
  350. data/lib/api_browser/app/bower_components/bootstrap-sass/examples/sticky-footer/index.html +0 -55
  351. data/lib/api_browser/app/bower_components/bootstrap-sass/examples/sticky-footer/sticky-footer.css +0 -38
  352. data/lib/api_browser/app/bower_components/bootstrap-sass/examples/theme/index.html +0 -384
  353. data/lib/api_browser/app/bower_components/bootstrap-sass/examples/theme/theme.css +0 -14
  354. data/lib/api_browser/app/bower_components/bootstrap-sass/fonts/glyphicons-halflings-regular.eot +0 -0
  355. data/lib/api_browser/app/bower_components/bootstrap-sass/fonts/glyphicons-halflings-regular.svg +0 -229
  356. data/lib/api_browser/app/bower_components/bootstrap-sass/fonts/glyphicons-halflings-regular.ttf +0 -0
  357. data/lib/api_browser/app/bower_components/bootstrap-sass/fonts/glyphicons-halflings-regular.woff +0 -0
  358. data/lib/api_browser/app/bower_components/bootstrap-sass/getting-started.html +0 -1021
  359. data/lib/api_browser/app/bower_components/bootstrap-sass/index.html +0 -16
  360. data/lib/api_browser/app/bower_components/bootstrap-sass/javascript.html +0 -1983
  361. data/lib/api_browser/app/bower_components/bootstrap-sass/js/tests/index.html +0 -52
  362. data/lib/api_browser/app/bower_components/bootstrap-sass/js/tests/unit/affix.js +0 -25
  363. data/lib/api_browser/app/bower_components/bootstrap-sass/js/tests/unit/alert.js +0 -62
  364. data/lib/api_browser/app/bower_components/bootstrap-sass/js/tests/unit/button.js +0 -116
  365. data/lib/api_browser/app/bower_components/bootstrap-sass/js/tests/unit/carousel.js +0 -87
  366. data/lib/api_browser/app/bower_components/bootstrap-sass/js/tests/unit/collapse.js +0 -164
  367. data/lib/api_browser/app/bower_components/bootstrap-sass/js/tests/unit/dropdown.js +0 -219
  368. data/lib/api_browser/app/bower_components/bootstrap-sass/js/tests/unit/modal.js +0 -196
  369. data/lib/api_browser/app/bower_components/bootstrap-sass/js/tests/unit/phantom.js +0 -69
  370. data/lib/api_browser/app/bower_components/bootstrap-sass/js/tests/unit/popover.js +0 -133
  371. data/lib/api_browser/app/bower_components/bootstrap-sass/js/tests/unit/scrollspy.js +0 -37
  372. data/lib/api_browser/app/bower_components/bootstrap-sass/js/tests/unit/tab.js +0 -86
  373. data/lib/api_browser/app/bower_components/bootstrap-sass/js/tests/unit/tooltip.js +0 -437
  374. data/lib/api_browser/app/bower_components/bootstrap-sass/js/tests/unit/transition.js +0 -13
  375. data/lib/api_browser/app/bower_components/bootstrap-sass/js/tests/vendor/jquery.js +0 -6
  376. data/lib/api_browser/app/bower_components/bootstrap-sass/js/tests/vendor/qunit.css +0 -232
  377. data/lib/api_browser/app/bower_components/bootstrap-sass/js/tests/vendor/qunit.js +0 -1510
  378. data/lib/api_browser/app/bower_components/bootstrap-sass/package.json +0 -40
  379. data/lib/api_browser/app/bower_components/lodash/dist/lodash.compat.js +0 -7157
  380. data/lib/api_browser/app/bower_components/lodash/dist/lodash.compat.min.js +0 -61
  381. data/lib/api_browser/app/bower_components/lodash/dist/lodash.js +0 -6785
  382. data/lib/api_browser/app/bower_components/lodash/dist/lodash.min.js +0 -56
  383. data/lib/api_browser/app/bower_components/lodash/dist/lodash.underscore.js +0 -4979
  384. data/lib/api_browser/app/bower_components/lodash/dist/lodash.underscore.min.js +0 -39
  385. data/lib/api_browser/app/js/directives/attribute_table_row.js +0 -17
  386. data/lib/api_browser/app/js/directives/request_body.js +0 -25
  387. data/lib/api_browser/app/js/directives/request_headers.js +0 -17
  388. data/lib/api_browser/app/js/directives/request_parameters.js +0 -17
  389. data/lib/api_browser/app/js/directives/type_label.js +0 -52
  390. data/lib/api_browser/app/js/factories/PayloadTemplates.js +0 -10
  391. data/lib/api_browser/app/js/factories/TemplateProvider.js +0 -45
  392. data/lib/api_browser/app/js/factories/TypeTemplates.js +0 -11
  393. data/lib/api_browser/app/views/directives/attribute_description/_example.html +0 -13
  394. data/lib/api_browser/app/views/directives/attribute_description/_headers.html +0 -8
  395. data/lib/api_browser/app/views/directives/attribute_table_row/_default.html +0 -10
  396. data/lib/api_browser/app/views/directives/attribute_table_row/_links.html +0 -11
  397. data/lib/api_browser/app/views/directives/attribute_table_row/_struct.html +0 -2
  398. data/lib/api_browser/app/views/directives/request_body/_struct.html +0 -1
  399. data/lib/api_browser/app/views/resource/_actions.html +0 -27
@@ -1,133 +0,0 @@
1
- $(function () {
2
-
3
- module("popover")
4
-
5
- test("should provide no conflict", function () {
6
- var popover = $.fn.popover.noConflict()
7
- ok(!$.fn.popover, 'popover was set back to undefined (org value)')
8
- $.fn.popover = popover
9
- })
10
-
11
- test("should be defined on jquery object", function () {
12
- var div = $('<div></div>')
13
- ok(div.popover, 'popover method is defined')
14
- })
15
-
16
- test("should return element", function () {
17
- var div = $('<div></div>')
18
- ok(div.popover() == div, 'document.body returned')
19
- })
20
-
21
- test("should render popover element", function () {
22
- $.support.transition = false
23
- var popover = $('<a href="#" title="mdo" data-content="http://twitter.com/mdo">@mdo</a>')
24
- .appendTo('#qunit-fixture')
25
- .popover('show')
26
-
27
- ok($('.popover').length, 'popover was inserted')
28
- popover.popover('hide')
29
- ok(!$(".popover").length, 'popover removed')
30
- })
31
-
32
- test("should store popover instance in popover data object", function () {
33
- $.support.transition = false
34
- var popover = $('<a href="#" title="mdo" data-content="http://twitter.com/mdo">@mdo</a>')
35
- .popover()
36
-
37
- ok(!!popover.data('bs.popover'), 'popover instance exists')
38
- })
39
-
40
- test("should get title and content from options", function () {
41
- $.support.transition = false
42
- var popover = $('<a href="#">@fat</a>')
43
- .appendTo('#qunit-fixture')
44
- .popover({
45
- title: function () {
46
- return '@fat'
47
- }
48
- , content: function () {
49
- return 'loves writing tests (╯°□°)╯︵ ┻━┻'
50
- }
51
- })
52
-
53
- popover.popover('show')
54
-
55
- ok($('.popover').length, 'popover was inserted')
56
- equal($('.popover .popover-title').text(), '@fat', 'title correctly inserted')
57
- equal($('.popover .popover-content').text(), 'loves writing tests (╯°□°)╯︵ ┻━┻', 'content correctly inserted')
58
-
59
- popover.popover('hide')
60
- ok(!$('.popover').length, 'popover was removed')
61
- $('#qunit-fixture').empty()
62
- })
63
-
64
- test("should get title and content from attributes", function () {
65
- $.support.transition = false
66
- var popover = $('<a href="#" title="@mdo" data-content="loves data attributes (づ。◕‿‿◕。)づ ︵ ┻━┻" >@mdo</a>')
67
- .appendTo('#qunit-fixture')
68
- .popover()
69
- .popover('show')
70
-
71
- ok($('.popover').length, 'popover was inserted')
72
- equal($('.popover .popover-title').text(), '@mdo', 'title correctly inserted')
73
- equal($('.popover .popover-content').text(), "loves data attributes (づ。◕‿‿◕。)づ ︵ ┻━┻", 'content correctly inserted')
74
-
75
- popover.popover('hide')
76
- ok(!$('.popover').length, 'popover was removed')
77
- $('#qunit-fixture').empty()
78
- })
79
-
80
-
81
- test("should get title and content from attributes #2", function () {
82
- $.support.transition = false
83
- var popover = $('<a href="#" title="@mdo" data-content="loves data attributes (づ。◕‿‿◕。)づ ︵ ┻━┻" >@mdo</a>')
84
- .appendTo('#qunit-fixture')
85
- .popover({
86
- title: 'ignored title option',
87
- content: 'ignored content option'
88
- })
89
- .popover('show')
90
-
91
- ok($('.popover').length, 'popover was inserted')
92
- equal($('.popover .popover-title').text(), '@mdo', 'title correctly inserted')
93
- equal($('.popover .popover-content').text(), "loves data attributes (づ。◕‿‿◕。)づ ︵ ┻━┻", 'content correctly inserted')
94
-
95
- popover.popover('hide')
96
- ok(!$('.popover').length, 'popover was removed')
97
- $('#qunit-fixture').empty()
98
- })
99
-
100
- test("should respect custom classes", function() {
101
- $.support.transition = false
102
- var popover = $('<a href="#">@fat</a>')
103
- .appendTo('#qunit-fixture')
104
- .popover({
105
- title: 'Test'
106
- , content: 'Test'
107
- , template: '<div class="popover foobar"><div class="arrow"></div><div class="inner"><h3 class="title"></h3><div class="content"><p></p></div></div></div>'
108
- })
109
-
110
- popover.popover('show')
111
-
112
- ok($('.popover').length, 'popover was inserted')
113
- ok($('.popover').hasClass('foobar'), 'custom class is present')
114
-
115
- popover.popover('hide')
116
- ok(!$('.popover').length, 'popover was removed')
117
- $('#qunit-fixture').empty()
118
- })
119
-
120
- test("should destroy popover", function () {
121
- var popover = $('<div/>').popover({trigger: 'hover'}).on('click.foo', function(){})
122
- ok(popover.data('bs.popover'), 'popover has data')
123
- ok($._data(popover[0], 'events').mouseover && $._data(popover[0], 'events').mouseout, 'popover has hover event')
124
- ok($._data(popover[0], 'events').click[0].namespace == 'foo', 'popover has extra click.foo event')
125
- popover.popover('show')
126
- popover.popover('destroy')
127
- ok(!popover.hasClass('in'), 'popover is hidden')
128
- ok(!popover.data('popover'), 'popover does not have data')
129
- ok($._data(popover[0],'events').click[0].namespace == 'foo', 'popover still has click.foo')
130
- ok(!$._data(popover[0], 'events').mouseover && !$._data(popover[0], 'events').mouseout, 'popover does not have any events')
131
- })
132
-
133
- })
@@ -1,37 +0,0 @@
1
- $(function () {
2
-
3
- module("scrollspy")
4
-
5
- test("should provide no conflict", function () {
6
- var scrollspy = $.fn.scrollspy.noConflict()
7
- ok(!$.fn.scrollspy, 'scrollspy was set back to undefined (org value)')
8
- $.fn.scrollspy = scrollspy
9
- })
10
-
11
- test("should be defined on jquery object", function () {
12
- ok($(document.body).scrollspy, 'scrollspy method is defined')
13
- })
14
-
15
- test("should return element", function () {
16
- ok($(document.body).scrollspy()[0] == document.body, 'document.body returned')
17
- })
18
-
19
- test("should switch active class on scroll", function () {
20
- var sectionHTML = '<div id="masthead"></div>'
21
- , $section = $(sectionHTML).append('#qunit-fixture')
22
- , topbarHTML ='<div class="topbar">'
23
- + '<div class="topbar-inner">'
24
- + '<div class="container">'
25
- + '<h3><a href="#">Bootstrap</a></h3>'
26
- + '<ul class="nav">'
27
- + '<li><a href="#masthead">Overview</a></li>'
28
- + '</ul>'
29
- + '</div>'
30
- + '</div>'
31
- + '</div>'
32
- , $topbar = $(topbarHTML).scrollspy()
33
-
34
- ok($topbar.find('.active', true))
35
- })
36
-
37
- })
@@ -1,86 +0,0 @@
1
- $(function () {
2
-
3
- module("tabs")
4
-
5
- test("should provide no conflict", function () {
6
- var tab = $.fn.tab.noConflict()
7
- ok(!$.fn.tab, 'tab was set back to undefined (org value)')
8
- $.fn.tab = tab
9
- })
10
-
11
- test("should be defined on jquery object", function () {
12
- ok($(document.body).tab, 'tabs method is defined')
13
- })
14
-
15
- test("should return element", function () {
16
- ok($(document.body).tab()[0] == document.body, 'document.body returned')
17
- })
18
-
19
- test("should activate element by tab id", function () {
20
- var tabsHTML =
21
- '<ul class="tabs">'
22
- + '<li><a href="#home">Home</a></li>'
23
- + '<li><a href="#profile">Profile</a></li>'
24
- + '</ul>'
25
-
26
- $('<ul><li id="home"></li><li id="profile"></li></ul>').appendTo("#qunit-fixture")
27
-
28
- $(tabsHTML).find('li:last a').tab('show')
29
- equal($("#qunit-fixture").find('.active').attr('id'), "profile")
30
-
31
- $(tabsHTML).find('li:first a').tab('show')
32
- equal($("#qunit-fixture").find('.active').attr('id'), "home")
33
- })
34
-
35
- test("should activate element by tab id", function () {
36
- var pillsHTML =
37
- '<ul class="pills">'
38
- + '<li><a href="#home">Home</a></li>'
39
- + '<li><a href="#profile">Profile</a></li>'
40
- + '</ul>'
41
-
42
- $('<ul><li id="home"></li><li id="profile"></li></ul>').appendTo("#qunit-fixture")
43
-
44
- $(pillsHTML).find('li:last a').tab('show')
45
- equal($("#qunit-fixture").find('.active').attr('id'), "profile")
46
-
47
- $(pillsHTML).find('li:first a').tab('show')
48
- equal($("#qunit-fixture").find('.active').attr('id'), "home")
49
- })
50
-
51
-
52
- test("should not fire closed when close is prevented", function () {
53
- $.support.transition = false
54
- stop();
55
- $('<div class="tab"/>')
56
- .on('show.bs.tab', function (e) {
57
- e.preventDefault();
58
- ok(true);
59
- start();
60
- })
61
- .on('shown.bs.tab', function () {
62
- ok(false);
63
- })
64
- .tab('show')
65
- })
66
-
67
- test("show and shown events should reference correct relatedTarget", function () {
68
- var dropHTML =
69
- '<ul class="drop">'
70
- + '<li class="dropdown"><a data-toggle="dropdown" href="#">1</a>'
71
- + '<ul class="dropdown-menu">'
72
- + '<li><a href="#1-1" data-toggle="tab">1-1</a></li>'
73
- + '<li><a href="#1-2" data-toggle="tab">1-2</a></li>'
74
- + '</ul>'
75
- + '</li>'
76
- + '</ul>'
77
-
78
- $(dropHTML).find('ul>li:first a').tab('show').end()
79
- .find('ul>li:last a').on('show', function(event){
80
- equal(event.relatedTarget.hash, "#1-1")
81
- }).on('shown', function(event){
82
- equal(event.relatedTarget.hash, "#1-1")
83
- }).tab('show')
84
- })
85
-
86
- })
@@ -1,437 +0,0 @@
1
- $(function () {
2
-
3
- module("tooltip")
4
-
5
- test("should provide no conflict", function () {
6
- var tooltip = $.fn.tooltip.noConflict()
7
- ok(!$.fn.tooltip, 'tooltip was set back to undefined (org value)')
8
- $.fn.tooltip = tooltip
9
- })
10
-
11
- test("should be defined on jquery object", function () {
12
- var div = $("<div></div>")
13
- ok(div.tooltip, 'popover method is defined')
14
- })
15
-
16
- test("should return element", function () {
17
- var div = $("<div></div>")
18
- ok(div.tooltip() == div, 'document.body returned')
19
- })
20
-
21
- test("should expose default settings", function () {
22
- ok(!!$.fn.tooltip.Constructor.DEFAULTS, 'defaults is defined')
23
- })
24
-
25
- test("should empty title attribute", function () {
26
- var tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"></a>').tooltip()
27
- ok(tooltip.attr('title') === '', 'title attribute was emptied')
28
- })
29
-
30
- test("should add data attribute for referencing original title", function () {
31
- var tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"></a>').tooltip()
32
- equal(tooltip.attr('data-original-title'), 'Another tooltip', 'original title preserved in data attribute')
33
- })
34
-
35
- test("should place tooltips relative to placement option", function () {
36
- $.support.transition = false
37
- var tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"></a>')
38
- .appendTo('#qunit-fixture')
39
- .tooltip({placement: 'bottom'})
40
- .tooltip('show')
41
-
42
- ok($(".tooltip").is('.fade.bottom.in'), 'has correct classes applied')
43
- tooltip.tooltip('hide')
44
- })
45
-
46
- test("should allow html entities", function () {
47
- $.support.transition = false
48
- var tooltip = $('<a href="#" rel="tooltip" title="<b>@fat</b>"></a>')
49
- .appendTo('#qunit-fixture')
50
- .tooltip({html: true})
51
- .tooltip('show')
52
-
53
- ok($('.tooltip b').length, 'b tag was inserted')
54
- tooltip.tooltip('hide')
55
- ok(!$(".tooltip").length, 'tooltip removed')
56
- })
57
-
58
- test("should respect custom classes", function () {
59
- var tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"></a>')
60
- .appendTo('#qunit-fixture')
61
- .tooltip({ template: '<div class="tooltip some-class"><div class="tooltip-arrow"/><div class="tooltip-inner"/></div>'})
62
- .tooltip('show')
63
-
64
- ok($('.tooltip').hasClass('some-class'), 'custom class is present')
65
- tooltip.tooltip('hide')
66
- ok(!$(".tooltip").length, 'tooltip removed')
67
- })
68
-
69
- test("should fire show event", function () {
70
- stop()
71
- var tooltip = $('<div title="tooltip title"></div>')
72
- .on("show.bs.tooltip", function() {
73
- ok(true, "show was called")
74
- start()
75
- })
76
- .tooltip('show')
77
- })
78
-
79
- test("should fire shown event", function () {
80
- stop()
81
- var tooltip = $('<div title="tooltip title"></div>')
82
- .on("shown.bs.tooltip", function() {
83
- ok(true, "shown was called")
84
- start()
85
- })
86
- .tooltip('show')
87
- })
88
-
89
- test("should not fire shown event when default prevented", function () {
90
- stop()
91
- var tooltip = $('<div title="tooltip title"></div>')
92
- .on("show.bs.tooltip", function(e) {
93
- e.preventDefault()
94
- ok(true, "show was called")
95
- start()
96
- })
97
- .on("shown.bs.tooltip", function() {
98
- ok(false, "shown was called")
99
- })
100
- .tooltip('show')
101
- })
102
-
103
- test("should fire hide event", function () {
104
- stop()
105
- var tooltip = $('<div title="tooltip title"></div>')
106
- .on("shown.bs.tooltip", function() {
107
- $(this).tooltip('hide')
108
- })
109
- .on("hide.bs.tooltip", function() {
110
- ok(true, "hide was called")
111
- start()
112
- })
113
- .tooltip('show')
114
- })
115
-
116
- test("should fire hidden event", function () {
117
- stop()
118
- var tooltip = $('<div title="tooltip title"></div>')
119
- .on("shown.bs.tooltip", function() {
120
- $(this).tooltip('hide')
121
- })
122
- .on("hidden.bs.tooltip", function() {
123
- ok(true, "hidden was called")
124
- start()
125
- })
126
- .tooltip('show')
127
- })
128
-
129
- test("should not fire hidden event when default prevented", function () {
130
- stop()
131
- var tooltip = $('<div title="tooltip title"></div>')
132
- .on("shown.bs.tooltip", function() {
133
- $(this).tooltip('hide')
134
- })
135
- .on("hide.bs.tooltip", function(e) {
136
- e.preventDefault()
137
- ok(true, "hide was called")
138
- start()
139
- })
140
- .on("hidden.bs.tooltip", function() {
141
- ok(false, "hidden was called")
142
- })
143
- .tooltip('show')
144
- })
145
-
146
- test("should not show tooltip if leave event occurs before delay expires", function () {
147
- var tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"></a>')
148
- .appendTo('#qunit-fixture')
149
- .tooltip({ delay: 200 })
150
-
151
- stop()
152
-
153
- tooltip.trigger('mouseenter')
154
-
155
- setTimeout(function () {
156
- ok(!$(".tooltip").is('.fade.in'), 'tooltip is not faded in')
157
- tooltip.trigger('mouseout')
158
- setTimeout(function () {
159
- ok(!$(".tooltip").is('.fade.in'), 'tooltip is not faded in')
160
- start()
161
- }, 200)
162
- }, 100)
163
- })
164
-
165
- test("should not show tooltip if leave event occurs before delay expires, even if hide delay is 0", function () {
166
- var tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"></a>')
167
- .appendTo('#qunit-fixture')
168
- .tooltip({ delay: { show: 200, hide: 0} })
169
-
170
- stop()
171
-
172
- tooltip.trigger('mouseenter')
173
-
174
- setTimeout(function () {
175
- ok(!$(".tooltip").is('.fade.in'), 'tooltip is not faded in')
176
- tooltip.trigger('mouseout')
177
- setTimeout(function () {
178
- ok(!$(".tooltip").is('.fade.in'), 'tooltip is not faded in')
179
- start()
180
- }, 200)
181
- }, 100)
182
- })
183
-
184
- test("should wait 200 ms before hiding the tooltip", 3, function () {
185
- var tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"></a>')
186
- .appendTo('#qunit-fixture')
187
- .tooltip({ delay: { show: 0, hide: 200} })
188
-
189
- stop()
190
-
191
- tooltip.trigger('mouseenter')
192
-
193
- setTimeout(function () {
194
- ok($(".tooltip").is('.fade.in'), 'tooltip is faded in')
195
- tooltip.trigger('mouseout')
196
- setTimeout(function () {
197
- ok($(".tooltip").is('.fade.in'), '100ms:tooltip is still faded in')
198
- setTimeout(function () {
199
- ok(!$(".tooltip").is('.in'), 'tooltip removed')
200
- start()
201
- }, 150)
202
- }, 100)
203
- }, 1)
204
- })
205
-
206
- test("should not hide tooltip if leave event occurs, then tooltip is show immediately again", function () {
207
- var tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"></a>')
208
- .appendTo('#qunit-fixture')
209
- .tooltip({ delay: { show: 0, hide: 200} })
210
-
211
- stop()
212
-
213
- tooltip.trigger('mouseenter')
214
-
215
- setTimeout(function () {
216
- ok($(".tooltip").is('.fade.in'), 'tooltip is faded in')
217
- tooltip.trigger('mouseout')
218
- setTimeout(function () {
219
- ok($(".tooltip").is('.fade.in'), '100ms:tooltip is still faded in')
220
- tooltip.trigger('mouseenter')
221
- setTimeout(function () {
222
- ok($(".tooltip").is('.in'), 'tooltip removed')
223
- start()
224
- }, 150)
225
- }, 100)
226
- }, 1)
227
- })
228
-
229
- test("should not show tooltip if leave event occurs before delay expires", function () {
230
- var tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"></a>')
231
- .appendTo('#qunit-fixture')
232
- .tooltip({ delay: 100 })
233
- stop()
234
- tooltip.trigger('mouseenter')
235
- setTimeout(function () {
236
- ok(!$(".tooltip").is('.fade.in'), 'tooltip is not faded in')
237
- tooltip.trigger('mouseout')
238
- setTimeout(function () {
239
- ok(!$(".tooltip").is('.fade.in'), 'tooltip is not faded in')
240
- start()
241
- }, 100)
242
- }, 50)
243
- })
244
-
245
- test("should show tooltip if leave event hasn't occured before delay expires", function () {
246
- var tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"></a>')
247
- .appendTo('#qunit-fixture')
248
- .tooltip({ delay: 150 })
249
- stop()
250
- tooltip.trigger('mouseenter')
251
- setTimeout(function () {
252
- ok(!$(".tooltip").is('.fade.in'), 'tooltip is not faded in')
253
- }, 100)
254
- setTimeout(function () {
255
- ok($(".tooltip").is('.fade.in'), 'tooltip has faded in')
256
- start()
257
- }, 200)
258
- })
259
-
260
- test("should destroy tooltip", function () {
261
- var tooltip = $('<div/>').tooltip().on('click.foo', function(){})
262
- ok(tooltip.data('bs.tooltip'), 'tooltip has data')
263
- ok($._data(tooltip[0], 'events').mouseover && $._data(tooltip[0], 'events').mouseout, 'tooltip has hover event')
264
- ok($._data(tooltip[0], 'events').click[0].namespace == 'foo', 'tooltip has extra click.foo event')
265
- tooltip.tooltip('show')
266
- tooltip.tooltip('destroy')
267
- ok(!tooltip.hasClass('in'), 'tooltip is hidden')
268
- ok(!$._data(tooltip[0], 'bs.tooltip'), 'tooltip does not have data')
269
- ok($._data(tooltip[0], 'events').click[0].namespace == 'foo', 'tooltip still has click.foo')
270
- ok(!$._data(tooltip[0], 'events').mouseover && !$._data(tooltip[0], 'events').mouseout, 'tooltip does not have any events')
271
- })
272
-
273
- test("should show tooltip with delegate selector on click", function () {
274
- var div = $('<div><a href="#" rel="tooltip" title="Another tooltip"></a></div>')
275
- var tooltip = div.appendTo('#qunit-fixture')
276
- .tooltip({ selector: 'a[rel=tooltip]',
277
- trigger: 'click' })
278
- div.find('a').trigger('click')
279
- ok($(".tooltip").is('.fade.in'), 'tooltip is faded in')
280
- })
281
-
282
- test("should show tooltip when toggle is called", function () {
283
- var tooltip = $('<a href="#" rel="tooltip" title="tooltip on toggle"></a>')
284
- .appendTo('#qunit-fixture')
285
- .tooltip({trigger: 'manual'})
286
- .tooltip('toggle')
287
- ok($(".tooltip").is('.fade.in'), 'tooltip should be toggled in')
288
- })
289
-
290
- test("should place tooltips inside the body", function () {
291
- var tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"></a>')
292
- .appendTo('#qunit-fixture')
293
- .tooltip({container:'body'})
294
- .tooltip('show')
295
- ok($("body > .tooltip").length, 'inside the body')
296
- ok(!$("#qunit-fixture > .tooltip").length, 'not found in parent')
297
- tooltip.tooltip('hide')
298
- })
299
-
300
- test("should place tooltip inside window", function(){
301
- var container = $("<div />").appendTo("body")
302
- .css({position: "absolute", width: 200, height: 200, bottom: 0, left: 0})
303
- , tooltip = $("<a href='#' title='Very very very very very very very very long tooltip'>Hover me</a>")
304
- .css({position: "absolute", top:0, left: 0})
305
- .appendTo(container)
306
- .tooltip({placement: "top", animate: false})
307
- .tooltip("show")
308
-
309
- stop()
310
-
311
- setTimeout(function(){
312
- ok($(".tooltip").offset().left >= 0)
313
-
314
- start()
315
- container.remove()
316
- }, 100)
317
- })
318
-
319
- test("should place tooltip on top of element", function(){
320
- var container = $("<div />").appendTo("body")
321
- .css({position: "absolute", bottom: 0, left: 0, textAlign: "right", width: 300, height: 300})
322
- , p = $("<p style='margin-top:200px' />").appendTo(container)
323
- , tooltiped = $("<a href='#' title='very very very very very very very long tooltip'>Hover me</a>")
324
- .css({marginTop: 200})
325
- .appendTo(p)
326
- .tooltip({placement: "top", animate: false})
327
- .tooltip("show")
328
-
329
- stop()
330
-
331
- setTimeout(function(){
332
- var tooltip = container.find(".tooltip")
333
-
334
- start()
335
- ok(tooltip.offset().top + tooltip.outerHeight() <= tooltiped.offset().top)
336
- container.remove()
337
- }, 100)
338
- })
339
-
340
- test("should add position class before positioning so that position-specific styles are taken into account", function(){
341
- $("head").append('<style> .tooltip.right { white-space: nowrap; } .tooltip.right .tooltip-inner { max-width: none; } </style>')
342
-
343
- var container = $("<div />").appendTo("body")
344
- , target = $('<a href="#" rel="tooltip" title="very very very very very very very very long tooltip in one line"></a>')
345
- .appendTo(container)
346
- .tooltip({placement: 'right'})
347
- .tooltip('show')
348
- , tooltip = container.find(".tooltip")
349
-
350
- ok( Math.round(target.offset().top + target[0].offsetHeight/2 - tooltip[0].offsetHeight/2) === Math.round(tooltip.offset().top) )
351
- target.tooltip('hide')
352
- })
353
-
354
- test("tooltip title test #1", function () {
355
- var tooltip = $('<a href="#" rel="tooltip" title="Simple tooltip" style="display: inline-block; position: absolute; top: 0; left: 0;"></a>')
356
- .appendTo('#qunit-fixture')
357
- .tooltip({
358
- })
359
- .tooltip('show')
360
- equal($('.tooltip').children('.tooltip-inner').text(), 'Simple tooltip', 'title from title attribute is set')
361
- tooltip.tooltip('hide')
362
- ok(!$(".tooltip").length, 'tooltip removed')
363
- })
364
-
365
- test("tooltip title test #2", function () {
366
- var tooltip = $('<a href="#" rel="tooltip" title="Simple tooltip" style="display: inline-block; position: absolute; top: 0; left: 0;"></a>')
367
- .appendTo('#qunit-fixture')
368
- .tooltip({
369
- title: 'This is a tooltip with some content'
370
- })
371
- .tooltip('show')
372
- equal($('.tooltip').children('.tooltip-inner').text(), 'Simple tooltip', 'title is set from title attribute while prefered over title option')
373
- tooltip.tooltip('hide')
374
- ok(!$(".tooltip").length, 'tooltip removed')
375
- })
376
-
377
- test("tooltip title test #3", function () {
378
- var tooltip = $('<a href="#" rel="tooltip" style="display: inline-block; position: absolute; top: 0; left: 0;"></a>')
379
- .appendTo('#qunit-fixture')
380
- .tooltip({
381
- title: 'This is a tooltip with some content'
382
- })
383
- .tooltip('show')
384
- equal($('.tooltip').children('.tooltip-inner').text(), 'This is a tooltip with some content', 'title from title option is set')
385
- tooltip.tooltip('hide')
386
- ok(!$(".tooltip").length, 'tooltip removed')
387
- })
388
-
389
- test("tooltips should be placed dynamically, with the dynamic placement option", function () {
390
- $.support.transition = false
391
- var ttContainer = $('<div id="dynamic-tt-test"/>').css({
392
- 'height' : 400
393
- , 'overflow' : 'hidden'
394
- , 'position' : 'absolute'
395
- , 'top' : 0
396
- , 'left' : 0
397
- , 'width' : 600})
398
- .appendTo('body')
399
-
400
- var topTooltip = $('<div style="display: inline-block; position: absolute; left: 0; top: 0;" rel="tooltip" title="Top tooltip">Top Dynamic Tooltip</div>')
401
- .appendTo('#dynamic-tt-test')
402
- .tooltip({placement: 'auto'})
403
- .tooltip('show')
404
-
405
-
406
- ok($(".tooltip").is('.bottom'), 'top positioned tooltip is dynamically positioned bottom')
407
-
408
- topTooltip.tooltip('hide')
409
-
410
- var rightTooltip = $('<div style="display: inline-block; position: absolute; right: 0;" rel="tooltip" title="Right tooltip">Right Dynamic Tooltip</div>')
411
- .appendTo('#dynamic-tt-test')
412
- .tooltip({placement: 'right auto'})
413
- .tooltip('show')
414
-
415
- ok($(".tooltip").is('.left'), 'right positioned tooltip is dynamically positioned left')
416
- rightTooltip.tooltip('hide')
417
-
418
- var bottomTooltip = $('<div style="display: inline-block; position: absolute; bottom: 0;" rel="tooltip" title="Bottom tooltip">Bottom Dynamic Tooltip</div>')
419
- .appendTo('#dynamic-tt-test')
420
- .tooltip({placement: 'auto bottom'})
421
- .tooltip('show')
422
-
423
- ok($(".tooltip").is('.top'), 'bottom positioned tooltip is dynamically positioned top')
424
- bottomTooltip.tooltip('hide')
425
-
426
- var leftTooltip = $('<div style="display: inline-block; position: absolute; left: 0;" rel="tooltip" title="Left tooltip">Left Dynamic Tooltip</div>')
427
- .appendTo('#dynamic-tt-test')
428
- .tooltip({placement: 'auto left'})
429
- .tooltip('show')
430
-
431
- ok($(".tooltip").is('.right'), 'left positioned tooltip is dynamically positioned right')
432
- leftTooltip.tooltip('hide')
433
-
434
- ttContainer.remove()
435
- })
436
-
437
- })