sass-twitter-bootstrap 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (243) hide show
  1. data/.gitignore +4 -0
  2. data/Gemfile +3 -0
  3. data/Gemfile.lock +14 -0
  4. data/LICENSE +176 -0
  5. data/Makefile +94 -0
  6. data/README.md +217 -0
  7. data/Rakefile +52 -0
  8. data/bootstrap-2.0.4.css +4661 -0
  9. data/bootstrap-2.0.4.min.css +9 -0
  10. data/bootstrap-responsive-2.0.4.css +932 -0
  11. data/bootstrap-responsive-2.0.4.min.css +9 -0
  12. data/docs/assets/css/bootstrap-responsive.css +932 -0
  13. data/docs/assets/css/bootstrap.css +4661 -0
  14. data/docs/assets/css/docs.css +846 -0
  15. data/docs/assets/ico/apple-touch-icon-114-precomposed.png +0 -0
  16. data/docs/assets/ico/apple-touch-icon-144-precomposed.png +0 -0
  17. data/docs/assets/ico/apple-touch-icon-57-precomposed.png +0 -0
  18. data/docs/assets/ico/apple-touch-icon-72-precomposed.png +0 -0
  19. data/docs/assets/ico/favicon.ico +0 -0
  20. data/docs/assets/img/bird.png +0 -0
  21. data/docs/assets/img/bootstrap-mdo-sfmoma-01.jpg +0 -0
  22. data/docs/assets/img/bootstrap-mdo-sfmoma-02.jpg +0 -0
  23. data/docs/assets/img/bootstrap-mdo-sfmoma-03.jpg +0 -0
  24. data/docs/assets/img/browsers.png +0 -0
  25. data/docs/assets/img/example-sites/fleetio.png +0 -0
  26. data/docs/assets/img/example-sites/jshint.png +0 -0
  27. data/docs/assets/img/example-sites/kippt.png +0 -0
  28. data/docs/assets/img/example-sites/soundready.png +0 -0
  29. data/docs/assets/img/examples/bootstrap-example-fluid.jpg +0 -0
  30. data/docs/assets/img/examples/bootstrap-example-hero.jpg +0 -0
  31. data/docs/assets/img/examples/bootstrap-example-starter.jpg +0 -0
  32. data/docs/assets/img/github-16px.png +0 -0
  33. data/docs/assets/img/glyphicons-halflings-white.png +0 -0
  34. data/docs/assets/img/glyphicons-halflings.png +0 -0
  35. data/docs/assets/img/glyphicons/glyphicons_009_magic.png +0 -0
  36. data/docs/assets/img/glyphicons/glyphicons_042_group.png +0 -0
  37. data/docs/assets/img/glyphicons/glyphicons_079_podium.png +0 -0
  38. data/docs/assets/img/glyphicons/glyphicons_082_roundabout.png +0 -0
  39. data/docs/assets/img/glyphicons/glyphicons_155_show_thumbnails.png +0 -0
  40. data/docs/assets/img/glyphicons/glyphicons_163_iphone.png +0 -0
  41. data/docs/assets/img/glyphicons/glyphicons_214_resize_small.png +0 -0
  42. data/docs/assets/img/glyphicons/glyphicons_266_book_open.png +0 -0
  43. data/docs/assets/img/grid-18px-masked.png +0 -0
  44. data/docs/assets/img/icon-css3.png +0 -0
  45. data/docs/assets/img/icon-github.png +0 -0
  46. data/docs/assets/img/icon-html5.png +0 -0
  47. data/docs/assets/img/icon-twitter.png +0 -0
  48. data/docs/assets/img/less-logo-large.png +0 -0
  49. data/docs/assets/img/less-small.png +0 -0
  50. data/docs/assets/img/responsive-illustrations.png +0 -0
  51. data/docs/assets/js/README.md +106 -0
  52. data/docs/assets/js/application.js +184 -0
  53. data/docs/assets/js/bootstrap-alert.js +90 -0
  54. data/docs/assets/js/bootstrap-button.js +96 -0
  55. data/docs/assets/js/bootstrap-carousel.js +169 -0
  56. data/docs/assets/js/bootstrap-collapse.js +157 -0
  57. data/docs/assets/js/bootstrap-dropdown.js +100 -0
  58. data/docs/assets/js/bootstrap-modal.js +218 -0
  59. data/docs/assets/js/bootstrap-popover.js +98 -0
  60. data/docs/assets/js/bootstrap-scrollspy.js +151 -0
  61. data/docs/assets/js/bootstrap-tab.js +135 -0
  62. data/docs/assets/js/bootstrap-tooltip.js +275 -0
  63. data/docs/assets/js/bootstrap-transition.js +61 -0
  64. data/docs/assets/js/bootstrap-typeahead.js +285 -0
  65. data/docs/assets/js/bootstrap.js +1825 -0
  66. data/docs/assets/js/bootstrap.min.js +6 -0
  67. data/docs/assets/js/google-code-prettify/prettify.css +30 -0
  68. data/docs/assets/js/google-code-prettify/prettify.js +28 -0
  69. data/docs/assets/js/jquery.js +9252 -0
  70. data/docs/base-css.html +1710 -0
  71. data/docs/build/index.js +44 -0
  72. data/docs/build/node_modules/.bin/hulk +93 -0
  73. data/docs/build/node_modules/hogan.js/.git_ignore +1 -0
  74. data/docs/build/node_modules/hogan.js/.gitmodules +3 -0
  75. data/docs/build/node_modules/hogan.js/LICENSE +177 -0
  76. data/docs/build/node_modules/hogan.js/Makefile +62 -0
  77. data/docs/build/node_modules/hogan.js/README.md +93 -0
  78. data/docs/build/node_modules/hogan.js/bin/hulk +93 -0
  79. data/docs/build/node_modules/hogan.js/lib/compiler.js +348 -0
  80. data/docs/build/node_modules/hogan.js/lib/hogan.js +20 -0
  81. data/docs/build/node_modules/hogan.js/lib/template.js +233 -0
  82. data/docs/build/node_modules/hogan.js/package.json +20 -0
  83. data/docs/build/node_modules/hogan.js/test/html/list.html +8 -0
  84. data/docs/build/node_modules/hogan.js/test/index.html +13 -0
  85. data/docs/build/node_modules/hogan.js/test/index.js +848 -0
  86. data/docs/build/node_modules/hogan.js/test/mustache.js +90 -0
  87. data/docs/build/node_modules/hogan.js/test/spec.js +77 -0
  88. data/docs/build/node_modules/hogan.js/test/spec/Changes +31 -0
  89. data/docs/build/node_modules/hogan.js/test/spec/README.md +65 -0
  90. data/docs/build/node_modules/hogan.js/test/spec/Rakefile +27 -0
  91. data/docs/build/node_modules/hogan.js/test/spec/TESTING.md +46 -0
  92. data/docs/build/node_modules/hogan.js/test/spec/specs/comments.json +1 -0
  93. data/docs/build/node_modules/hogan.js/test/spec/specs/comments.yml +103 -0
  94. data/docs/build/node_modules/hogan.js/test/spec/specs/delimiters.json +1 -0
  95. data/docs/build/node_modules/hogan.js/test/spec/specs/delimiters.yml +158 -0
  96. data/docs/build/node_modules/hogan.js/test/spec/specs/interpolation.json +1 -0
  97. data/docs/build/node_modules/hogan.js/test/spec/specs/interpolation.yml +230 -0
  98. data/docs/build/node_modules/hogan.js/test/spec/specs/inverted.json +1 -0
  99. data/docs/build/node_modules/hogan.js/test/spec/specs/inverted.yml +193 -0
  100. data/docs/build/node_modules/hogan.js/test/spec/specs/partials.json +1 -0
  101. data/docs/build/node_modules/hogan.js/test/spec/specs/partials.yml +109 -0
  102. data/docs/build/node_modules/hogan.js/test/spec/specs/sections.json +1 -0
  103. data/docs/build/node_modules/hogan.js/test/spec/specs/sections.yml +256 -0
  104. data/docs/build/node_modules/hogan.js/test/spec/specs/~lambdas.json +1 -0
  105. data/docs/build/node_modules/hogan.js/test/spec/specs/~lambdas.yml +149 -0
  106. data/docs/build/node_modules/hogan.js/test/templates/list.mustache +8 -0
  107. data/docs/build/node_modules/hogan.js/tools/release.js +74 -0
  108. data/docs/build/node_modules/hogan.js/tools/web_templates.js +32 -0
  109. data/docs/build/node_modules/hogan.js/web/1.0.0/hogan.js +500 -0
  110. data/docs/build/node_modules/hogan.js/web/1.0.0/hogan.min.js +14 -0
  111. data/docs/build/node_modules/hogan.js/web/builds/1.0.0/hogan.js +500 -0
  112. data/docs/build/node_modules/hogan.js/web/builds/1.0.0/hogan.min.js +14 -0
  113. data/docs/build/node_modules/hogan.js/web/builds/1.0.3/hogan.js +545 -0
  114. data/docs/build/node_modules/hogan.js/web/builds/1.0.3/hogan.min.js +5 -0
  115. data/docs/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.amd.js +576 -0
  116. data/docs/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.common.js +576 -0
  117. data/docs/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.js +572 -0
  118. data/docs/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.min.amd.js +5 -0
  119. data/docs/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.min.common.js +5 -0
  120. data/docs/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.min.js +5 -0
  121. data/docs/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.min.mustache.js +5 -0
  122. data/docs/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.mustache.js +619 -0
  123. data/docs/build/node_modules/hogan.js/web/builds/1.0.5/template-1.0.5.js +233 -0
  124. data/docs/build/node_modules/hogan.js/web/builds/1.0.5/template-1.0.5.min.js +5 -0
  125. data/docs/build/node_modules/hogan.js/web/favicon.ico +0 -0
  126. data/docs/build/node_modules/hogan.js/web/images/logo.png +0 -0
  127. data/docs/build/node_modules/hogan.js/web/images/noise.png +0 -0
  128. data/docs/build/node_modules/hogan.js/web/images/small-hogan-icon.png +0 -0
  129. data/docs/build/node_modules/hogan.js/web/images/stripes.png +0 -0
  130. data/docs/build/node_modules/hogan.js/web/index.html.mustache +139 -0
  131. data/docs/build/node_modules/hogan.js/web/stylesheets/layout.css +206 -0
  132. data/docs/build/node_modules/hogan.js/web/stylesheets/skeleton.css +236 -0
  133. data/docs/build/node_modules/hogan.js/wrappers/amd.js.mustache +21 -0
  134. data/docs/build/node_modules/hogan.js/wrappers/common.js.mustache +21 -0
  135. data/docs/build/node_modules/hogan.js/wrappers/js.mustache +17 -0
  136. data/docs/build/node_modules/hogan.js/wrappers/mustache.js.mustache +64 -0
  137. data/docs/build/package.json +6 -0
  138. data/docs/components.html +1931 -0
  139. data/docs/download.html +454 -0
  140. data/docs/examples.html +147 -0
  141. data/docs/examples/fluid.html +162 -0
  142. data/docs/examples/hero.html +109 -0
  143. data/docs/examples/starter-template.html +79 -0
  144. data/docs/index.html +259 -0
  145. data/docs/javascript.html +1520 -0
  146. data/docs/less.html +1060 -0
  147. data/docs/scaffolding.html +671 -0
  148. data/docs/templates/layout.mustache +146 -0
  149. data/docs/templates/pages/base-css.mustache +1594 -0
  150. data/docs/templates/pages/components.mustache +1815 -0
  151. data/docs/templates/pages/download.mustache +338 -0
  152. data/docs/templates/pages/examples.mustache +31 -0
  153. data/docs/templates/pages/index.mustache +144 -0
  154. data/docs/templates/pages/javascript.mustache +1405 -0
  155. data/docs/templates/pages/less.mustache +944 -0
  156. data/docs/templates/pages/scaffolding.mustache +555 -0
  157. data/docs/templates/pages/upgrading.mustache +194 -0
  158. data/docs/upgrading.html +310 -0
  159. data/js/tests/index.html +54 -0
  160. data/js/tests/phantom.js +63 -0
  161. data/js/tests/server.js +14 -0
  162. data/js/tests/unit/bootstrap-alert.js +56 -0
  163. data/js/tests/unit/bootstrap-button.js +77 -0
  164. data/js/tests/unit/bootstrap-carousel.js +28 -0
  165. data/js/tests/unit/bootstrap-collapse.js +54 -0
  166. data/js/tests/unit/bootstrap-dropdown.js +87 -0
  167. data/js/tests/unit/bootstrap-modal.js +114 -0
  168. data/js/tests/unit/bootstrap-phantom.js +21 -0
  169. data/js/tests/unit/bootstrap-popover.js +93 -0
  170. data/js/tests/unit/bootstrap-scrollspy.js +31 -0
  171. data/js/tests/unit/bootstrap-tab.js +61 -0
  172. data/js/tests/unit/bootstrap-tooltip.js +155 -0
  173. data/js/tests/unit/bootstrap-transition.js +13 -0
  174. data/js/tests/unit/bootstrap-typeahead.js +148 -0
  175. data/js/tests/vendor/jquery.js +9252 -0
  176. data/js/tests/vendor/qunit.css +232 -0
  177. data/js/tests/vendor/qunit.js +1510 -0
  178. data/lib/sass-twitter-bootstrap.rb +9 -0
  179. data/lib/sass/twitter/bootstrap/rails.rb +14 -0
  180. data/lib/sass/twitter/bootstrap/version.rb +7 -0
  181. data/package.json +25 -0
  182. data/sass-twitter-bootstrap.gemspec +19 -0
  183. data/vendor/assets/images/glyphicons-halflings-white.png +0 -0
  184. data/vendor/assets/images/glyphicons-halflings.png +0 -0
  185. data/vendor/assets/javascripts/README.md +112 -0
  186. data/vendor/assets/javascripts/twitter/bootstrap-alert.js +90 -0
  187. data/vendor/assets/javascripts/twitter/bootstrap-button.js +96 -0
  188. data/vendor/assets/javascripts/twitter/bootstrap-carousel.js +169 -0
  189. data/vendor/assets/javascripts/twitter/bootstrap-collapse.js +157 -0
  190. data/vendor/assets/javascripts/twitter/bootstrap-dropdown.js +100 -0
  191. data/vendor/assets/javascripts/twitter/bootstrap-modal.js +218 -0
  192. data/vendor/assets/javascripts/twitter/bootstrap-popover.js +98 -0
  193. data/vendor/assets/javascripts/twitter/bootstrap-scrollspy.js +151 -0
  194. data/vendor/assets/javascripts/twitter/bootstrap-tab.js +135 -0
  195. data/vendor/assets/javascripts/twitter/bootstrap-tooltip.js +275 -0
  196. data/vendor/assets/javascripts/twitter/bootstrap-transition.js +61 -0
  197. data/vendor/assets/javascripts/twitter/bootstrap-typeahead.js +285 -0
  198. data/vendor/assets/javascripts/twitter/bootstrap.js +12 -0
  199. data/vendor/assets/stylesheets/tests/css-tests.css +52 -0
  200. data/vendor/assets/stylesheets/tests/css-tests.html +917 -0
  201. data/vendor/assets/stylesheets/tests/forms.html +179 -0
  202. data/vendor/assets/stylesheets/tests/navbar.html +108 -0
  203. data/vendor/assets/stylesheets/twitter/_accordion.scss +33 -0
  204. data/vendor/assets/stylesheets/twitter/_alerts.scss +58 -0
  205. data/vendor/assets/stylesheets/twitter/_breadcrumbs.scss +24 -0
  206. data/vendor/assets/stylesheets/twitter/_button-groups.scss +191 -0
  207. data/vendor/assets/stylesheets/twitter/_buttons.scss +191 -0
  208. data/vendor/assets/stylesheets/twitter/_carousel.scss +121 -0
  209. data/vendor/assets/stylesheets/twitter/_close.scss +29 -0
  210. data/vendor/assets/stylesheets/twitter/_code.scss +57 -0
  211. data/vendor/assets/stylesheets/twitter/_component-animations.scss +20 -0
  212. data/vendor/assets/stylesheets/twitter/_dropdowns.scss +143 -0
  213. data/vendor/assets/stylesheets/twitter/_forms.scss +582 -0
  214. data/vendor/assets/stylesheets/twitter/_grid.scss +5 -0
  215. data/vendor/assets/stylesheets/twitter/_hero-unit.scss +22 -0
  216. data/vendor/assets/stylesheets/twitter/_labels-badges.scss +52 -0
  217. data/vendor/assets/stylesheets/twitter/_layouts.scss +17 -0
  218. data/vendor/assets/stylesheets/twitter/_mixins.scss +643 -0
  219. data/vendor/assets/stylesheets/twitter/_modals.scss +90 -0
  220. data/vendor/assets/stylesheets/twitter/_navbar.scss +358 -0
  221. data/vendor/assets/stylesheets/twitter/_navs.scss +363 -0
  222. data/vendor/assets/stylesheets/twitter/_pager.scss +36 -0
  223. data/vendor/assets/stylesheets/twitter/_pagination.scss +56 -0
  224. data/vendor/assets/stylesheets/twitter/_popovers.scss +49 -0
  225. data/vendor/assets/stylesheets/twitter/_progress-bars.scss +117 -0
  226. data/vendor/assets/stylesheets/twitter/_reset.scss +131 -0
  227. data/vendor/assets/stylesheets/twitter/_responsive-1200px-min.scss +26 -0
  228. data/vendor/assets/stylesheets/twitter/_responsive-767px-max.scss +149 -0
  229. data/vendor/assets/stylesheets/twitter/_responsive-768px-979px.scss +17 -0
  230. data/vendor/assets/stylesheets/twitter/_responsive-navbar.scss +153 -0
  231. data/vendor/assets/stylesheets/twitter/_responsive-utilities.scss +41 -0
  232. data/vendor/assets/stylesheets/twitter/_scaffolding.scss +29 -0
  233. data/vendor/assets/stylesheets/twitter/_sprites.scss +191 -0
  234. data/vendor/assets/stylesheets/twitter/_tables.scss +155 -0
  235. data/vendor/assets/stylesheets/twitter/_thumbnails.scss +47 -0
  236. data/vendor/assets/stylesheets/twitter/_tooltip.scss +35 -0
  237. data/vendor/assets/stylesheets/twitter/_type.scss +232 -0
  238. data/vendor/assets/stylesheets/twitter/_utilities.scss +23 -0
  239. data/vendor/assets/stylesheets/twitter/_variables.scss +204 -0
  240. data/vendor/assets/stylesheets/twitter/_wells.scss +27 -0
  241. data/vendor/assets/stylesheets/twitter/bootstrap.scss +62 -0
  242. data/vendor/assets/stylesheets/twitter/responsive.scss +48 -0
  243. metadata +304 -0
