sass-twitter-bootstrap 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +4 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +14 -0
- data/LICENSE +176 -0
- data/Makefile +94 -0
- data/README.md +217 -0
- data/Rakefile +52 -0
- data/bootstrap-2.0.4.css +4661 -0
- data/bootstrap-2.0.4.min.css +9 -0
- data/bootstrap-responsive-2.0.4.css +932 -0
- data/bootstrap-responsive-2.0.4.min.css +9 -0
- data/docs/assets/css/bootstrap-responsive.css +932 -0
- data/docs/assets/css/bootstrap.css +4661 -0
- data/docs/assets/css/docs.css +846 -0
- data/docs/assets/ico/apple-touch-icon-114-precomposed.png +0 -0
- data/docs/assets/ico/apple-touch-icon-144-precomposed.png +0 -0
- data/docs/assets/ico/apple-touch-icon-57-precomposed.png +0 -0
- data/docs/assets/ico/apple-touch-icon-72-precomposed.png +0 -0
- data/docs/assets/ico/favicon.ico +0 -0
- data/docs/assets/img/bird.png +0 -0
- data/docs/assets/img/bootstrap-mdo-sfmoma-01.jpg +0 -0
- data/docs/assets/img/bootstrap-mdo-sfmoma-02.jpg +0 -0
- data/docs/assets/img/bootstrap-mdo-sfmoma-03.jpg +0 -0
- data/docs/assets/img/browsers.png +0 -0
- data/docs/assets/img/example-sites/fleetio.png +0 -0
- data/docs/assets/img/example-sites/jshint.png +0 -0
- data/docs/assets/img/example-sites/kippt.png +0 -0
- data/docs/assets/img/example-sites/soundready.png +0 -0
- data/docs/assets/img/examples/bootstrap-example-fluid.jpg +0 -0
- data/docs/assets/img/examples/bootstrap-example-hero.jpg +0 -0
- data/docs/assets/img/examples/bootstrap-example-starter.jpg +0 -0
- data/docs/assets/img/github-16px.png +0 -0
- data/docs/assets/img/glyphicons-halflings-white.png +0 -0
- data/docs/assets/img/glyphicons-halflings.png +0 -0
- data/docs/assets/img/glyphicons/glyphicons_009_magic.png +0 -0
- data/docs/assets/img/glyphicons/glyphicons_042_group.png +0 -0
- data/docs/assets/img/glyphicons/glyphicons_079_podium.png +0 -0
- data/docs/assets/img/glyphicons/glyphicons_082_roundabout.png +0 -0
- data/docs/assets/img/glyphicons/glyphicons_155_show_thumbnails.png +0 -0
- data/docs/assets/img/glyphicons/glyphicons_163_iphone.png +0 -0
- data/docs/assets/img/glyphicons/glyphicons_214_resize_small.png +0 -0
- data/docs/assets/img/glyphicons/glyphicons_266_book_open.png +0 -0
- data/docs/assets/img/grid-18px-masked.png +0 -0
- data/docs/assets/img/icon-css3.png +0 -0
- data/docs/assets/img/icon-github.png +0 -0
- data/docs/assets/img/icon-html5.png +0 -0
- data/docs/assets/img/icon-twitter.png +0 -0
- data/docs/assets/img/less-logo-large.png +0 -0
- data/docs/assets/img/less-small.png +0 -0
- data/docs/assets/img/responsive-illustrations.png +0 -0
- data/docs/assets/js/README.md +106 -0
- data/docs/assets/js/application.js +184 -0
- data/docs/assets/js/bootstrap-alert.js +90 -0
- data/docs/assets/js/bootstrap-button.js +96 -0
- data/docs/assets/js/bootstrap-carousel.js +169 -0
- data/docs/assets/js/bootstrap-collapse.js +157 -0
- data/docs/assets/js/bootstrap-dropdown.js +100 -0
- data/docs/assets/js/bootstrap-modal.js +218 -0
- data/docs/assets/js/bootstrap-popover.js +98 -0
- data/docs/assets/js/bootstrap-scrollspy.js +151 -0
- data/docs/assets/js/bootstrap-tab.js +135 -0
- data/docs/assets/js/bootstrap-tooltip.js +275 -0
- data/docs/assets/js/bootstrap-transition.js +61 -0
- data/docs/assets/js/bootstrap-typeahead.js +285 -0
- data/docs/assets/js/bootstrap.js +1825 -0
- data/docs/assets/js/bootstrap.min.js +6 -0
- data/docs/assets/js/google-code-prettify/prettify.css +30 -0
- data/docs/assets/js/google-code-prettify/prettify.js +28 -0
- data/docs/assets/js/jquery.js +9252 -0
- data/docs/base-css.html +1710 -0
- data/docs/build/index.js +44 -0
- data/docs/build/node_modules/.bin/hulk +93 -0
- data/docs/build/node_modules/hogan.js/.git_ignore +1 -0
- data/docs/build/node_modules/hogan.js/.gitmodules +3 -0
- data/docs/build/node_modules/hogan.js/LICENSE +177 -0
- data/docs/build/node_modules/hogan.js/Makefile +62 -0
- data/docs/build/node_modules/hogan.js/README.md +93 -0
- data/docs/build/node_modules/hogan.js/bin/hulk +93 -0
- data/docs/build/node_modules/hogan.js/lib/compiler.js +348 -0
- data/docs/build/node_modules/hogan.js/lib/hogan.js +20 -0
- data/docs/build/node_modules/hogan.js/lib/template.js +233 -0
- data/docs/build/node_modules/hogan.js/package.json +20 -0
- data/docs/build/node_modules/hogan.js/test/html/list.html +8 -0
- data/docs/build/node_modules/hogan.js/test/index.html +13 -0
- data/docs/build/node_modules/hogan.js/test/index.js +848 -0
- data/docs/build/node_modules/hogan.js/test/mustache.js +90 -0
- data/docs/build/node_modules/hogan.js/test/spec.js +77 -0
- data/docs/build/node_modules/hogan.js/test/spec/Changes +31 -0
- data/docs/build/node_modules/hogan.js/test/spec/README.md +65 -0
- data/docs/build/node_modules/hogan.js/test/spec/Rakefile +27 -0
- data/docs/build/node_modules/hogan.js/test/spec/TESTING.md +46 -0
- data/docs/build/node_modules/hogan.js/test/spec/specs/comments.json +1 -0
- data/docs/build/node_modules/hogan.js/test/spec/specs/comments.yml +103 -0
- data/docs/build/node_modules/hogan.js/test/spec/specs/delimiters.json +1 -0
- data/docs/build/node_modules/hogan.js/test/spec/specs/delimiters.yml +158 -0
- data/docs/build/node_modules/hogan.js/test/spec/specs/interpolation.json +1 -0
- data/docs/build/node_modules/hogan.js/test/spec/specs/interpolation.yml +230 -0
- data/docs/build/node_modules/hogan.js/test/spec/specs/inverted.json +1 -0
- data/docs/build/node_modules/hogan.js/test/spec/specs/inverted.yml +193 -0
- data/docs/build/node_modules/hogan.js/test/spec/specs/partials.json +1 -0
- data/docs/build/node_modules/hogan.js/test/spec/specs/partials.yml +109 -0
- data/docs/build/node_modules/hogan.js/test/spec/specs/sections.json +1 -0
- data/docs/build/node_modules/hogan.js/test/spec/specs/sections.yml +256 -0
- data/docs/build/node_modules/hogan.js/test/spec/specs/~lambdas.json +1 -0
- data/docs/build/node_modules/hogan.js/test/spec/specs/~lambdas.yml +149 -0
- data/docs/build/node_modules/hogan.js/test/templates/list.mustache +8 -0
- data/docs/build/node_modules/hogan.js/tools/release.js +74 -0
- data/docs/build/node_modules/hogan.js/tools/web_templates.js +32 -0
- data/docs/build/node_modules/hogan.js/web/1.0.0/hogan.js +500 -0
- data/docs/build/node_modules/hogan.js/web/1.0.0/hogan.min.js +14 -0
- data/docs/build/node_modules/hogan.js/web/builds/1.0.0/hogan.js +500 -0
- data/docs/build/node_modules/hogan.js/web/builds/1.0.0/hogan.min.js +14 -0
- data/docs/build/node_modules/hogan.js/web/builds/1.0.3/hogan.js +545 -0
- data/docs/build/node_modules/hogan.js/web/builds/1.0.3/hogan.min.js +5 -0
- data/docs/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.amd.js +576 -0
- data/docs/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.common.js +576 -0
- data/docs/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.js +572 -0
- data/docs/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.min.amd.js +5 -0
- data/docs/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.min.common.js +5 -0
- data/docs/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.min.js +5 -0
- data/docs/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.min.mustache.js +5 -0
- data/docs/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.mustache.js +619 -0
- data/docs/build/node_modules/hogan.js/web/builds/1.0.5/template-1.0.5.js +233 -0
- data/docs/build/node_modules/hogan.js/web/builds/1.0.5/template-1.0.5.min.js +5 -0
- data/docs/build/node_modules/hogan.js/web/favicon.ico +0 -0
- data/docs/build/node_modules/hogan.js/web/images/logo.png +0 -0
- data/docs/build/node_modules/hogan.js/web/images/noise.png +0 -0
- data/docs/build/node_modules/hogan.js/web/images/small-hogan-icon.png +0 -0
- data/docs/build/node_modules/hogan.js/web/images/stripes.png +0 -0
- data/docs/build/node_modules/hogan.js/web/index.html.mustache +139 -0
- data/docs/build/node_modules/hogan.js/web/stylesheets/layout.css +206 -0
- data/docs/build/node_modules/hogan.js/web/stylesheets/skeleton.css +236 -0
- data/docs/build/node_modules/hogan.js/wrappers/amd.js.mustache +21 -0
- data/docs/build/node_modules/hogan.js/wrappers/common.js.mustache +21 -0
- data/docs/build/node_modules/hogan.js/wrappers/js.mustache +17 -0
- data/docs/build/node_modules/hogan.js/wrappers/mustache.js.mustache +64 -0
- data/docs/build/package.json +6 -0
- data/docs/components.html +1931 -0
- data/docs/download.html +454 -0
- data/docs/examples.html +147 -0
- data/docs/examples/fluid.html +162 -0
- data/docs/examples/hero.html +109 -0
- data/docs/examples/starter-template.html +79 -0
- data/docs/index.html +259 -0
- data/docs/javascript.html +1520 -0
- data/docs/less.html +1060 -0
- data/docs/scaffolding.html +671 -0
- data/docs/templates/layout.mustache +146 -0
- data/docs/templates/pages/base-css.mustache +1594 -0
- data/docs/templates/pages/components.mustache +1815 -0
- data/docs/templates/pages/download.mustache +338 -0
- data/docs/templates/pages/examples.mustache +31 -0
- data/docs/templates/pages/index.mustache +144 -0
- data/docs/templates/pages/javascript.mustache +1405 -0
- data/docs/templates/pages/less.mustache +944 -0
- data/docs/templates/pages/scaffolding.mustache +555 -0
- data/docs/templates/pages/upgrading.mustache +194 -0
- data/docs/upgrading.html +310 -0
- data/js/tests/index.html +54 -0
- data/js/tests/phantom.js +63 -0
- data/js/tests/server.js +14 -0
- data/js/tests/unit/bootstrap-alert.js +56 -0
- data/js/tests/unit/bootstrap-button.js +77 -0
- data/js/tests/unit/bootstrap-carousel.js +28 -0
- data/js/tests/unit/bootstrap-collapse.js +54 -0
- data/js/tests/unit/bootstrap-dropdown.js +87 -0
- data/js/tests/unit/bootstrap-modal.js +114 -0
- data/js/tests/unit/bootstrap-phantom.js +21 -0
- data/js/tests/unit/bootstrap-popover.js +93 -0
- data/js/tests/unit/bootstrap-scrollspy.js +31 -0
- data/js/tests/unit/bootstrap-tab.js +61 -0
- data/js/tests/unit/bootstrap-tooltip.js +155 -0
- data/js/tests/unit/bootstrap-transition.js +13 -0
- data/js/tests/unit/bootstrap-typeahead.js +148 -0
- data/js/tests/vendor/jquery.js +9252 -0
- data/js/tests/vendor/qunit.css +232 -0
- data/js/tests/vendor/qunit.js +1510 -0
- data/lib/sass-twitter-bootstrap.rb +9 -0
- data/lib/sass/twitter/bootstrap/rails.rb +14 -0
- data/lib/sass/twitter/bootstrap/version.rb +7 -0
- data/package.json +25 -0
- data/sass-twitter-bootstrap.gemspec +19 -0
- data/vendor/assets/images/glyphicons-halflings-white.png +0 -0
- data/vendor/assets/images/glyphicons-halflings.png +0 -0
- data/vendor/assets/javascripts/README.md +112 -0
- data/vendor/assets/javascripts/twitter/bootstrap-alert.js +90 -0
- data/vendor/assets/javascripts/twitter/bootstrap-button.js +96 -0
- data/vendor/assets/javascripts/twitter/bootstrap-carousel.js +169 -0
- data/vendor/assets/javascripts/twitter/bootstrap-collapse.js +157 -0
- data/vendor/assets/javascripts/twitter/bootstrap-dropdown.js +100 -0
- data/vendor/assets/javascripts/twitter/bootstrap-modal.js +218 -0
- data/vendor/assets/javascripts/twitter/bootstrap-popover.js +98 -0
- data/vendor/assets/javascripts/twitter/bootstrap-scrollspy.js +151 -0
- data/vendor/assets/javascripts/twitter/bootstrap-tab.js +135 -0
- data/vendor/assets/javascripts/twitter/bootstrap-tooltip.js +275 -0
- data/vendor/assets/javascripts/twitter/bootstrap-transition.js +61 -0
- data/vendor/assets/javascripts/twitter/bootstrap-typeahead.js +285 -0
- data/vendor/assets/javascripts/twitter/bootstrap.js +12 -0
- data/vendor/assets/stylesheets/tests/css-tests.css +52 -0
- data/vendor/assets/stylesheets/tests/css-tests.html +917 -0
- data/vendor/assets/stylesheets/tests/forms.html +179 -0
- data/vendor/assets/stylesheets/tests/navbar.html +108 -0
- data/vendor/assets/stylesheets/twitter/_accordion.scss +33 -0
- data/vendor/assets/stylesheets/twitter/_alerts.scss +58 -0
- data/vendor/assets/stylesheets/twitter/_breadcrumbs.scss +24 -0
- data/vendor/assets/stylesheets/twitter/_button-groups.scss +191 -0
- data/vendor/assets/stylesheets/twitter/_buttons.scss +191 -0
- data/vendor/assets/stylesheets/twitter/_carousel.scss +121 -0
- data/vendor/assets/stylesheets/twitter/_close.scss +29 -0
- data/vendor/assets/stylesheets/twitter/_code.scss +57 -0
- data/vendor/assets/stylesheets/twitter/_component-animations.scss +20 -0
- data/vendor/assets/stylesheets/twitter/_dropdowns.scss +143 -0
- data/vendor/assets/stylesheets/twitter/_forms.scss +582 -0
- data/vendor/assets/stylesheets/twitter/_grid.scss +5 -0
- data/vendor/assets/stylesheets/twitter/_hero-unit.scss +22 -0
- data/vendor/assets/stylesheets/twitter/_labels-badges.scss +52 -0
- data/vendor/assets/stylesheets/twitter/_layouts.scss +17 -0
- data/vendor/assets/stylesheets/twitter/_mixins.scss +643 -0
- data/vendor/assets/stylesheets/twitter/_modals.scss +90 -0
- data/vendor/assets/stylesheets/twitter/_navbar.scss +358 -0
- data/vendor/assets/stylesheets/twitter/_navs.scss +363 -0
- data/vendor/assets/stylesheets/twitter/_pager.scss +36 -0
- data/vendor/assets/stylesheets/twitter/_pagination.scss +56 -0
- data/vendor/assets/stylesheets/twitter/_popovers.scss +49 -0
- data/vendor/assets/stylesheets/twitter/_progress-bars.scss +117 -0
- data/vendor/assets/stylesheets/twitter/_reset.scss +131 -0
- data/vendor/assets/stylesheets/twitter/_responsive-1200px-min.scss +26 -0
- data/vendor/assets/stylesheets/twitter/_responsive-767px-max.scss +149 -0
- data/vendor/assets/stylesheets/twitter/_responsive-768px-979px.scss +17 -0
- data/vendor/assets/stylesheets/twitter/_responsive-navbar.scss +153 -0
- data/vendor/assets/stylesheets/twitter/_responsive-utilities.scss +41 -0
- data/vendor/assets/stylesheets/twitter/_scaffolding.scss +29 -0
- data/vendor/assets/stylesheets/twitter/_sprites.scss +191 -0
- data/vendor/assets/stylesheets/twitter/_tables.scss +155 -0
- data/vendor/assets/stylesheets/twitter/_thumbnails.scss +47 -0
- data/vendor/assets/stylesheets/twitter/_tooltip.scss +35 -0
- data/vendor/assets/stylesheets/twitter/_type.scss +232 -0
- data/vendor/assets/stylesheets/twitter/_utilities.scss +23 -0
- data/vendor/assets/stylesheets/twitter/_variables.scss +204 -0
- data/vendor/assets/stylesheets/twitter/_wells.scss +27 -0
- data/vendor/assets/stylesheets/twitter/bootstrap.scss +62 -0
- data/vendor/assets/stylesheets/twitter/responsive.scss +48 -0
- 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: &lt;foo&gt;", function () {
|
136
|
+
ok(!$.fn.tooltip.Constructor.prototype.isHTML('<foo>'), 'correctly detected html')
|
137
|
+
})
|
138
|
+
|
139
|
+
test("should detect if title string is html or text: <div>foo</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<div>foo</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: $('<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
|
+
})
|