.
9 |
10 | .list-group {
11 | // No need to set list-style: none; since .list-group-item is block level
12 | margin-bottom: 20px;
13 | padding-left: 0; // reset padding because ul and ol
14 | }
15 |
16 |
17 | // Individual list items
18 | //
19 | // Use on `li`s or `div`s within the `.list-group` parent.
20 |
21 | .list-group-item {
22 | position: relative;
23 | display: block;
24 | padding: 10px 15px;
25 | // Place the border on the list items and negative margin up for better styling
26 | margin-bottom: -1px;
27 | background-color: @list-group-bg;
28 | border: 1px solid @list-group-border;
29 |
30 | // Round the first and last items
31 | &:first-child {
32 | .border-top-radius(@list-group-border-radius);
33 | }
34 | &:last-child {
35 | margin-bottom: 0;
36 | .border-bottom-radius(@list-group-border-radius);
37 | }
38 |
39 | // Align badges within list items
40 | > .badge {
41 | float: right;
42 | }
43 | > .badge + .badge {
44 | margin-right: 5px;
45 | }
46 | }
47 |
48 |
49 | // Linked list items
50 | //
51 | // Use anchor elements instead of `li`s or `div`s to create linked list items.
52 | // Includes an extra `.active` modifier class for showing selected items.
53 |
54 | a.list-group-item {
55 | color: @list-group-link-color;
56 |
57 | .list-group-item-heading {
58 | color: @list-group-link-heading-color;
59 | }
60 |
61 | // Hover state
62 | &:hover,
63 | &:focus {
64 | text-decoration: none;
65 | background-color: @list-group-hover-bg;
66 | }
67 |
68 | // Active class on item itself, not parent
69 | &.active,
70 | &.active:hover,
71 | &.active:focus {
72 | z-index: 2; // Place active items above their siblings for proper border styling
73 | color: @list-group-active-color;
74 | background-color: @list-group-active-bg;
75 | border-color: @list-group-active-border;
76 |
77 | // Force color to inherit for custom content
78 | .list-group-item-heading {
79 | color: inherit;
80 | }
81 | .list-group-item-text {
82 | color: @list-group-active-text-color;
83 | }
84 | }
85 | }
86 |
87 |
88 | // Contextual variants
89 | //
90 | // Add modifier classes to change text and background color on individual items.
91 | // Organizationally, this must come after the `:hover` states.
92 |
93 | .list-group-item-variant(success; @state-success-bg; @state-success-text);
94 | .list-group-item-variant(warning; @state-warning-bg; @state-warning-text);
95 | .list-group-item-variant(danger; @state-danger-bg; @state-danger-text);
96 | .list-group-item-variant(info; @state-info-bg; @state-info-text);
97 |
98 |
99 | // Custom content options
100 | //
101 | // Extra classes for creating well-formatted content within `.list-group-item`s.
102 |
103 | .list-group-item-heading {
104 | margin-top: 0;
105 | margin-bottom: 5px;
106 | }
107 | .list-group-item-text {
108 | margin-bottom: 0;
109 | line-height: 1.3;
110 | }
111 |
--------------------------------------------------------------------------------
/docs/assets/css/pygments-manni.css:
--------------------------------------------------------------------------------
1 | .hll { background-color: #ffffcc }
2 | /*{ background: #f0f3f3; }*/
3 | .c { color: #999; } /* Comment */
4 | .err { color: #AA0000; background-color: #FFAAAA } /* Error */
5 | .k { color: #006699; } /* Keyword */
6 | .o { color: #555555 } /* Operator */
7 | .cm { color: #0099FF; font-style: italic } /* Comment.Multiline */
8 | .cp { color: #009999 } /* Comment.Preproc */
9 | .c1 { color: #999; } /* Comment.Single */
10 | .cs { color: #999; } /* Comment.Special */
11 | .gd { background-color: #FFCCCC; border: 1px solid #CC0000 } /* Generic.Deleted */
12 | .ge { font-style: italic } /* Generic.Emph */
13 | .gr { color: #FF0000 } /* Generic.Error */
14 | .gh { color: #003300; } /* Generic.Heading */
15 | .gi { background-color: #CCFFCC; border: 1px solid #00CC00 } /* Generic.Inserted */
16 | .go { color: #AAAAAA } /* Generic.Output */
17 | .gp { color: #000099; } /* Generic.Prompt */
18 | .gs { } /* Generic.Strong */
19 | .gu { color: #003300; } /* Generic.Subheading */
20 | .gt { color: #99CC66 } /* Generic.Traceback */
21 | .kc { color: #006699; } /* Keyword.Constant */
22 | .kd { color: #006699; } /* Keyword.Declaration */
23 | .kn { color: #006699; } /* Keyword.Namespace */
24 | .kp { color: #006699 } /* Keyword.Pseudo */
25 | .kr { color: #006699; } /* Keyword.Reserved */
26 | .kt { color: #007788; } /* Keyword.Type */
27 | .m { color: #FF6600 } /* Literal.Number */
28 | .s { color: #d44950 } /* Literal.String */
29 | .na { color: #4f9fcf } /* Name.Attribute */
30 | .nb { color: #336666 } /* Name.Builtin */
31 | .nc { color: #00AA88; } /* Name.Class */
32 | .no { color: #336600 } /* Name.Constant */
33 | .nd { color: #9999FF } /* Name.Decorator */
34 | .ni { color: #999999; } /* Name.Entity */
35 | .ne { color: #CC0000; } /* Name.Exception */
36 | .nf { color: #CC00FF } /* Name.Function */
37 | .nl { color: #9999FF } /* Name.Label */
38 | .nn { color: #00CCFF; } /* Name.Namespace */
39 | .nt { color: #2f6f9f; } /* Name.Tag */
40 | .nv { color: #003333 } /* Name.Variable */
41 | .ow { color: #000000; } /* Operator.Word */
42 | .w { color: #bbbbbb } /* Text.Whitespace */
43 | .mf { color: #FF6600 } /* Literal.Number.Float */
44 | .mh { color: #FF6600 } /* Literal.Number.Hex */
45 | .mi { color: #FF6600 } /* Literal.Number.Integer */
46 | .mo { color: #FF6600 } /* Literal.Number.Oct */
47 | .sb { color: #CC3300 } /* Literal.String.Backtick */
48 | .sc { color: #CC3300 } /* Literal.String.Char */
49 | .sd { color: #CC3300; font-style: italic } /* Literal.String.Doc */
50 | .s2 { color: #CC3300 } /* Literal.String.Double */
51 | .se { color: #CC3300; } /* Literal.String.Escape */
52 | .sh { color: #CC3300 } /* Literal.String.Heredoc */
53 | .si { color: #AA0000 } /* Literal.String.Interpol */
54 | .sx { color: #CC3300 } /* Literal.String.Other */
55 | .sr { color: #33AAAA } /* Literal.String.Regex */
56 | .s1 { color: #CC3300 } /* Literal.String.Single */
57 | .ss { color: #FFCC33 } /* Literal.String.Symbol */
58 | .bp { color: #336666 } /* Name.Builtin.Pseudo */
59 | .vc { color: #003333 } /* Name.Variable.Class */
60 | .vg { color: #003333 } /* Name.Variable.Global */
61 | .vi { color: #003333 } /* Name.Variable.Instance */
62 | .il { color: #FF6600 } /* Literal.Number.Integer.Long */
63 |
64 | .css .o,
65 | .css .o + .nt,
66 | .css .nt + .nt { color: #999; }
67 |
--------------------------------------------------------------------------------
/docs/examples/blog/blog.css:
--------------------------------------------------------------------------------
1 | /*
2 | * Globals
3 | */
4 |
5 | body {
6 | font-family: Georgia, "Times New Roman", Times, serif;
7 | color: #555;
8 | }
9 |
10 | h1, .h1,
11 | h2, .h2,
12 | h3, .h3,
13 | h4, .h4,
14 | h5, .h5,
15 | h6, .h6 {
16 | font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;;
17 | font-weight: normal;
18 | color: #333;
19 | margin-top: 0;
20 | }
21 |
22 |
23 | /*
24 | * Override Bootstrap's default container.
25 | */
26 |
27 | @media (min-width: 1200px) {
28 | .container {
29 | width: 970px;
30 | }
31 | }
32 |
33 |
34 | /*
35 | * Masthead for nav
36 | */
37 |
38 | .blog-masthead {
39 | background-color: #428bca;
40 | box-shadow: inset 0 -2px 5px rgba(0,0,0,.1);
41 | }
42 |
43 | /* Nav links */
44 | .blog-nav {
45 |
46 | }
47 | .blog-nav-item {
48 | position: relative;
49 | display: inline-block;
50 | padding: 10px;
51 | font-weight: 500;
52 | color: #cdddeb;
53 | }
54 | .blog-nav-item:hover,
55 | .blog-nav-item:focus {
56 | color: #fff;
57 | text-decoration: none;
58 | }
59 |
60 | /* Active state gets a caret at the bottom */
61 | .blog-nav .active {
62 | color: #fff;
63 | }
64 | .blog-nav .active:after {
65 | position: absolute;
66 | bottom: 0;
67 | left: 50%;
68 | display: block;
69 | content: " ";
70 | width: 0;
71 | height: 0;
72 | margin-left: -5px;
73 | vertical-align: middle;
74 | border-right: 5px solid transparent;
75 | border-left: 5px solid transparent;
76 | border-bottom: 5px solid;
77 | }
78 |
79 |
80 | /*
81 | * Blog name and description
82 | */
83 |
84 | .blog-header {
85 | padding-top: 20px;
86 | padding-bottom: 20px;
87 | }
88 | .blog-title {
89 | margin-top: 30px;
90 | margin-bottom: 0;
91 | font-size: 60px;
92 | font-weight: normal;
93 | }
94 | .blog-description {
95 | font-size: 20px;
96 | color: #999;
97 | }
98 |
99 |
100 | /*
101 | * Main column and sidebar layout
102 | */
103 |
104 | .blog-main {
105 | font-size: 18px;
106 | line-height: 1.5;
107 | }
108 |
109 | /* Sidebar modules for boxing content */
110 | .sidebar-module {
111 | padding: 15px;
112 | margin: 0 -15px 15px;
113 | }
114 | .sidebar-module-inset {
115 | padding: 15px;
116 | background-color: #f5f5f5;
117 | border-radius: 4px;
118 | }
119 | .sidebar-module-inset p:last-child,
120 | .sidebar-module-inset ul:last-child,
121 | .sidebar-module-inset ol:last-child {
122 | margin-bottom: 0;
123 | }
124 |
125 |
126 |
127 | /* Pagination */
128 | .pager {
129 | margin-bottom: 60px;
130 | text-align: left;
131 | }
132 | .pager > li > a {
133 | width: 140px;
134 | padding: 10px 20px;
135 | text-align: center;
136 | border-radius: 30px;
137 | }
138 |
139 |
140 | /*
141 | * Blog posts
142 | */
143 |
144 | .blog-post {
145 | margin-bottom: 60px;
146 | }
147 | .blog-post-title {
148 | margin-bottom: 5px;
149 | font-size: 40px;
150 | }
151 | .blog-post-meta {
152 | margin-bottom: 20px;
153 | color: #999;
154 | }
155 |
156 |
157 | /*
158 | * Footer
159 | */
160 |
161 | .blog-footer {
162 | padding: 40px 0;
163 | color: #999;
164 | text-align: center;
165 | background-color: #f9f9f9;
166 | border-top: 1px solid #e5e5e5;
167 | }
168 |
169 |
--------------------------------------------------------------------------------
/docs/examples/non-responsive/non-responsive.css:
--------------------------------------------------------------------------------
1 | /* Template-specific stuff
2 | *
3 | * Customizations just for the template; these are not necessary for anything
4 | * with disabling the responsiveness.
5 | */
6 |
7 | /* Account for fixed navbar */
8 | body {
9 | padding-top: 70px;
10 | padding-bottom: 30px;
11 | min-width: 970px;
12 | }
13 |
14 | /* Finesse the page header spacing */
15 | .page-header {
16 | margin-bottom: 30px;
17 | }
18 | .page-header .lead {
19 | margin-bottom: 10px;
20 | }
21 |
22 |
23 | /* Non-responsive overrides
24 | *
25 | * Utilitze the following CSS to disable the responsive-ness of the container,
26 | * grid system, and navbar.
27 | */
28 |
29 | /* Reset the container */
30 | .container {
31 | max-width: none !important;
32 | width: 970px;
33 | }
34 |
35 | /* Demonstrate the grids */
36 | .col-xs-4 {
37 | padding-top: 15px;
38 | padding-bottom: 15px;
39 | background-color: #eee;
40 | border: 1px solid #ddd;
41 | background-color: rgba(86,61,124,.15);
42 | border: 1px solid rgba(86,61,124,.2);
43 | }
44 |
45 | .container .navbar-header,
46 | .container .navbar-collapse {
47 | margin-right: 0;
48 | margin-left: 0;
49 | }
50 |
51 | /* Always float the navbar header */
52 | .navbar-header {
53 | float: left;
54 | }
55 |
56 | /* Undo the collapsing navbar */
57 | .navbar-collapse {
58 | display: block !important;
59 | height: auto !important;
60 | padding-bottom: 0;
61 | overflow: visible !important;
62 | }
63 |
64 | .navbar-toggle {
65 | display: none;
66 | }
67 | .navbar-collapse {
68 | border-top: 0;
69 | }
70 |
71 | .navbar-brand {
72 | margin-left: -15px;
73 | }
74 |
75 | /* Always apply the floated nav */
76 | .navbar-nav {
77 | float: left;
78 | margin: 0;
79 | }
80 | .navbar-nav > li {
81 | float: left;
82 | }
83 | .navbar-nav > li > a {
84 | padding: 15px;
85 | }
86 |
87 | /* Redeclare since we override the float above */
88 | .navbar-nav.navbar-right {
89 | float: right;
90 | }
91 |
92 | /* Undo custom dropdowns */
93 | .navbar .navbar-nav .open .dropdown-menu {
94 | position: absolute;
95 | float: left;
96 | background-color: #fff;
97 | border: 1px solid #cccccc;
98 | border: 1px solid rgba(0, 0, 0, 0.15);
99 | border-width: 0 1px 1px;
100 | border-radius: 0 0 4px 4px;
101 | -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
102 | box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
103 | }
104 | .navbar-default .navbar-nav .open .dropdown-menu > li > a {
105 | color: #333;
106 | }
107 | .navbar .navbar-nav .open .dropdown-menu > li > a:hover,
108 | .navbar .navbar-nav .open .dropdown-menu > li > a:focus,
109 | .navbar .navbar-nav .open .dropdown-menu > .active > a,
110 | .navbar .navbar-nav .open .dropdown-menu > .active > a:hover,
111 | .navbar .navbar-nav .open .dropdown-menu > .active > a:focus {
112 | color: #fff !important;
113 | background-color: #428bca !important;
114 | }
115 | .navbar .navbar-nav .open .dropdown-menu > .disabled > a,
116 | .navbar .navbar-nav .open .dropdown-menu > .disabled > a:hover,
117 | .navbar .navbar-nav .open .dropdown-menu > .disabled > a:focus {
118 | color: #999 !important;
119 | background-color: transparent !important;
120 | }
121 |
--------------------------------------------------------------------------------
/docs/_layouts/default.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {% include header.html %}
6 |
7 |
8 |
Skip to main content
9 |
10 |
11 | {% include nav-main.html %}
12 |
13 |
14 |
21 |
22 |
23 | {% include old-bs-docs.html %}
24 |
25 |
26 |
27 |
28 |
29 |
46 |
47 |
48 | {{ content }}
49 |
50 |
51 |
52 |
53 |
54 |
56 |
76 |
77 |
78 | {% include footer.html %}
79 |
80 |
81 |
82 |
--------------------------------------------------------------------------------
/docs/examples/cover/cover.css:
--------------------------------------------------------------------------------
1 | /*
2 | * Globals
3 | */
4 |
5 | /* Links */
6 | a,
7 | a:focus,
8 | a:hover {
9 | color: #fff;
10 | }
11 |
12 | /* Custom default button */
13 | .btn-default,
14 | .btn-default:hover,
15 | .btn-default:focus {
16 | color: #333;
17 | text-shadow: none; /* Prevent inheritence from `body` */
18 | background-color: #fff;
19 | border: 1px solid #fff;
20 | }
21 |
22 |
23 | /*
24 | * Base structure
25 | */
26 |
27 | html,
28 | body {
29 | height: 100%;
30 | background-color: #333;
31 | }
32 | body {
33 | color: #fff;
34 | text-align: center;
35 | text-shadow: 0 1px 3px rgba(0,0,0,.5);
36 | box-shadow: inset 0 0 100px rgba(0,0,0,.5);
37 | }
38 |
39 | /* Extra markup and styles for table-esque vertical and horizontal centering */
40 | .site-wrapper {
41 | display: table;
42 | width: 100%;
43 | height: 100%; /* For at least Firefox */
44 | min-height: 100%;
45 | }
46 | .site-wrapper-inner {
47 | display: table-cell;
48 | vertical-align: top;
49 | }
50 | .cover-container {
51 | margin-left: auto;
52 | margin-right: auto;
53 | }
54 |
55 | /* Padding for spacing */
56 | .inner {
57 | padding: 30px;
58 | }
59 |
60 |
61 | /*
62 | * Header
63 | */
64 | .masthead-brand {
65 | margin-top: 10px;
66 | margin-bottom: 10px;
67 | }
68 |
69 | .masthead-nav > li {
70 | display: inline-block;
71 | }
72 | .masthead-nav > li + li {
73 | margin-left: 20px;
74 | }
75 | .masthead-nav > li > a {
76 | padding-left: 0;
77 | padding-right: 0;
78 | font-size: 16px;
79 | font-weight: bold;
80 | color: #fff; /* IE8 proofing */
81 | color: rgba(255,255,255,.75);
82 | border-bottom: 2px solid transparent;
83 | }
84 | .masthead-nav > li > a:hover,
85 | .masthead-nav > li > a:focus {
86 | background-color: transparent;
87 | border-bottom-color: rgba(255,255,255,.25);
88 | }
89 | .masthead-nav > .active > a,
90 | .masthead-nav > .active > a:hover,
91 | .masthead-nav > .active > a:focus {
92 | color: #fff;
93 | border-bottom-color: #fff;
94 | }
95 |
96 | @media (min-width: 768px) {
97 | .masthead-brand {
98 | float: left;
99 | }
100 | .masthead-nav {
101 | float: right;
102 | }
103 | }
104 |
105 |
106 | /*
107 | * Cover
108 | */
109 |
110 | .cover {
111 | padding: 0 20px;
112 | }
113 | .cover .btn-lg {
114 | padding: 10px 20px;
115 | font-weight: bold;
116 | }
117 |
118 |
119 | /*
120 | * Footer
121 | */
122 |
123 | .mastfoot {
124 | color: #999; /* IE8 proofing */
125 | color: rgba(255,255,255,.5);
126 | }
127 |
128 |
129 | /*
130 | * Affix and center
131 | */
132 |
133 | @media (min-width: 768px) {
134 | /* Pull out the header and footer */
135 | .masthead {
136 | position: fixed;
137 | top: 0;
138 | }
139 | .mastfoot {
140 | position: fixed;
141 | bottom: 0;
142 | }
143 | /* Start the vertical centering */
144 | .site-wrapper-inner {
145 | vertical-align: middle;
146 | }
147 | /* Handle the widths */
148 | .masthead,
149 | .mastfoot,
150 | .cover-container {
151 | width: 100%; /* Must be percentage or pixels for horizontal alignment */
152 | }
153 | }
154 |
155 | @media (min-width: 992px) {
156 | .masthead,
157 | .mastfoot,
158 | .cover-container {
159 | width: 700px;
160 | }
161 | }
162 |
--------------------------------------------------------------------------------
/docs/examples/jumbotron-narrow/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
Narrow Jumbotron Template for Bootstrap
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
27 |
28 |
29 |
30 |
31 |
32 |
40 |
41 |
42 |
Jumbotron heading
43 |
Cras justo odio, dapibus ac facilisis in, egestas eget quam. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.
44 |
Sign up today
45 |
46 |
47 |
48 |
49 |
Subheading
50 |
Donec id elit non mi porta gravida at eget metus. Maecenas faucibus mollis interdum.
51 |
52 |
Subheading
53 |
Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Cras mattis consectetur purus sit amet fermentum.
54 |
55 |
Subheading
56 |
Maecenas sed diam eget risus varius blandit sit amet non magna.
57 |
58 |
59 |
60 |
Subheading
61 |
Donec id elit non mi porta gravida at eget metus. Maecenas faucibus mollis interdum.
62 |
63 |
Subheading
64 |
Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Cras mattis consectetur purus sit amet fermentum.
65 |
66 |
Subheading
67 |
Maecenas sed diam eget risus varius blandit sit amet non magna.
68 |
69 |
70 |
71 |
74 |
75 |
76 |
77 |
78 |
80 |
81 |
82 |
83 |
--------------------------------------------------------------------------------
/js/button.js:
--------------------------------------------------------------------------------
1 | /* ========================================================================
2 | * Bootstrap: button.js v3.0.3
3 | * http://getbootstrap.com/javascript/#buttons
4 | * ========================================================================
5 | * Copyright 2014 Twitter, Inc.
6 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
7 | * ======================================================================== */
8 |
9 |
10 | +function ($) { 'use strict';
11 |
12 | // BUTTON PUBLIC CLASS DEFINITION
13 | // ==============================
14 |
15 | var Button = function (element, options) {
16 | this.$element = $(element)
17 | this.options = $.extend({}, Button.DEFAULTS, options)
18 | this.isLoading = false
19 | }
20 |
21 | Button.DEFAULTS = {
22 | loadingText: 'loading...'
23 | }
24 |
25 | Button.prototype.setState = function (state) {
26 | var d = 'disabled'
27 | var $el = this.$element
28 | var val = $el.is('input') ? 'val' : 'html'
29 | var data = $el.data()
30 |
31 | state = state + 'Text'
32 |
33 | if (!data.resetText) $el.data('resetText', $el[val]())
34 |
35 | $el[val](data[state] || this.options[state])
36 |
37 | // push to event loop to allow forms to submit
38 | setTimeout($.proxy(function () {
39 | if (state == 'loadingText') {
40 | this.isLoading = true
41 | $el.addClass(d).attr(d, d)
42 | } else if (this.isLoading) {
43 | this.isLoading = false
44 | $el.removeClass(d).removeAttr(d)
45 | }
46 | }, this), 0)
47 | }
48 |
49 | Button.prototype.toggle = function () {
50 | var changed = true
51 | var $parent = this.$element.closest('[data-toggle="buttons"]')
52 |
53 | if ($parent.length) {
54 | var $input = this.$element.find('input')
55 | if ($input.prop('type') == 'radio') {
56 | if ($input.prop('checked') && this.$element.hasClass('active')) changed = false
57 | else $parent.find('.active').removeClass('active')
58 | }
59 | if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change')
60 | }
61 |
62 | if (changed) this.$element.toggleClass('active')
63 | }
64 |
65 |
66 | // BUTTON PLUGIN DEFINITION
67 | // ========================
68 |
69 | var old = $.fn.button
70 |
71 | $.fn.button = function (option) {
72 | return this.each(function () {
73 | var $this = $(this)
74 | var data = $this.data('bs.button')
75 | var options = typeof option == 'object' && option
76 |
77 | if (!data) $this.data('bs.button', (data = new Button(this, options)))
78 |
79 | if (option == 'toggle') data.toggle()
80 | else if (option) data.setState(option)
81 | })
82 | }
83 |
84 | $.fn.button.Constructor = Button
85 |
86 |
87 | // BUTTON NO CONFLICT
88 | // ==================
89 |
90 | $.fn.button.noConflict = function () {
91 | $.fn.button = old
92 | return this
93 | }
94 |
95 |
96 | // BUTTON DATA-API
97 | // ===============
98 |
99 | $(document).on('click.bs.button.data-api', '[data-toggle^=button]', function (e) {
100 | var $btn = $(e.target)
101 | if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
102 | $btn.button('toggle')
103 | e.preventDefault()
104 | })
105 |
106 | }(jQuery);
107 |
--------------------------------------------------------------------------------
/docs/examples/carousel/carousel.css:
--------------------------------------------------------------------------------
1 | /* GLOBAL STYLES
2 | -------------------------------------------------- */
3 | /* Padding below the footer and lighter body text */
4 |
5 | body {
6 | padding-bottom: 40px;
7 | color: #5a5a5a;
8 | }
9 |
10 |
11 |
12 | /* CUSTOMIZE THE NAVBAR
13 | -------------------------------------------------- */
14 |
15 | /* Special class on .container surrounding .navbar, used for positioning it into place. */
16 | .navbar-wrapper {
17 | position: absolute;
18 | top: 0;
19 | left: 0;
20 | right: 0;
21 | z-index: 20;
22 | }
23 |
24 | /* Flip around the padding for proper display in narrow viewports */
25 | .navbar-wrapper .container {
26 | padding-left: 0;
27 | padding-right: 0;
28 | }
29 | .navbar-wrapper .navbar {
30 | padding-left: 15px;
31 | padding-right: 15px;
32 | }
33 |
34 |
35 | /* CUSTOMIZE THE CAROUSEL
36 | -------------------------------------------------- */
37 |
38 | /* Carousel base class */
39 | .carousel {
40 | height: 500px;
41 | margin-bottom: 60px;
42 | }
43 | /* Since positioning the image, we need to help out the caption */
44 | .carousel-caption {
45 | z-index: 10;
46 | }
47 |
48 | /* Declare heights because of positioning of img element */
49 | .carousel .item {
50 | height: 500px;
51 | background-color: #777;
52 | }
53 | .carousel-inner > .item > img {
54 | position: absolute;
55 | top: 0;
56 | left: 0;
57 | min-width: 100%;
58 | height: 500px;
59 | }
60 |
61 |
62 |
63 | /* MARKETING CONTENT
64 | -------------------------------------------------- */
65 |
66 | /* Pad the edges of the mobile views a bit */
67 | .marketing {
68 | padding-left: 15px;
69 | padding-right: 15px;
70 | }
71 |
72 | /* Center align the text within the three columns below the carousel */
73 | .marketing .col-lg-4 {
74 | text-align: center;
75 | margin-bottom: 20px;
76 | }
77 | .marketing h2 {
78 | font-weight: normal;
79 | }
80 | .marketing .col-lg-4 p {
81 | margin-left: 10px;
82 | margin-right: 10px;
83 | }
84 |
85 |
86 | /* Featurettes
87 | ------------------------- */
88 |
89 | .featurette-divider {
90 | margin: 80px 0; /* Space out the Bootstrap
more */
91 | }
92 |
93 | /* Thin out the marketing headings */
94 | .featurette-heading {
95 | font-weight: 300;
96 | line-height: 1;
97 | letter-spacing: -1px;
98 | }
99 |
100 |
101 |
102 | /* RESPONSIVE CSS
103 | -------------------------------------------------- */
104 |
105 | @media (min-width: 768px) {
106 |
107 | /* Remove the edge padding needed for mobile */
108 | .marketing {
109 | padding-left: 0;
110 | padding-right: 0;
111 | }
112 |
113 | /* Navbar positioning foo */
114 | .navbar-wrapper {
115 | margin-top: 20px;
116 | }
117 | .navbar-wrapper .container {
118 | padding-left: 15px;
119 | padding-right: 15px;
120 | }
121 | .navbar-wrapper .navbar {
122 | padding-left: 0;
123 | padding-right: 0;
124 | }
125 |
126 | /* The navbar becomes detached from the top, so we round the corners */
127 | .navbar-wrapper .navbar {
128 | border-radius: 4px;
129 | }
130 |
131 | /* Bump up size of carousel content */
132 | .carousel-caption p {
133 | margin-bottom: 20px;
134 | font-size: 21px;
135 | line-height: 1.4;
136 | }
137 |
138 | .featurette-heading {
139 | font-size: 50px;
140 | }
141 |
142 | }
143 |
144 | @media (min-width: 992px) {
145 | .featurette-heading {
146 | margin-top: 120px;
147 | }
148 | }
149 |
--------------------------------------------------------------------------------
/js/tab.js:
--------------------------------------------------------------------------------
1 | /* ========================================================================
2 | * Bootstrap: tab.js v3.0.3
3 | * http://getbootstrap.com/javascript/#tabs
4 | * ========================================================================
5 | * Copyright 2014 Twitter, Inc.
6 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
7 | * ======================================================================== */
8 |
9 |
10 | +function ($) { 'use strict';
11 |
12 | // TAB CLASS DEFINITION
13 | // ====================
14 |
15 | var Tab = function (element) {
16 | this.element = $(element)
17 | }
18 |
19 | Tab.prototype.show = function () {
20 | var $this = this.element
21 | var $ul = $this.closest('ul:not(.dropdown-menu)')
22 | var selector = $this.data('target')
23 |
24 | if (!selector) {
25 | selector = $this.attr('href')
26 | selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
27 | }
28 |
29 | if ($this.parent('li').hasClass('active')) return
30 |
31 | var previous = $ul.find('.active:last a')[0]
32 | var e = $.Event('show.bs.tab', {
33 | relatedTarget: previous
34 | })
35 |
36 | $this.trigger(e)
37 |
38 | if (e.isDefaultPrevented()) return
39 |
40 | var $target = $(selector)
41 |
42 | this.activate($this.parent('li'), $ul)
43 | this.activate($target, $target.parent(), function () {
44 | $this.trigger({
45 | type: 'shown.bs.tab',
46 | relatedTarget: previous
47 | })
48 | })
49 | }
50 |
51 | Tab.prototype.activate = function (element, container, callback) {
52 | var $active = container.find('> .active')
53 | var transition = callback
54 | && $.support.transition
55 | && $active.hasClass('fade')
56 |
57 | function next() {
58 | $active
59 | .removeClass('active')
60 | .find('> .dropdown-menu > .active')
61 | .removeClass('active')
62 |
63 | element.addClass('active')
64 |
65 | if (transition) {
66 | element[0].offsetWidth // reflow for transition
67 | element.addClass('in')
68 | } else {
69 | element.removeClass('fade')
70 | }
71 |
72 | if (element.parent('.dropdown-menu')) {
73 | element.closest('li.dropdown').addClass('active')
74 | }
75 |
76 | callback && callback()
77 | }
78 |
79 | transition ?
80 | $active
81 | .one($.support.transition.end, next)
82 | .emulateTransitionEnd(150) :
83 | next()
84 |
85 | $active.removeClass('in')
86 | }
87 |
88 |
89 | // TAB PLUGIN DEFINITION
90 | // =====================
91 |
92 | var old = $.fn.tab
93 |
94 | $.fn.tab = function ( option ) {
95 | return this.each(function () {
96 | var $this = $(this)
97 | var data = $this.data('bs.tab')
98 |
99 | if (!data) $this.data('bs.tab', (data = new Tab(this)))
100 | if (typeof option == 'string') data[option]()
101 | })
102 | }
103 |
104 | $.fn.tab.Constructor = Tab
105 |
106 |
107 | // TAB NO CONFLICT
108 | // ===============
109 |
110 | $.fn.tab.noConflict = function () {
111 | $.fn.tab = old
112 | return this
113 | }
114 |
115 |
116 | // TAB DATA-API
117 | // ============
118 |
119 | $(document).on('click.bs.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
120 | e.preventDefault()
121 | $(this).tab('show')
122 | })
123 |
124 | }(jQuery);
125 |
--------------------------------------------------------------------------------
/js/popover.js:
--------------------------------------------------------------------------------
1 | /* ========================================================================
2 | * Bootstrap: popover.js v3.0.3
3 | * http://getbootstrap.com/javascript/#popovers
4 | * ========================================================================
5 | * Copyright 2014 Twitter, Inc.
6 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
7 | * ======================================================================== */
8 |
9 |
10 | +function ($) { 'use strict';
11 |
12 | // POPOVER PUBLIC CLASS DEFINITION
13 | // ===============================
14 |
15 | var Popover = function (element, options) {
16 | this.init('popover', element, options)
17 | }
18 |
19 | if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
20 |
21 | Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {
22 | placement: 'right',
23 | trigger: 'click',
24 | content: '',
25 | template: '
'
26 | })
27 |
28 |
29 | // NOTE: POPOVER EXTENDS tooltip.js
30 | // ================================
31 |
32 | Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype)
33 |
34 | Popover.prototype.constructor = Popover
35 |
36 | Popover.prototype.getDefaults = function () {
37 | return Popover.DEFAULTS
38 | }
39 |
40 | Popover.prototype.setContent = function () {
41 | var $tip = this.tip()
42 | var title = this.getTitle()
43 | var content = this.getContent()
44 |
45 | $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
46 | $tip.find('.popover-content')[ // we use append for html objects to maintain js events
47 | this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text'
48 | ](content)
49 |
50 | $tip.removeClass('fade top bottom left right in')
51 |
52 | // IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do
53 | // this manually by checking the contents.
54 | if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide()
55 | }
56 |
57 | Popover.prototype.hasContent = function () {
58 | return this.getTitle() || this.getContent()
59 | }
60 |
61 | Popover.prototype.getContent = function () {
62 | var $e = this.$element
63 | var o = this.options
64 |
65 | return $e.attr('data-content')
66 | || (typeof o.content == 'function' ?
67 | o.content.call($e[0]) :
68 | o.content)
69 | }
70 |
71 | Popover.prototype.arrow = function () {
72 | return this.$arrow = this.$arrow || this.tip().find('.arrow')
73 | }
74 |
75 | Popover.prototype.tip = function () {
76 | if (!this.$tip) this.$tip = $(this.options.template)
77 | return this.$tip
78 | }
79 |
80 |
81 | // POPOVER PLUGIN DEFINITION
82 | // =========================
83 |
84 | var old = $.fn.popover
85 |
86 | $.fn.popover = function (option) {
87 | return this.each(function () {
88 | var $this = $(this)
89 | var data = $this.data('bs.popover')
90 | var options = typeof option == 'object' && option
91 |
92 | if (!data && option == 'destroy') return
93 | if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
94 | if (typeof option == 'string') data[option]()
95 | })
96 | }
97 |
98 | $.fn.popover.Constructor = Popover
99 |
100 |
101 | // POPOVER NO CONFLICT
102 | // ===================
103 |
104 | $.fn.popover.noConflict = function () {
105 | $.fn.popover = old
106 | return this
107 | }
108 |
109 | }(jQuery);
110 |
--------------------------------------------------------------------------------
/less/popovers.less:
--------------------------------------------------------------------------------
1 | //
2 | // Popovers
3 | // --------------------------------------------------
4 |
5 |
6 | .popover {
7 | position: absolute;
8 | top: 0;
9 | left: 0;
10 | z-index: @zindex-popover;
11 | display: none;
12 | max-width: @popover-max-width;
13 | padding: 1px;
14 | text-align: left; // Reset given new insertion method
15 | background-color: @popover-bg;
16 | background-clip: padding-box;
17 | border: 1px solid @popover-fallback-border-color;
18 | border: 1px solid @popover-border-color;
19 | border-radius: @border-radius-large;
20 | .box-shadow(0 5px 10px rgba(0,0,0,.2));
21 |
22 | // Overrides for proper insertion
23 | white-space: normal;
24 |
25 | // Offset the popover to account for the popover arrow
26 | &.top { margin-top: -10px; }
27 | &.right { margin-left: 10px; }
28 | &.bottom { margin-top: 10px; }
29 | &.left { margin-left: -10px; }
30 | }
31 |
32 | .popover-title {
33 | margin: 0; // reset heading margin
34 | padding: 8px 14px;
35 | font-size: @font-size-base;
36 | font-weight: normal;
37 | line-height: 18px;
38 | background-color: @popover-title-bg;
39 | border-bottom: 1px solid darken(@popover-title-bg, 5%);
40 | border-radius: 5px 5px 0 0;
41 | }
42 |
43 | .popover-content {
44 | padding: 9px 14px;
45 | }
46 |
47 | // Arrows
48 | //
49 | // .arrow is outer, .arrow:after is inner
50 |
51 | .popover .arrow {
52 | &,
53 | &:after {
54 | position: absolute;
55 | display: block;
56 | width: 0;
57 | height: 0;
58 | border-color: transparent;
59 | border-style: solid;
60 | }
61 | }
62 | .popover .arrow {
63 | border-width: @popover-arrow-outer-width;
64 | }
65 | .popover .arrow:after {
66 | border-width: @popover-arrow-width;
67 | content: "";
68 | }
69 |
70 | .popover {
71 | &.top .arrow {
72 | left: 50%;
73 | margin-left: -@popover-arrow-outer-width;
74 | border-bottom-width: 0;
75 | border-top-color: @popover-arrow-outer-fallback-color; // IE8 fallback
76 | border-top-color: @popover-arrow-outer-color;
77 | bottom: -@popover-arrow-outer-width;
78 | &:after {
79 | content: " ";
80 | bottom: 1px;
81 | margin-left: -@popover-arrow-width;
82 | border-bottom-width: 0;
83 | border-top-color: @popover-arrow-color;
84 | }
85 | }
86 | &.right .arrow {
87 | top: 50%;
88 | left: -@popover-arrow-outer-width;
89 | margin-top: -@popover-arrow-outer-width;
90 | border-left-width: 0;
91 | border-right-color: @popover-arrow-outer-fallback-color; // IE8 fallback
92 | border-right-color: @popover-arrow-outer-color;
93 | &:after {
94 | content: " ";
95 | left: 1px;
96 | bottom: -@popover-arrow-width;
97 | border-left-width: 0;
98 | border-right-color: @popover-arrow-color;
99 | }
100 | }
101 | &.bottom .arrow {
102 | left: 50%;
103 | margin-left: -@popover-arrow-outer-width;
104 | border-top-width: 0;
105 | border-bottom-color: @popover-arrow-outer-fallback-color; // IE8 fallback
106 | border-bottom-color: @popover-arrow-outer-color;
107 | top: -@popover-arrow-outer-width;
108 | &:after {
109 | content: " ";
110 | top: 1px;
111 | margin-left: -@popover-arrow-width;
112 | border-top-width: 0;
113 | border-bottom-color: @popover-arrow-color;
114 | }
115 | }
116 |
117 | &.left .arrow {
118 | top: 50%;
119 | right: -@popover-arrow-outer-width;
120 | margin-top: -@popover-arrow-outer-width;
121 | border-right-width: 0;
122 | border-left-color: @popover-arrow-outer-fallback-color; // IE8 fallback
123 | border-left-color: @popover-arrow-outer-color;
124 | &:after {
125 | content: " ";
126 | right: 1px;
127 | border-right-width: 0;
128 | border-left-color: @popover-arrow-color;
129 | bottom: -@popover-arrow-width;
130 | }
131 | }
132 |
133 | }
134 |
--------------------------------------------------------------------------------
/docs/examples/navbar/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
Navbar Template for Bootstrap
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
69 |
70 |
71 |
72 |
Navbar example
73 |
This example is a quick exercise to illustrate how the default, static navbar and fixed to top navbar work. It includes the responsive CSS and HTML, so it also adapts to your viewport and device.
74 |
75 | View navbar docs »
76 |
77 |
78 |
79 |
80 |
81 |
82 |
84 |
85 |
86 |
87 |
88 |
89 |
--------------------------------------------------------------------------------
/test-infra/s3_cache.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python2.7
2 | from __future__ import absolute_import, unicode_literals, print_function, division
3 |
4 | from sys import argv
5 | from os import environ, stat, remove as _delete_file
6 | from os.path import isfile, dirname, basename, abspath
7 | from hashlib import sha256
8 | from subprocess import check_call as run
9 |
10 | from boto.s3.connection import S3Connection
11 | from boto.s3.key import Key
12 | from boto.exception import S3ResponseError
13 |
14 |
15 | NEED_TO_UPLOAD_MARKER = '.need-to-upload'
16 | BYTES_PER_MB = 1024 * 1024
17 | try:
18 | BUCKET_NAME = environ['TWBS_S3_BUCKET']
19 | except KeyError:
20 | raise SystemExit("TWBS_S3_BUCKET environment variable not set!")
21 |
22 |
23 | def _sha256_of_file(filename):
24 | hasher = sha256()
25 | with open(filename, 'rb') as input_file:
26 | hasher.update(input_file.read())
27 | file_hash = hasher.hexdigest()
28 | print('sha256({}) = {}'.format(filename, file_hash))
29 | return file_hash
30 |
31 |
32 | def _delete_file_quietly(filename):
33 | try:
34 | _delete_file(filename)
35 | except (OSError, IOError):
36 | pass
37 |
38 |
39 | def _tarball_size(directory):
40 | kib = stat(_tarball_filename_for(directory)).st_size // BYTES_PER_MB
41 | return "{} MiB".format(kib)
42 |
43 |
44 | def _tarball_filename_for(directory):
45 | return abspath('./{}.tar.gz'.format(basename(directory)))
46 |
47 |
48 | def _create_tarball(directory):
49 | print("Creating tarball of {}...".format(directory))
50 | run(['tar', '-czf', _tarball_filename_for(directory), '-C', dirname(directory), basename(directory)])
51 |
52 |
53 | def _extract_tarball(directory):
54 | print("Extracting tarball of {}...".format(directory))
55 | run(['tar', '-xzf', _tarball_filename_for(directory), '-C', dirname(directory)])
56 |
57 |
58 | def download(directory):
59 | _delete_file_quietly(NEED_TO_UPLOAD_MARKER)
60 | try:
61 | print("Downloading {} tarball from S3...".format(friendly_name))
62 | key.get_contents_to_filename(_tarball_filename_for(directory))
63 | except S3ResponseError as err:
64 | open(NEED_TO_UPLOAD_MARKER, 'a').close()
65 | print(err)
66 | raise SystemExit("Cached {} download failed!".format(friendly_name))
67 | print("Downloaded {}.".format(_tarball_size(directory)))
68 | _extract_tarball(directory)
69 | print("{} successfully installed from cache.".format(friendly_name))
70 |
71 |
72 | def upload(directory):
73 | _create_tarball(directory)
74 | print("Uploading {} tarball to S3... ({})".format(friendly_name, _tarball_size(directory)))
75 | key.set_contents_from_filename(_tarball_filename_for(directory))
76 | print("{} cache successfully updated.".format(friendly_name))
77 | _delete_file_quietly(NEED_TO_UPLOAD_MARKER)
78 |
79 |
80 | if __name__ == '__main__':
81 | # Uses environment variables:
82 | # AWS_ACCESS_KEY_ID -- AWS Access Key ID
83 | # AWS_SECRET_ACCESS_KEY -- AWS Secret Access Key
84 | argv.pop(0)
85 | if len(argv) != 4:
86 | raise SystemExit("USAGE: node_modules_cache.py
")
87 | mode, friendly_name, dependencies_file, directory = argv
88 |
89 | conn = S3Connection()
90 | bucket = conn.lookup(BUCKET_NAME)
91 | if bucket is None:
92 | raise SystemExit("Could not access bucket!")
93 |
94 | dependencies_file_hash = _sha256_of_file(dependencies_file)
95 |
96 | key = Key(bucket, dependencies_file_hash)
97 | key.storage_class = 'REDUCED_REDUNDANCY'
98 |
99 | if mode == 'download':
100 | download(directory)
101 | elif mode == 'upload':
102 | if isfile(NEED_TO_UPLOAD_MARKER): # FIXME
103 | upload(directory)
104 | else:
105 | print("No need to upload anything.")
106 | else:
107 | raise SystemExit("Unrecognized mode {!r}".format(mode))
108 |
--------------------------------------------------------------------------------
/less/modals.less:
--------------------------------------------------------------------------------
1 | //
2 | // Modals
3 | // --------------------------------------------------
4 |
5 | // .modal-open - body class for killing the scroll
6 | // .modal - container to scroll within
7 | // .modal-dialog - positioning shell for the actual modal
8 | // .modal-content - actual modal w/ bg and corners and shit
9 |
10 | // Kill the scroll on the body
11 | .modal-open {
12 | overflow: hidden;
13 | }
14 |
15 | // Container that the modal scrolls within
16 | .modal {
17 | display: none;
18 | overflow: auto;
19 | overflow-y: scroll;
20 | position: fixed;
21 | top: 0;
22 | right: 0;
23 | bottom: 0;
24 | left: 0;
25 | z-index: @zindex-modal;
26 | -webkit-overflow-scrolling: touch;
27 |
28 | // Prevent Chrome on Windows from adding a focus outline. For details, see
29 | // https://github.com/twbs/bootstrap/pull/10951.
30 | outline: 0;
31 |
32 | // When fading in the modal, animate it to slide down
33 | &.fade .modal-dialog {
34 | .translate(0, -25%);
35 | .transition-transform(~"0.3s ease-out");
36 | }
37 | &.in .modal-dialog { .translate(0, 0)}
38 | }
39 |
40 | // Shell div to position the modal with bottom padding
41 | .modal-dialog {
42 | position: relative;
43 | width: auto;
44 | margin: 10px;
45 | }
46 |
47 | // Actual modal
48 | .modal-content {
49 | position: relative;
50 | background-color: @modal-content-bg;
51 | border: 1px solid @modal-content-fallback-border-color; //old browsers fallback (ie8 etc)
52 | border: 1px solid @modal-content-border-color;
53 | border-radius: @border-radius-large;
54 | .box-shadow(0 3px 9px rgba(0,0,0,.5));
55 | background-clip: padding-box;
56 | // Remove focus outline from opened modal
57 | outline: none;
58 | }
59 |
60 | // Modal background
61 | .modal-backdrop {
62 | position: fixed;
63 | top: 0;
64 | right: 0;
65 | bottom: 0;
66 | left: 0;
67 | z-index: @zindex-modal-background;
68 | background-color: @modal-backdrop-bg;
69 | // Fade for backdrop
70 | &.fade { .opacity(0); }
71 | &.in { .opacity(@modal-backdrop-opacity); }
72 | }
73 |
74 | // Modal header
75 | // Top section of the modal w/ title and dismiss
76 | .modal-header {
77 | padding: @modal-title-padding;
78 | border-bottom: 1px solid @modal-header-border-color;
79 | min-height: (@modal-title-padding + @modal-title-line-height);
80 | }
81 | // Close icon
82 | .modal-header .close {
83 | margin-top: -2px;
84 | }
85 |
86 | // Title text within header
87 | .modal-title {
88 | margin: 0;
89 | line-height: @modal-title-line-height;
90 | }
91 |
92 | // Modal body
93 | // Where all modal content resides (sibling of .modal-header and .modal-footer)
94 | .modal-body {
95 | position: relative;
96 | padding: @modal-inner-padding;
97 | }
98 |
99 | // Footer (for actions)
100 | .modal-footer {
101 | margin-top: 15px;
102 | padding: (@modal-inner-padding - 1) @modal-inner-padding @modal-inner-padding;
103 | text-align: right; // right align buttons
104 | border-top: 1px solid @modal-footer-border-color;
105 | &:extend(.clearfix all); // clear it in case folks use .pull-* classes on buttons
106 |
107 | // Properly space out buttons
108 | .btn + .btn {
109 | margin-left: 5px;
110 | margin-bottom: 0; // account for input[type="submit"] which gets the bottom margin like all other inputs
111 | }
112 | // but override that for button groups
113 | .btn-group .btn + .btn {
114 | margin-left: -1px;
115 | }
116 | // and override it for block buttons as well
117 | .btn-block + .btn-block {
118 | margin-left: 0;
119 | }
120 | }
121 |
122 | // Scale up the modal
123 | @media (min-width: @screen-sm-min) {
124 |
125 | // Automatically set modal's width for larger viewports
126 | .modal-dialog {
127 | width: 600px;
128 | margin: 30px auto;
129 | }
130 | .modal-content {
131 | .box-shadow(0 5px 15px rgba(0,0,0,.5));
132 | }
133 |
134 | // Modal sizes
135 | .modal-sm { width: @modal-sm; }
136 | .modal-lg { width: @modal-lg; }
137 |
138 | }
139 |
--------------------------------------------------------------------------------
/docs/examples/justified-nav/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | Justified Nav Template for Bootstrap
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
44 |
45 |
46 |
47 |
Marketing stuff!
48 |
Cras justo odio, dapibus ac facilisis in, egestas eget quam. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet.
49 |
Get started today
50 |
51 |
52 |
53 |
54 |
55 |
Safari bug warning!
56 |
Safari exhibits a bug in which resizing your browser horizontally causes rendering errors in the justified nav that are cleared upon refreshing.
57 |
Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui.
58 |
View details »
59 |
60 |
61 |
Heading
62 |
Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui.
63 |
View details »
64 |
65 |
66 |
Heading
67 |
Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa.
68 |
View details »
69 |
70 |
71 |
72 |
73 |
76 |
77 |
78 |
79 |
80 |
82 |
83 |
84 |
85 |
--------------------------------------------------------------------------------
/docs/examples/sticky-footer-navbar/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | Sticky Footer Navbar Template for Bootstrap
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
67 |
68 |
69 |
70 |
73 |
Pin a fixed-height footer to the bottom of the viewport in desktop browsers with this custom HTML and CSS. A fixed navbar has been added within #wrap with padding-top: 60px; on the .container.
74 |
Back to the default sticky footer minus the navbar.
75 |
76 |
77 |
78 |
83 |
84 |
85 |
87 |
88 |
89 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/docs/examples/navbar-fixed-top/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | Fixed Top Navbar Example for Bootstrap
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
27 |
28 |
29 |
30 |
31 |
32 |
69 |
70 |
71 |
72 |
73 |
74 |
Navbar example
75 |
This example is a quick exercise to illustrate how the default, static and fixed to top navbar work. It includes the responsive CSS and HTML, so it also adapts to your viewport and device.
76 |
To see the difference between static and fixed top navbars, just scroll.
77 |
78 | View navbar docs »
79 |
80 |
81 |
82 |
83 |
84 |
85 |
87 |
88 |
89 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/docs/examples/navbar-static-top/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | Static Top Navbar Example for Bootstrap
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
27 |
28 |
29 |
30 |
31 |
32 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
Navbar example
76 |
This example is a quick exercise to illustrate how the default, static and fixed to top navbar work. It includes the responsive CSS and HTML, so it also adapts to your viewport and device.
77 |
To see the difference between static and fixed top navbars, just scroll.
78 |
79 | View navbar docs »
80 |
81 |
82 |
83 |
84 |
85 |
86 |
88 |
89 |
90 |
91 |
92 |
93 |
--------------------------------------------------------------------------------
/less/buttons.less:
--------------------------------------------------------------------------------
1 | //
2 | // Buttons
3 | // --------------------------------------------------
4 |
5 |
6 | // Base styles
7 | // --------------------------------------------------
8 |
9 | .btn {
10 | display: inline-block;
11 | margin-bottom: 0; // For input.btn
12 | font-weight: @btn-font-weight;
13 | text-align: center;
14 | vertical-align: middle;
15 | cursor: pointer;
16 | background-image: none; // Reset unusual Firefox-on-Android default style; see https://github.com/necolas/normalize.css/issues/214
17 | border: 1px solid transparent;
18 | white-space: nowrap;
19 | .button-size(@padding-base-vertical; @padding-base-horizontal; @font-size-base; @line-height-base; @border-radius-base);
20 | .user-select(none);
21 |
22 | &:focus {
23 | .tab-focus();
24 | }
25 |
26 | &:hover,
27 | &:focus {
28 | color: @btn-default-color;
29 | text-decoration: none;
30 | }
31 |
32 | &:active,
33 | &.active {
34 | outline: 0;
35 | background-image: none;
36 | .box-shadow(inset 0 3px 5px rgba(0,0,0,.125));
37 | }
38 |
39 | &.disabled,
40 | &[disabled],
41 | fieldset[disabled] & {
42 | cursor: not-allowed;
43 | pointer-events: none; // Future-proof disabling of clicks
44 | .opacity(.65);
45 | .box-shadow(none);
46 | }
47 | }
48 |
49 |
50 | // Alternate buttons
51 | // --------------------------------------------------
52 |
53 | .btn-default {
54 | .button-variant(@btn-default-color; @btn-default-bg; @btn-default-border);
55 | }
56 | .btn-primary {
57 | .button-variant(@btn-primary-color; @btn-primary-bg; @btn-primary-border);
58 | }
59 | // Success appears as green
60 | .btn-success {
61 | .button-variant(@btn-success-color; @btn-success-bg; @btn-success-border);
62 | }
63 | // Warning appears as orange
64 | .btn-warning {
65 | .button-variant(@btn-warning-color; @btn-warning-bg; @btn-warning-border);
66 | }
67 | // Danger and error appear as red
68 | .btn-danger {
69 | .button-variant(@btn-danger-color; @btn-danger-bg; @btn-danger-border);
70 | }
71 | // Info appears as blue-green
72 | .btn-info {
73 | .button-variant(@btn-info-color; @btn-info-bg; @btn-info-border);
74 | }
75 |
76 |
77 | // Link buttons
78 | // -------------------------
79 |
80 | // Make a button look and behave like a link
81 | .btn-link {
82 | color: @link-color;
83 | font-weight: normal;
84 | cursor: pointer;
85 | border-radius: 0;
86 |
87 | &,
88 | &:active,
89 | &[disabled],
90 | fieldset[disabled] & {
91 | background-color: transparent;
92 | .box-shadow(none);
93 | }
94 | &,
95 | &:hover,
96 | &:focus,
97 | &:active {
98 | border-color: transparent;
99 | }
100 | &:hover,
101 | &:focus {
102 | color: @link-hover-color;
103 | text-decoration: underline;
104 | background-color: transparent;
105 | }
106 | &[disabled],
107 | fieldset[disabled] & {
108 | &:hover,
109 | &:focus {
110 | color: @btn-link-disabled-color;
111 | text-decoration: none;
112 | }
113 | }
114 | }
115 |
116 |
117 | // Button Sizes
118 | // --------------------------------------------------
119 |
120 | .btn-lg {
121 | // line-height: ensure even-numbered height of button next to large input
122 | .button-size(@padding-large-vertical; @padding-large-horizontal; @font-size-large; @line-height-large; @border-radius-large);
123 | }
124 | .btn-sm {
125 | // line-height: ensure proper height of button next to small input
126 | .button-size(@padding-small-vertical; @padding-small-horizontal; @font-size-small; @line-height-small; @border-radius-small);
127 | }
128 | .btn-xs {
129 | .button-size(@padding-xs-vertical; @padding-xs-horizontal; @font-size-small; @line-height-small; @border-radius-small);
130 | }
131 |
132 |
133 | // Block button
134 | // --------------------------------------------------
135 |
136 | .btn-block {
137 | display: block;
138 | width: 100%;
139 | padding-left: 0;
140 | padding-right: 0;
141 | }
142 |
143 | // Vertically space out multiple block buttons
144 | .btn-block + .btn-block {
145 | margin-top: 5px;
146 | }
147 |
148 | // Specificity overrides
149 | input[type="submit"],
150 | input[type="reset"],
151 | input[type="button"] {
152 | &.btn-block {
153 | width: 100%;
154 | }
155 | }
156 |
--------------------------------------------------------------------------------
/js/affix.js:
--------------------------------------------------------------------------------
1 | /* ========================================================================
2 | * Bootstrap: affix.js v3.0.3
3 | * http://getbootstrap.com/javascript/#affix
4 | * ========================================================================
5 | * Copyright 2014 Twitter, Inc.
6 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
7 | * ======================================================================== */
8 |
9 |
10 | +function ($) { 'use strict';
11 |
12 | // AFFIX CLASS DEFINITION
13 | // ======================
14 |
15 | var Affix = function (element, options) {
16 | this.options = $.extend({}, Affix.DEFAULTS, options)
17 | this.$window = $(window)
18 | .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))
19 | .on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this))
20 |
21 | this.$element = $(element)
22 | this.affixed =
23 | this.unpin =
24 | this.pinnedOffset = null
25 |
26 | this.checkPosition()
27 | }
28 |
29 | Affix.RESET = 'affix affix-top affix-bottom'
30 |
31 | Affix.DEFAULTS = {
32 | offset: 0
33 | }
34 |
35 | Affix.prototype.getPinnedOffset = function () {
36 | if (this.pinnedOffset) return this.pinnedOffset
37 | this.$element.removeClass(Affix.RESET).addClass('affix')
38 | var scrollTop = this.$window.scrollTop()
39 | var position = this.$element.offset()
40 | return (this.pinnedOffset = position.top - scrollTop)
41 | }
42 |
43 | Affix.prototype.checkPositionWithEventLoop = function () {
44 | setTimeout($.proxy(this.checkPosition, this), 1)
45 | }
46 |
47 | Affix.prototype.checkPosition = function () {
48 | if (!this.$element.is(':visible')) return
49 |
50 | var scrollHeight = $(document).height()
51 | var scrollTop = this.$window.scrollTop()
52 | var position = this.$element.offset()
53 | var offset = this.options.offset
54 | var offsetTop = offset.top
55 | var offsetBottom = offset.bottom
56 |
57 | if (this.affixed == 'top') position.top += scrollTop
58 |
59 | if (typeof offset != 'object') offsetBottom = offsetTop = offset
60 | if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element)
61 | if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element)
62 |
63 | var affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ? false :
64 | offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ? 'bottom' :
65 | offsetTop != null && (scrollTop <= offsetTop) ? 'top' : false
66 |
67 | if (this.affixed === affix) return
68 | if (this.unpin) this.$element.css('top', '')
69 |
70 | var affixType = 'affix' + (affix ? '-' + affix : '')
71 | var e = $.Event(affixType + '.bs.affix')
72 |
73 | this.$element.trigger(e)
74 |
75 | if (e.isDefaultPrevented()) return
76 |
77 | this.affixed = affix
78 | this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null
79 |
80 | this.$element
81 | .removeClass(Affix.RESET)
82 | .addClass(affixType)
83 | .trigger($.Event(affixType.replace('affix', 'affixed')))
84 |
85 | if (affix == 'bottom') {
86 | this.$element.offset({ top: scrollHeight - offsetBottom - this.$element.height() })
87 | }
88 | }
89 |
90 |
91 | // AFFIX PLUGIN DEFINITION
92 | // =======================
93 |
94 | var old = $.fn.affix
95 |
96 | $.fn.affix = function (option) {
97 | return this.each(function () {
98 | var $this = $(this)
99 | var data = $this.data('bs.affix')
100 | var options = typeof option == 'object' && option
101 |
102 | if (!data) $this.data('bs.affix', (data = new Affix(this, options)))
103 | if (typeof option == 'string') data[option]()
104 | })
105 | }
106 |
107 | $.fn.affix.Constructor = Affix
108 |
109 |
110 | // AFFIX NO CONFLICT
111 | // =================
112 |
113 | $.fn.affix.noConflict = function () {
114 | $.fn.affix = old
115 | return this
116 | }
117 |
118 |
119 | // AFFIX DATA-API
120 | // ==============
121 |
122 | $(window).on('load', function () {
123 | $('[data-spy="affix"]').each(function () {
124 | var $spy = $(this)
125 | var data = $spy.data()
126 |
127 | data.offset = data.offset || {}
128 |
129 | if (data.offsetBottom) data.offset.bottom = data.offsetBottom
130 | if (data.offsetTop) data.offset.top = data.offsetTop
131 |
132 | $spy.affix(data)
133 | })
134 | })
135 |
136 | }(jQuery);
137 |
--------------------------------------------------------------------------------
/less/input-groups.less:
--------------------------------------------------------------------------------
1 | //
2 | // Input groups
3 | // --------------------------------------------------
4 |
5 | // Base styles
6 | // -------------------------
7 | .input-group {
8 | position: relative; // For dropdowns
9 | display: table;
10 | border-collapse: separate; // prevent input groups from inheriting border styles from table cells when placed within a table
11 |
12 | // Undo padding and float of grid classes
13 | &[class*="col-"] {
14 | float: none;
15 | padding-left: 0;
16 | padding-right: 0;
17 | }
18 |
19 | .form-control {
20 | // IE9 fubars the placeholder attribute in text inputs and the arrows on
21 | // select elements in input groups. To fix it, we float the input. Details:
22 | // https://github.com/twbs/bootstrap/issues/11561#issuecomment-28936855
23 | float: left;
24 |
25 | width: 100%;
26 | margin-bottom: 0;
27 | }
28 | }
29 |
30 | // Sizing options
31 | //
32 | // Remix the default form control sizing classes into new ones for easier
33 | // manipulation.
34 |
35 | .input-group-lg > .form-control,
36 | .input-group-lg > .input-group-addon,
37 | .input-group-lg > .input-group-btn > .btn { .input-lg(); }
38 | .input-group-sm > .form-control,
39 | .input-group-sm > .input-group-addon,
40 | .input-group-sm > .input-group-btn > .btn { .input-sm(); }
41 |
42 |
43 | // Display as table-cell
44 | // -------------------------
45 | .input-group-addon,
46 | .input-group-btn,
47 | .input-group .form-control {
48 | display: table-cell;
49 |
50 | &:not(:first-child):not(:last-child) {
51 | border-radius: 0;
52 | }
53 | }
54 | // Addon and addon wrapper for buttons
55 | .input-group-addon,
56 | .input-group-btn {
57 | width: 1%;
58 | white-space: nowrap;
59 | vertical-align: middle; // Match the inputs
60 | }
61 |
62 | // Text input groups
63 | // -------------------------
64 | .input-group-addon {
65 | padding: @padding-base-vertical @padding-base-horizontal;
66 | font-size: @font-size-base;
67 | font-weight: normal;
68 | line-height: 1;
69 | color: @input-color;
70 | text-align: center;
71 | background-color: @input-group-addon-bg;
72 | border: 1px solid @input-group-addon-border-color;
73 | border-radius: @border-radius-base;
74 |
75 | // Sizing
76 | &.input-sm {
77 | padding: @padding-small-vertical @padding-small-horizontal;
78 | font-size: @font-size-small;
79 | border-radius: @border-radius-small;
80 | }
81 | &.input-lg {
82 | padding: @padding-large-vertical @padding-large-horizontal;
83 | font-size: @font-size-large;
84 | border-radius: @border-radius-large;
85 | }
86 |
87 | // Nuke default margins from checkboxes and radios to vertically center within.
88 | input[type="radio"],
89 | input[type="checkbox"] {
90 | margin-top: 0;
91 | }
92 | }
93 |
94 | // Reset rounded corners
95 | .input-group .form-control:first-child,
96 | .input-group-addon:first-child,
97 | .input-group-btn:first-child > .btn,
98 | .input-group-btn:first-child > .btn-group > .btn,
99 | .input-group-btn:first-child > .dropdown-toggle,
100 | .input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle),
101 | .input-group-btn:last-child > .btn-group:not(:last-child) > .btn {
102 | .border-right-radius(0);
103 | }
104 | .input-group-addon:first-child {
105 | border-right: 0;
106 | }
107 | .input-group .form-control:last-child,
108 | .input-group-addon:last-child,
109 | .input-group-btn:last-child > .btn,
110 | .input-group-btn:last-child > .btn-group > .btn,
111 | .input-group-btn:last-child > .dropdown-toggle,
112 | .input-group-btn:first-child > .btn:not(:first-child),
113 | .input-group-btn:first-child > .btn-group:not(:first-child) > .btn {
114 | .border-left-radius(0);
115 | }
116 | .input-group-addon:last-child {
117 | border-left: 0;
118 | }
119 |
120 | // Button input groups
121 | // -------------------------
122 | .input-group-btn {
123 | position: relative;
124 | // Jankily prevent input button groups from wrapping with `white-space` and
125 | // `font-size` in combination with `inline-block` on buttons.
126 | font-size: 0;
127 | white-space: nowrap;
128 |
129 | // Negative margin for spacing, position for bringing hovered/focused/actived
130 | // element above the siblings.
131 | > .btn {
132 | position: relative;
133 | + .btn {
134 | margin-left: -1px;
135 | }
136 | // Bring the "active" button to the front
137 | &:hover,
138 | &:focus,
139 | &:active {
140 | z-index: 2;
141 | }
142 | }
143 |
144 | // Negative margin to only have a 1px border between the two
145 | &:first-child {
146 | > .btn,
147 | > .btn-group {
148 | margin-right: -1px;
149 | }
150 | }
151 | &:last-child {
152 | > .btn,
153 | > .btn-group {
154 | margin-left: -1px;
155 | }
156 | }
157 | }
158 |
--------------------------------------------------------------------------------
/docs/examples/jumbotron/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | Jumbotron Template for Bootstrap
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
27 |
28 |
29 |
30 |
31 |
55 |
56 |
57 |
58 |
59 |
Hello, world!
60 |
This is a template for a simple marketing or informational website. It includes a large callout called a jumbotron and three supporting pieces of content. Use it as a starting point to create something more unique.
61 |
Learn more »
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
Heading
70 |
Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui.
71 |
View details »
72 |
73 |
74 |
Heading
75 |
Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui.
76 |
View details »
77 |
78 |
79 |
Heading
80 |
Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.
81 |
View details »
82 |
83 |
84 |
85 |
86 |
87 |
90 |
91 |
92 |
93 |
95 |
96 |
97 |
98 |
99 |
100 |
--------------------------------------------------------------------------------
/js/dropdown.js:
--------------------------------------------------------------------------------
1 | /* ========================================================================
2 | * Bootstrap: dropdown.js v3.0.3
3 | * http://getbootstrap.com/javascript/#dropdowns
4 | * ========================================================================
5 | * Copyright 2014 Twitter, Inc.
6 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
7 | * ======================================================================== */
8 |
9 |
10 | +function ($) { 'use strict';
11 |
12 | // DROPDOWN CLASS DEFINITION
13 | // =========================
14 |
15 | var backdrop = '.dropdown-backdrop'
16 | var toggle = '[data-toggle=dropdown]'
17 | var Dropdown = function (element) {
18 | $(element).on('click.bs.dropdown', this.toggle)
19 | }
20 |
21 | Dropdown.prototype.toggle = function (e) {
22 | var $this = $(this)
23 |
24 | if ($this.is('.disabled, :disabled')) return
25 |
26 | var $parent = getParent($this)
27 | var isActive = $parent.hasClass('open')
28 |
29 | clearMenus()
30 |
31 | if (!isActive) {
32 | if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
33 | // if mobile we use a backdrop because click events don't delegate
34 | $('
').insertAfter($(this)).on('click', clearMenus)
35 | }
36 |
37 | var relatedTarget = { relatedTarget: this }
38 | $parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))
39 |
40 | if (e.isDefaultPrevented()) return
41 |
42 | $parent
43 | .toggleClass('open')
44 | .trigger('shown.bs.dropdown', relatedTarget)
45 |
46 | $this.focus()
47 | }
48 |
49 | return false
50 | }
51 |
52 | Dropdown.prototype.keydown = function (e) {
53 | if (!/(38|40|27)/.test(e.keyCode)) return
54 |
55 | var $this = $(this)
56 |
57 | e.preventDefault()
58 | e.stopPropagation()
59 |
60 | if ($this.is('.disabled, :disabled')) return
61 |
62 | var $parent = getParent($this)
63 | var isActive = $parent.hasClass('open')
64 |
65 | if (!isActive || (isActive && e.keyCode == 27)) {
66 | if (e.which == 27) $parent.find(toggle).focus()
67 | return $this.click()
68 | }
69 |
70 | var desc = ' li:not(.divider):visible a'
71 | var $items = $parent.find('[role=menu]' + desc + ', [role=listbox]' + desc)
72 |
73 | if (!$items.length) return
74 |
75 | var index = $items.index($items.filter(':focus'))
76 |
77 | if (e.keyCode == 38 && index > 0) index-- // up
78 | if (e.keyCode == 40 && index < $items.length - 1) index++ // down
79 | if (!~index) index = 0
80 |
81 | $items.eq(index).focus()
82 | }
83 |
84 | function clearMenus(e) {
85 | $(backdrop).remove()
86 | $(toggle).each(function () {
87 | var $parent = getParent($(this))
88 | var relatedTarget = { relatedTarget: this }
89 | if (!$parent.hasClass('open')) return
90 | $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
91 | if (e.isDefaultPrevented()) return
92 | $parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget)
93 | })
94 | }
95 |
96 | function getParent($this) {
97 | var selector = $this.attr('data-target')
98 |
99 | if (!selector) {
100 | selector = $this.attr('href')
101 | selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
102 | }
103 |
104 | var $parent = selector && $(selector)
105 |
106 | return $parent && $parent.length ? $parent : $this.parent()
107 | }
108 |
109 |
110 | // DROPDOWN PLUGIN DEFINITION
111 | // ==========================
112 |
113 | var old = $.fn.dropdown
114 |
115 | $.fn.dropdown = function (option) {
116 | return this.each(function () {
117 | var $this = $(this)
118 | var data = $this.data('bs.dropdown')
119 |
120 | if (!data) $this.data('bs.dropdown', (data = new Dropdown(this)))
121 | if (typeof option == 'string') data[option].call($this)
122 | })
123 | }
124 |
125 | $.fn.dropdown.Constructor = Dropdown
126 |
127 |
128 | // DROPDOWN NO CONFLICT
129 | // ====================
130 |
131 | $.fn.dropdown.noConflict = function () {
132 | $.fn.dropdown = old
133 | return this
134 | }
135 |
136 |
137 | // APPLY TO STANDARD DROPDOWN ELEMENTS
138 | // ===================================
139 |
140 | $(document)
141 | .on('click.bs.dropdown.data-api', clearMenus)
142 | .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
143 | .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)
144 | .on('keydown.bs.dropdown.data-api', toggle + ', [role=menu], [role=listbox]', Dropdown.prototype.keydown)
145 |
146 | }(jQuery);
147 |
--------------------------------------------------------------------------------
/js/scrollspy.js:
--------------------------------------------------------------------------------
1 | /* ========================================================================
2 | * Bootstrap: scrollspy.js v3.0.3
3 | * http://getbootstrap.com/javascript/#scrollspy
4 | * ========================================================================
5 | * Copyright 2014 Twitter, Inc.
6 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
7 | * ======================================================================== */
8 |
9 |
10 | +function ($) { 'use strict';
11 |
12 | // SCROLLSPY CLASS DEFINITION
13 | // ==========================
14 |
15 | function ScrollSpy(element, options) {
16 | var href
17 | var process = $.proxy(this.process, this)
18 |
19 | this.$element = $(element).is('body') ? $(window) : $(element)
20 | this.$body = $('body')
21 | this.$scrollElement = this.$element.on('scroll.bs.scroll-spy.data-api', process)
22 | this.options = $.extend({}, ScrollSpy.DEFAULTS, options)
23 | this.selector = (this.options.target
24 | || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
25 | || '') + ' .nav li > a'
26 | this.offsets = $([])
27 | this.targets = $([])
28 | this.activeTarget = null
29 |
30 | this.refresh()
31 | this.process()
32 | }
33 |
34 | ScrollSpy.DEFAULTS = {
35 | offset: 10
36 | }
37 |
38 | ScrollSpy.prototype.refresh = function () {
39 | var offsetMethod = this.$element[0] == window ? 'offset' : 'position'
40 |
41 | this.offsets = $([])
42 | this.targets = $([])
43 |
44 | var self = this
45 | var $targets = this.$body
46 | .find(this.selector)
47 | .map(function () {
48 | var $el = $(this)
49 | var href = $el.data('target') || $el.attr('href')
50 | var $href = /^#./.test(href) && $(href)
51 |
52 | return ($href
53 | && $href.length
54 | && $href.is(':visible')
55 | && [[ $href[offsetMethod]().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href ]]) || null
56 | })
57 | .sort(function (a, b) { return a[0] - b[0] })
58 | .each(function () {
59 | self.offsets.push(this[0])
60 | self.targets.push(this[1])
61 | })
62 | }
63 |
64 | ScrollSpy.prototype.process = function () {
65 | var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
66 | var scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight
67 | var maxScroll = scrollHeight - this.$scrollElement.height()
68 | var offsets = this.offsets
69 | var targets = this.targets
70 | var activeTarget = this.activeTarget
71 | var i
72 |
73 | if (scrollTop >= maxScroll) {
74 | return activeTarget != (i = targets.last()[0]) && this.activate(i)
75 | }
76 |
77 | if (activeTarget && scrollTop <= offsets[0]) {
78 | return activeTarget != (i = targets[0]) && this.activate(i)
79 | }
80 |
81 | for (i = offsets.length; i--;) {
82 | activeTarget != targets[i]
83 | && scrollTop >= offsets[i]
84 | && (!offsets[i + 1] || scrollTop <= offsets[i + 1])
85 | && this.activate( targets[i] )
86 | }
87 | }
88 |
89 | ScrollSpy.prototype.activate = function (target) {
90 | this.activeTarget = target
91 |
92 | $(this.selector)
93 | .parentsUntil(this.options.target, '.active')
94 | .removeClass('active')
95 |
96 | var selector = this.selector +
97 | '[data-target="' + target + '"],' +
98 | this.selector + '[href="' + target + '"]'
99 |
100 | var active = $(selector)
101 | .parents('li')
102 | .addClass('active')
103 |
104 | if (active.parent('.dropdown-menu').length) {
105 | active = active
106 | .closest('li.dropdown')
107 | .addClass('active')
108 | }
109 |
110 | active.trigger('activate.bs.scrollspy')
111 | }
112 |
113 |
114 | // SCROLLSPY PLUGIN DEFINITION
115 | // ===========================
116 |
117 | var old = $.fn.scrollspy
118 |
119 | $.fn.scrollspy = function (option) {
120 | return this.each(function () {
121 | var $this = $(this)
122 | var data = $this.data('bs.scrollspy')
123 | var options = typeof option == 'object' && option
124 |
125 | if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options)))
126 | if (typeof option == 'string') data[option]()
127 | })
128 | }
129 |
130 | $.fn.scrollspy.Constructor = ScrollSpy
131 |
132 |
133 | // SCROLLSPY NO CONFLICT
134 | // =====================
135 |
136 | $.fn.scrollspy.noConflict = function () {
137 | $.fn.scrollspy = old
138 | return this
139 | }
140 |
141 |
142 | // SCROLLSPY DATA-API
143 | // ==================
144 |
145 | $(window).on('load', function () {
146 | $('[data-spy="scroll"]').each(function () {
147 | var $spy = $(this)
148 | $spy.scrollspy($spy.data())
149 | })
150 | })
151 |
152 | }(jQuery);
153 |
--------------------------------------------------------------------------------
/docs/examples/non-responsive/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | Non-responsive Template for Bootstrap
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
29 |
30 |
31 |
32 |
33 |
34 |
71 |
72 |
73 |
74 |
78 |
79 |
What changes
80 |
Note the lack of the <meta name="viewport" content="width=device-width, initial-scale=1.0">, which disables the zooming aspect of sites in mobile devices. In addition, we reset our container's width and are basically good to go.
81 |
82 |
Regarding navbars
83 |
As a heads up, the navbar component is rather tricky here in that the styles for displaying it are rather specific and detailed. Overrides to ensure desktop styles display are not as performant or sleek as one would like. Just be aware there may be potential gotchas as you build on top of this example when using the navbar.
84 |
85 |
Browsers, scrolling, and fixed elements
86 |
Non-responsive layouts highlight a key drawback to fixed elements. Any fixed component, such as a fixed navbar, will not be scrollable when the viewport becomes narrower than the page content. In other words, given the non-responsive container width of 970px and a viewport of 800px, you'll potentially hide 170px of content.
87 |
There is no way around this as it's default browser behavior. The only solution is a responsive layout or using a non-fixed element.
88 |
89 |
Non-responsive grid system
90 |
91 |
One third
92 |
One third
93 |
One third
94 |
95 |
96 |
97 |
98 |
99 |
101 |
102 |
103 |
104 |
105 |
106 |
--------------------------------------------------------------------------------
/js/tests/unit/button.js:
--------------------------------------------------------------------------------
1 | $(function () {
2 |
3 | module('button')
4 |
5 | test('should provide no conflict', function () {
6 | var button = $.fn.button.noConflict()
7 | ok(!$.fn.button, 'button was set back to undefined (org value)')
8 | $.fn.button = button
9 | })
10 |
11 | test('should be defined on jquery object', function () {
12 | ok($(document.body).button, 'button method is defined')
13 | })
14 |
15 | test('should return element', function () {
16 | ok($(document.body).button()[0] == document.body, 'document.body returned')
17 | })
18 |
19 | test('should return set state to loading', function () {
20 | var btn = $('mdo ')
21 | equal(btn.html(), 'mdo', 'btn text equals mdo')
22 | btn.button('loading')
23 | equal(btn.html(), 'fat', 'btn text equals fat')
24 | stop()
25 | setTimeout(function () {
26 | ok(btn.attr('disabled'), 'btn is disabled')
27 | ok(btn.hasClass('disabled'), 'btn has disabled class')
28 | start()
29 | }, 0)
30 | })
31 |
32 | test('should return reset state', function () {
33 | var btn = $('mdo ')
34 | equal(btn.html(), 'mdo', 'btn text equals mdo')
35 | btn.button('loading')
36 | equal(btn.html(), 'fat', 'btn text equals fat')
37 | stop()
38 | setTimeout(function () {
39 | ok(btn.attr('disabled'), 'btn is disabled')
40 | ok(btn.hasClass('disabled'), 'btn has disabled class')
41 | start()
42 | stop()
43 | btn.button('reset')
44 | equal(btn.html(), 'mdo', 'btn text equals mdo')
45 | setTimeout(function () {
46 | ok(!btn.attr('disabled'), 'btn is not disabled')
47 | ok(!btn.hasClass('disabled'), 'btn does not have disabled class')
48 | start()
49 | }, 0)
50 | }, 0)
51 |
52 | })
53 |
54 | test('should toggle active', function () {
55 | var btn = $('mdo ')
56 | ok(!btn.hasClass('active'), 'btn does not have active class')
57 | btn.button('toggle')
58 | ok(btn.hasClass('active'), 'btn has class active')
59 | })
60 |
61 | test('should toggle active when btn children are clicked', function () {
62 | var btn = $('mdo '),
63 | inner = $(' ')
64 | btn
65 | .append(inner)
66 | .appendTo($('#qunit-fixture'))
67 | ok(!btn.hasClass('active'), 'btn does not have active class')
68 | inner.click()
69 | ok(btn.hasClass('active'), 'btn has class active')
70 | })
71 |
72 | test('should toggle active when btn children are clicked within btn-group', function () {
73 | var btngroup = $('
'),
74 | btn = $('fat '),
75 | inner = $(' ')
76 | btngroup
77 | .append(btn.append(inner))
78 | .appendTo($('#qunit-fixture'))
79 | ok(!btn.hasClass('active'), 'btn does not have active class')
80 | inner.click()
81 | ok(btn.hasClass('active'), 'btn has class active')
82 | })
83 |
84 | test('should check for closest matching toggle', function () {
85 | var group = '' +
86 | '' +
87 | ' Option 1' +
88 | ' ' +
89 | '' +
90 | ' Option 2' +
91 | ' ' +
92 | '' +
93 | ' Option 3' +
94 | ' ' +
95 | '
'
96 |
97 | group = $(group)
98 |
99 | var btn1 = $(group.children()[0])
100 | var btn2 = $(group.children()[1])
101 | var btn3 = $(group.children()[2])
102 |
103 | group.appendTo($('#qunit-fixture'))
104 |
105 | ok(btn1.hasClass('active'), 'btn1 has active class')
106 | ok(btn1.find('input').prop('checked'), 'btn1 is checked')
107 | ok(!btn2.hasClass('active'), 'btn2 does not have active class')
108 | ok(!btn2.find('input').prop('checked'), 'btn2 is not checked')
109 | btn2.find('input').click()
110 | ok(!btn1.hasClass('active'), 'btn1 does not have active class')
111 | ok(!btn1.find('input').prop('checked'), 'btn1 is checked')
112 | ok(btn2.hasClass('active'), 'btn2 has active class')
113 | ok(btn2.find('input').prop('checked'), 'btn2 is checked')
114 |
115 | btn2.find('input').click() /* clicking an already checked radio should not un-check it */
116 | ok(!btn1.hasClass('active'), 'btn1 does not have active class')
117 | ok(!btn1.find('input').prop('checked'), 'btn1 is checked')
118 | ok(btn2.hasClass('active'), 'btn2 has active class')
119 | ok(btn2.find('input').prop('checked'), 'btn2 is checked')
120 | })
121 |
122 | })
123 |
--------------------------------------------------------------------------------