@@ -0,0 +1,21 @@
1
+ // Logging setup for phantom integration
2
+ // adapted from Modernizr
3
+
4
+ QUnit.begin = function () {
5
+ console.log("Starting test suite")
6
+ console.log("================================================\n")
7
+ }
8
+
9
+ QUnit.moduleDone = function (opts) {
10
+ if (opts.failed === 0) {
11
+ console.log("\u2714 All tests passed in '" + opts.name + "' module")
12
+ } else {
13
+ console.log("\u2716 " + opts.failed + " tests failed in '" + opts.name + "' module")
14
+ }
15
+ }
16
+
17
+ QUnit.done = function (opts) {
18
+ console.log("\n================================================")
19
+ console.log("Tests completed in " + opts.runtime + " milliseconds")
20
+ console.log(opts.passed + " tests of " + opts.total + " passed, " + opts.failed + " failed.")
21
+ }
@@ -0,0 +1,93 @@
1
+ $(function () {
2
+
3
+ module("bootstrap-popover")
4
+
5
+ test("should be defined on jquery object", function () {
6
+ var div = $('<div></div>')
7
+ ok(div.popover, 'popover method is defined')
8
+ })
9
+
10
+ test("should return element", function () {
11
+ var div = $('<div></div>')
12
+ ok(div.popover() == div, 'document.body returned')
13
+ })
14
+
15
+ test("should render popover element", function () {
16
+ $.support.transition = false
17
+ var popover = $('<a href="#" title="mdo" data-content="http://twitter.com/mdo">@mdo</a>')
18
+ .appendTo('#qunit-fixture')
19
+ .popover('show')
20
+
21
+ ok($('.popover').length, 'popover was inserted')
22
+ popover.popover('hide')
23
+ ok(!$(".popover").length, 'popover removed')
24
+ })
25
+
26
+ test("should store popover instance in popover data object", function () {
27
+ $.support.transition = false
28
+ var popover = $('<a href="#" title="mdo" data-content="http://twitter.com/mdo">@mdo</a>')
29
+ .popover()
30
+
31
+ ok(!!popover.data('popover'), 'popover instance exists')
32
+ })
33
+
34
+ test("should get title and content from options", function () {
35
+ $.support.transition = false
36
+ var popover = $('<a href="#">@fat</a>')
37
+ .appendTo('#qunit-fixture')
38
+ .popover({
39
+ title: function () {
40
+ return '@fat'
41
+ }
42
+ , content: function () {
43
+ return 'loves writing tests (╯°□°)╯︵ ┻━┻'
44
+ }
45
+ })
46
+
47
+ popover.popover('show')
48
+
49
+ ok($('.popover').length, 'popover was inserted')
50
+ equals($('.popover .popover-title').text(), '@fat', 'title correctly inserted')
51
+ equals($('.popover .popover-content').text(), 'loves writing tests (╯°□°)╯︵ ┻━┻', 'content correctly inserted')
52
+
53
+ popover.popover('hide')
54
+ ok(!$('.popover').length, 'popover was removed')
55
+ $('#qunit-fixture').empty()
56
+ })
57
+
58
+ test("should get title and content from attributes", function () {
59
+ $.support.transition = false
60
+ var popover = $('<a href="#" title="@mdo" data-content="loves data attributes (づ。◕‿‿◕。)づ ︵ ┻━┻" >@mdo</a>')
61
+ .appendTo('#qunit-fixture')
62
+ .popover()
63
+ .popover('show')
64
+
65
+ ok($('.popover').length, 'popover was inserted')
66
+ equals($('.popover .popover-title').text(), '@mdo', 'title correctly inserted')
67
+ equals($('.popover .popover-content').text(), "loves data attributes (づ。◕‿‿◕。)づ ︵ ┻━┻", 'content correctly inserted')
68
+
69
+ popover.popover('hide')
70
+ ok(!$('.popover').length, 'popover was removed')
71
+ $('#qunit-fixture').empty()
72
+ })
73
+
74
+ test("should respect custom classes", function() {
75
+ $.support.transition = false
76
+ var popover = $('<a href="#">@fat</a>')
77
+ .appendTo('#qunit-fixture')
78
+ .popover({
79
+ title: 'Test'
80
+ , content: 'Test'
81
+ , template: '<div class="popover foobar"><div class="arrow"></div><div class="inner"><h3 class="title"></h3><div class="content"><p></p></div></div></div>'
82
+ })
83
+
84
+ popover.popover('show')
85
+
86
+ ok($('.popover').length, 'popover was inserted')
87
+ ok($('.popover').hasClass('foobar'), 'custom class is present')
88
+
89
+ popover.popover('hide')
90
+ ok(!$('.popover').length, 'popover was removed')
91
+ $('#qunit-fixture').empty()
92
+ })
93
+ })
@@ -0,0 +1,31 @@
1
+ $(function () {
2
+
3
+ module("bootstrap-scrollspy")
4
+
5
+ test("should be defined on jquery object", function () {
6
+ ok($(document.body).scrollspy, 'scrollspy method is defined')
7
+ })
8
+
9
+ test("should return element", function () {
10
+ ok($(document.body).scrollspy()[0] == document.body, 'document.body returned')
11
+ })
12
+
13
+ test("should switch active class on scroll", function () {
14
+ var sectionHTML = '<div id="masthead"></div>'
15
+ , $section = $(sectionHTML).append('#qunit-fixture')
16
+ , topbarHTML ='<div class="topbar">'
17
+ + '<div class="topbar-inner">'
18
+ + '<div class="container">'
19
+ + '<h3><a href="#">Bootstrap</a></h3>'
20
+ + '<ul class="nav">'
21
+ + '<li><a href="#masthead">Overview</a></li>'
22
+ + '</ul>'
23
+ + '</div>'
24
+ + '</div>'
25
+ + '</div>'
26
+ , $topbar = $(topbarHTML).scrollspy()
27
+
28
+ ok($topbar.find('.active', true))
29
+ })
30
+
31
+ })
@@ -0,0 +1,61 @@
1
+ $(function () {
2
+
3
+ module("bootstrap-tabs")
4
+
5
+ test("should be defined on jquery object", function () {
6
+ ok($(document.body).tab, 'tabs method is defined')
7
+ })
8
+
9
+ test("should return element", function () {
10
+ ok($(document.body).tab()[0] == document.body, 'document.body returned')
11
+ })
12
+
13
+ test("should activate element by tab id", function () {
14
+ var tabsHTML =
15
+ '<ul class="tabs">'
16
+ + '<li><a href="#home">Home</a></li>'
17
+ + '<li><a href="#profile">Profile</a></li>'
18
+ + '</ul>'
19
+
20
+ $('<ul><li id="home"></li><li id="profile"></li></ul>').appendTo("#qunit-fixture")
21
+
22
+ $(tabsHTML).find('li:last a').tab('show')
23
+ equals($("#qunit-fixture").find('.active').attr('id'), "profile")
24
+
25
+ $(tabsHTML).find('li:first a').tab('show')
26
+ equals($("#qunit-fixture").find('.active').attr('id'), "home")
27
+ })
28
+
29
+ test("should activate element by tab id", function () {
30
+ var pillsHTML =
31
+ '<ul class="pills">'
32
+ + '<li><a href="#home">Home</a></li>'
33
+ + '<li><a href="#profile">Profile</a></li>'
34
+ + '</ul>'
35
+
36
+ $('<ul><li id="home"></li><li id="profile"></li></ul>').appendTo("#qunit-fixture")
37
+
38
+ $(pillsHTML).find('li:last a').tab('show')
39
+ equals($("#qunit-fixture").find('.active').attr('id'), "profile")
40
+
41
+ $(pillsHTML).find('li:first a').tab('show')
42
+ equals($("#qunit-fixture").find('.active').attr('id'), "home")
43
+ })
44
+
45
+
46
+ test("should not fire closed when close is prevented", function () {
47
+ $.support.transition = false
48
+ stop();
49
+ $('<div class="tab"/>')
50
+ .bind('show', function (e) {
51
+ e.preventDefault();
52
+ ok(true);
53
+ start();
54
+ })
55
+ .bind('shown', function () {
56
+ ok(false);
57
+ })
58
+ .tab('show')
59
+ })
60
+
61
+ })
@@ -0,0 +1,155 @@
1
+ $(function () {
2
+
3
+ module("bootstrap-tooltip")
4
+
5
+ test("should be defined on jquery object", function () {
6
+ var div = $("<div></div>")
7
+ ok(div.tooltip, 'popover method is defined')
8
+ })
9
+
10
+ test("should return element", function () {
11
+ var div = $("<div></div>")
12
+ ok(div.tooltip() == div, 'document.body returned')
13
+ })
14
+
15
+ test("should expose default settings", function () {
16
+ ok(!!$.fn.tooltip.defaults, 'defaults is defined')
17
+ })
18
+
19
+ test("should remove title attribute", function () {
20
+ var tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"></a>').tooltip()
21
+ ok(!tooltip.attr('title'), 'title tag was removed')
22
+ })
23
+
24
+ test("should add data attribute for referencing original title", function () {
25
+ var tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"></a>').tooltip()
26
+ equals(tooltip.attr('data-original-title'), 'Another tooltip', 'original title preserved in data attribute')
27
+ })
28
+
29
+ test("should place tooltips relative to placement option", function () {
30
+ $.support.transition = false
31
+ var tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"></a>')
32
+ .appendTo('#qunit-fixture')
33
+ .tooltip({placement: 'bottom'})
34
+ .tooltip('show')
35
+
36
+ ok($(".tooltip").is('.fade.bottom.in'), 'has correct classes applied')
37
+ tooltip.tooltip('hide')
38
+ })
39
+
40
+ test("should always allow html entities", function () {
41
+ $.support.transition = false
42
+ var tooltip = $('<a href="#" rel="tooltip" title="<b>@fat</b>"></a>')
43
+ .appendTo('#qunit-fixture')
44
+ .tooltip('show')
45
+
46
+ ok($('.tooltip b').length, 'b tag was inserted')
47
+ tooltip.tooltip('hide')
48
+ ok(!$(".tooltip").length, 'tooltip removed')
49
+ })
50
+
51
+ test("should respect custom classes", function () {
52
+ var tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"></a>')
53
+ .appendTo('#qunit-fixture')
54
+ .tooltip({ template: '<div class="tooltip some-class"><div class="tooltip-arrow"/><div class="tooltip-inner"/></div>'})
55
+ .tooltip('show')
56
+
57
+ ok($('.tooltip').hasClass('some-class'), 'custom class is present')
58
+ tooltip.tooltip('hide')
59
+ ok(!$(".tooltip").length, 'tooltip removed')
60
+ })
61
+
62
+ test("should not show tooltip if leave event occurs before delay expires", function () {
63
+ var tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"></a>')
64
+ .appendTo('#qunit-fixture')
65
+ .tooltip({ delay: 200 })
66
+
67
+ stop()
68
+
69
+ tooltip.trigger('mouseenter')
70
+
71
+ setTimeout(function () {
72
+ ok(!$(".tooltip").is('.fade.in'), 'tooltip is not faded in')
73
+ tooltip.trigger('mouseout')
74
+ setTimeout(function () {
75
+ ok(!$(".tooltip").is('.fade.in'), 'tooltip is not faded in')
76
+ start()
77
+ }, 200)
78
+ }, 100)
79
+ })
80
+
81
+ test("should not show tooltip if leave event occurs before delay expires, even if hide delay is 0", function () {
82
+ var tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"></a>')
83
+ .appendTo('#qunit-fixture')
84
+ .tooltip({ delay: { show: 200, hide: 0} })
85
+
86
+ stop()
87
+
88
+ tooltip.trigger('mouseenter')
89
+
90
+ setTimeout(function () {
91
+ ok(!$(".tooltip").is('.fade.in'), 'tooltip is not faded in')
92
+ tooltip.trigger('mouseout')
93
+ setTimeout(function () {
94
+ ok(!$(".tooltip").is('.fade.in'), 'tooltip is not faded in')
95
+ start()
96
+ }, 200)
97
+ }, 100)
98
+ })
99
+
100
+ test("should not show tooltip if leave event occurs before delay expires", function () {
101
+ var tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"></a>')
102
+ .appendTo('#qunit-fixture')
103
+ .tooltip({ delay: 100 })
104
+ stop()
105
+ tooltip.trigger('mouseenter')
106
+ setTimeout(function () {
107
+ ok(!$(".tooltip").is('.fade.in'), 'tooltip is not faded in')
108
+ tooltip.trigger('mouseout')
109
+ setTimeout(function () {
110
+ ok(!$(".tooltip").is('.fade.in'), 'tooltip is not faded in')
111
+ start()
112
+ }, 100)
113
+ }, 50)
114
+ })
115
+
116
+ test("should show tooltip if leave event hasn't occured before delay expires", function () {
117
+ var tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"></a>')
118
+ .appendTo('#qunit-fixture')
119
+ .tooltip({ delay: 150 })
120
+ stop()
121
+ tooltip.trigger('mouseenter')
122
+ setTimeout(function () {
123
+ ok(!$(".tooltip").is('.fade.in'), 'tooltip is not faded in')
124
+ }, 100)
125
+ setTimeout(function () {
126
+ ok($(".tooltip").is('.fade.in'), 'tooltip has faded in')
127
+ start()
128
+ }, 200)
129
+ })
130
+
131
+ test("should detect if title string is html or text: foo", function () {
132
+ ok(!$.fn.tooltip.Constructor.prototype.isHTML('foo'), 'correctly detected html')
133
+ })
134
+
135
+ test("should detect if title string is html or text: &amp;lt;foo&amp;gt;", function () {
136
+ ok(!$.fn.tooltip.Constructor.prototype.isHTML('&lt;foo&gt;'), 'correctly detected html')
137
+ })
138
+
139
+ test("should detect if title string is html or text: &lt;div>foo&lt;/div>", function () {
140
+ ok($.fn.tooltip.Constructor.prototype.isHTML('<div>foo</div>'), 'correctly detected html')
141
+ })
142
+
143
+ test("should detect if title string is html or text: asdfa&lt;div>foo&lt;/div>asdfasdf", function () {
144
+ ok($.fn.tooltip.Constructor.prototype.isHTML('asdfa<div>foo</div>asdfasdf'), 'correctly detected html')
145
+ })
146
+
147
+ test("should detect if title string is html or text: document.createElement('div')", function () {
148
+ ok($.fn.tooltip.Constructor.prototype.isHTML(document.createElement('div')), 'correctly detected html')
149
+ })
150
+
151
+ test("should detect if title string is html or text: $('&lt;div />)", function () {
152
+ ok($.fn.tooltip.Constructor.prototype.isHTML($('<div></div>')), 'correctly detected html')
153
+ })
154
+
155
+ })
@@ -0,0 +1,13 @@
1
+ $(function () {
2
+
3
+ module("bootstrap-transition")
4
+
5
+ test("should be defined on jquery support object", function () {
6
+ ok($.support.transition !== undefined, 'transition object is defined')
7
+ })
8
+
9
+ test("should provide an end object", function () {
10
+ ok($.support.transition ? $.support.transition.end : true, 'end string is defined')
11
+ })
12
+
13
+ })
@@ -0,0 +1,148 @@
1
+ $(function () {
2
+
3
+ module("bootstrap-typeahead")
4
+
5
+ test("should be defined on jquery object", function () {
6
+ ok($(document.body).typeahead, 'alert method is defined')
7
+ })
8
+
9
+ test("should return element", function () {
10
+ ok($(document.body).typeahead()[0] == document.body, 'document.body returned')
11
+ })
12
+
13
+ test("should listen to an input", function () {
14
+ var $input = $('<input />')
15
+ $input.typeahead()
16
+ ok($input.data('events').blur, 'has a blur event')
17
+ ok($input.data('events').keypress, 'has a keypress event')
18
+ ok($input.data('events').keyup, 'has a keyup event')
19
+ if ($.browser.webkit || $.browser.msie) {
20
+ ok($input.data('events').keydown, 'has a keydown event')
21
+ } else {
22
+ ok($input.data('events').keydown, 'does not have a keydown event')
23
+ }
24
+ })
25
+
26
+ test("should create a menu", function () {
27
+ var $input = $('<input />')
28
+ ok($input.typeahead().data('typeahead').$menu, 'has a menu')
29
+ })
30
+
31
+ test("should listen to the menu", function () {
32
+ var $input = $('<input />')
33
+ , $menu = $input.typeahead().data('typeahead').$menu
34
+
35
+ ok($menu.data('events').mouseover, 'has a mouseover(pseudo: mouseenter)')
36
+ ok($menu.data('events').click, 'has a click')
37
+ })
38
+
39
+ test("should show menu when query entered", function () {
40
+ var $input = $('<input />').typeahead({
41
+ source: ['aa', 'ab', 'ac']
42
+ })
43
+ , typeahead = $input.data('typeahead')
44
+
45
+ $input.val('a')
46
+ typeahead.lookup()
47
+
48
+ ok(typeahead.$menu.is(":visible"), 'typeahead is visible')
49
+ equals(typeahead.$menu.find('li').length, 3, 'has 3 items in menu')
50
+ equals(typeahead.$menu.find('.active').length, 1, 'one item is active')
51
+
52
+ typeahead.$menu.remove()
53
+ })
54
+
55
+ test("should not explode when regex chars are entered", function () {
56
+ var $input = $('<input />').typeahead({
57
+ source: ['aa', 'ab', 'ac', 'mdo*', 'fat+']
58
+ })
59
+ , typeahead = $input.data('typeahead')
60
+
61
+ $input.val('+')
62
+ typeahead.lookup()
63
+
64
+ ok(typeahead.$menu.is(":visible"), 'typeahead is visible')
65
+ equals(typeahead.$menu.find('li').length, 1, 'has 1 item in menu')
66
+ equals(typeahead.$menu.find('.active').length, 1, 'one item is active')
67
+
68
+ typeahead.$menu.remove()
69
+ })
70
+
71
+ test("should hide menu when query entered", function () {
72
+ stop()
73
+ var $input = $('<input />').typeahead({
74
+ source: ['aa', 'ab', 'ac']
75
+ })
76
+ , typeahead = $input.data('typeahead')
77
+
78
+ $input.val('a')
79
+ typeahead.lookup()
80
+
81
+ ok(typeahead.$menu.is(":visible"), 'typeahead is visible')
82
+ equals(typeahead.$menu.find('li').length, 3, 'has 3 items in menu')
83
+ equals(typeahead.$menu.find('.active').length, 1, 'one item is active')
84
+
85
+ $input.blur()
86
+
87
+ setTimeout(function () {
88
+ ok(!typeahead.$menu.is(":visible"), "typeahead is no longer visible")
89
+ start()
90
+ }, 200)
91
+
92
+ typeahead.$menu.remove()
93
+ })
94
+
95
+ test("should set next item when down arrow is pressed", function () {
96
+ var $input = $('<input />').typeahead({
97
+ source: ['aa', 'ab', 'ac']
98
+ })
99
+ , typeahead = $input.data('typeahead')
100
+
101
+ $input.val('a')
102
+ typeahead.lookup()
103
+
104
+ ok(typeahead.$menu.is(":visible"), 'typeahead is visible')
105
+ equals(typeahead.$menu.find('li').length, 3, 'has 3 items in menu')
106
+ equals(typeahead.$menu.find('.active').length, 1, 'one item is active')
107
+ ok(typeahead.$menu.find('li').first().hasClass('active'), "first item is active")
108
+
109
+ $input.trigger({
110
+ type: 'keydown'
111
+ , keyCode: 40
112
+ })
113
+
114
+ ok(typeahead.$menu.find('li').first().next().hasClass('active'), "second item is active")
115
+
116
+
117
+ $input.trigger({
118
+ type: 'keydown'
119
+ , keyCode: 38
120
+ })
121
+
122
+ ok(typeahead.$menu.find('li').first().hasClass('active'), "first item is active")
123
+
124
+ typeahead.$menu.remove()
125
+ })
126
+
127
+
128
+ test("should set input value to selected item", function () {
129
+ var $input = $('<input />').typeahead({
130
+ source: ['aa', 'ab', 'ac']
131
+ })
132
+ , typeahead = $input.data('typeahead')
133
+ , changed = false
134
+
135
+ $input.val('a')
136
+ typeahead.lookup()
137
+
138
+ $input.change(function() { changed = true });
139
+
140
+ $(typeahead.$menu.find('li')[2]).mouseover().click()
141
+
142
+ equals($input.val(), 'ac', 'input value was correctly set')
143
+ ok(!typeahead.$menu.is(':visible'), 'the menu was hidden')
144
+ ok(changed, 'a change event was fired')
145
+
146
+ typeahead.$menu.remove()
147
+ })
148
+ })