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,218 @@
|
|
1
|
+
/* =========================================================
|
2
|
+
* bootstrap-modal.js v2.0.4
|
3
|
+
* http://twitter.github.com/bootstrap/javascript.html#modals
|
4
|
+
* =========================================================
|
5
|
+
* Copyright 2012 Twitter, Inc.
|
6
|
+
*
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
* you may not use this file except in compliance with the License.
|
9
|
+
* You may obtain a copy of the License at
|
10
|
+
*
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
*
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
+
* See the License for the specific language governing permissions and
|
17
|
+
* limitations under the License.
|
18
|
+
* ========================================================= */
|
19
|
+
|
20
|
+
|
21
|
+
!function ($) {
|
22
|
+
|
23
|
+
"use strict"; // jshint ;_;
|
24
|
+
|
25
|
+
|
26
|
+
/* MODAL CLASS DEFINITION
|
27
|
+
* ====================== */
|
28
|
+
|
29
|
+
var Modal = function (content, options) {
|
30
|
+
this.options = options
|
31
|
+
this.$element = $(content)
|
32
|
+
.delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
|
33
|
+
}
|
34
|
+
|
35
|
+
Modal.prototype = {
|
36
|
+
|
37
|
+
constructor: Modal
|
38
|
+
|
39
|
+
, toggle: function () {
|
40
|
+
return this[!this.isShown ? 'show' : 'hide']()
|
41
|
+
}
|
42
|
+
|
43
|
+
, show: function () {
|
44
|
+
var that = this
|
45
|
+
, e = $.Event('show')
|
46
|
+
|
47
|
+
this.$element.trigger(e)
|
48
|
+
|
49
|
+
if (this.isShown || e.isDefaultPrevented()) return
|
50
|
+
|
51
|
+
$('body').addClass('modal-open')
|
52
|
+
|
53
|
+
this.isShown = true
|
54
|
+
|
55
|
+
escape.call(this)
|
56
|
+
backdrop.call(this, function () {
|
57
|
+
var transition = $.support.transition && that.$element.hasClass('fade')
|
58
|
+
|
59
|
+
if (!that.$element.parent().length) {
|
60
|
+
that.$element.appendTo(document.body) //don't move modals dom position
|
61
|
+
}
|
62
|
+
|
63
|
+
that.$element
|
64
|
+
.show()
|
65
|
+
|
66
|
+
if (transition) {
|
67
|
+
that.$element[0].offsetWidth // force reflow
|
68
|
+
}
|
69
|
+
|
70
|
+
that.$element.addClass('in')
|
71
|
+
|
72
|
+
transition ?
|
73
|
+
that.$element.one($.support.transition.end, function () { that.$element.trigger('shown') }) :
|
74
|
+
that.$element.trigger('shown')
|
75
|
+
|
76
|
+
})
|
77
|
+
}
|
78
|
+
|
79
|
+
, hide: function (e) {
|
80
|
+
e && e.preventDefault()
|
81
|
+
|
82
|
+
var that = this
|
83
|
+
|
84
|
+
e = $.Event('hide')
|
85
|
+
|
86
|
+
this.$element.trigger(e)
|
87
|
+
|
88
|
+
if (!this.isShown || e.isDefaultPrevented()) return
|
89
|
+
|
90
|
+
this.isShown = false
|
91
|
+
|
92
|
+
$('body').removeClass('modal-open')
|
93
|
+
|
94
|
+
escape.call(this)
|
95
|
+
|
96
|
+
this.$element.removeClass('in')
|
97
|
+
|
98
|
+
$.support.transition && this.$element.hasClass('fade') ?
|
99
|
+
hideWithTransition.call(this) :
|
100
|
+
hideModal.call(this)
|
101
|
+
}
|
102
|
+
|
103
|
+
}
|
104
|
+
|
105
|
+
|
106
|
+
/* MODAL PRIVATE METHODS
|
107
|
+
* ===================== */
|
108
|
+
|
109
|
+
function hideWithTransition() {
|
110
|
+
var that = this
|
111
|
+
, timeout = setTimeout(function () {
|
112
|
+
that.$element.off($.support.transition.end)
|
113
|
+
hideModal.call(that)
|
114
|
+
}, 500)
|
115
|
+
|
116
|
+
this.$element.one($.support.transition.end, function () {
|
117
|
+
clearTimeout(timeout)
|
118
|
+
hideModal.call(that)
|
119
|
+
})
|
120
|
+
}
|
121
|
+
|
122
|
+
function hideModal(that) {
|
123
|
+
this.$element
|
124
|
+
.hide()
|
125
|
+
.trigger('hidden')
|
126
|
+
|
127
|
+
backdrop.call(this)
|
128
|
+
}
|
129
|
+
|
130
|
+
function backdrop(callback) {
|
131
|
+
var that = this
|
132
|
+
, animate = this.$element.hasClass('fade') ? 'fade' : ''
|
133
|
+
|
134
|
+
if (this.isShown && this.options.backdrop) {
|
135
|
+
var doAnimate = $.support.transition && animate
|
136
|
+
|
137
|
+
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
|
138
|
+
.appendTo(document.body)
|
139
|
+
|
140
|
+
if (this.options.backdrop != 'static') {
|
141
|
+
this.$backdrop.click($.proxy(this.hide, this))
|
142
|
+
}
|
143
|
+
|
144
|
+
if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
|
145
|
+
|
146
|
+
this.$backdrop.addClass('in')
|
147
|
+
|
148
|
+
doAnimate ?
|
149
|
+
this.$backdrop.one($.support.transition.end, callback) :
|
150
|
+
callback()
|
151
|
+
|
152
|
+
} else if (!this.isShown && this.$backdrop) {
|
153
|
+
this.$backdrop.removeClass('in')
|
154
|
+
|
155
|
+
$.support.transition && this.$element.hasClass('fade')?
|
156
|
+
this.$backdrop.one($.support.transition.end, $.proxy(removeBackdrop, this)) :
|
157
|
+
removeBackdrop.call(this)
|
158
|
+
|
159
|
+
} else if (callback) {
|
160
|
+
callback()
|
161
|
+
}
|
162
|
+
}
|
163
|
+
|
164
|
+
function removeBackdrop() {
|
165
|
+
this.$backdrop.remove()
|
166
|
+
this.$backdrop = null
|
167
|
+
}
|
168
|
+
|
169
|
+
function escape() {
|
170
|
+
var that = this
|
171
|
+
if (this.isShown && this.options.keyboard) {
|
172
|
+
$(document).on('keyup.dismiss.modal', function ( e ) {
|
173
|
+
e.which == 27 && that.hide()
|
174
|
+
})
|
175
|
+
} else if (!this.isShown) {
|
176
|
+
$(document).off('keyup.dismiss.modal')
|
177
|
+
}
|
178
|
+
}
|
179
|
+
|
180
|
+
|
181
|
+
/* MODAL PLUGIN DEFINITION
|
182
|
+
* ======================= */
|
183
|
+
|
184
|
+
$.fn.modal = function (option) {
|
185
|
+
return this.each(function () {
|
186
|
+
var $this = $(this)
|
187
|
+
, data = $this.data('modal')
|
188
|
+
, options = $.extend({}, $.fn.modal.defaults, $this.data(), typeof option == 'object' && option)
|
189
|
+
if (!data) $this.data('modal', (data = new Modal(this, options)))
|
190
|
+
if (typeof option == 'string') data[option]()
|
191
|
+
else if (options.show) data.show()
|
192
|
+
})
|
193
|
+
}
|
194
|
+
|
195
|
+
$.fn.modal.defaults = {
|
196
|
+
backdrop: true
|
197
|
+
, keyboard: true
|
198
|
+
, show: true
|
199
|
+
}
|
200
|
+
|
201
|
+
$.fn.modal.Constructor = Modal
|
202
|
+
|
203
|
+
|
204
|
+
/* MODAL DATA-API
|
205
|
+
* ============== */
|
206
|
+
|
207
|
+
$(function () {
|
208
|
+
$('body').on('click.modal.data-api', '[data-toggle="modal"]', function ( e ) {
|
209
|
+
var $this = $(this), href
|
210
|
+
, $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
|
211
|
+
, option = $target.data('modal') ? 'toggle' : $.extend({}, $target.data(), $this.data())
|
212
|
+
|
213
|
+
e.preventDefault()
|
214
|
+
$target.modal(option)
|
215
|
+
})
|
216
|
+
})
|
217
|
+
|
218
|
+
}(window.jQuery);
|
@@ -0,0 +1,98 @@
|
|
1
|
+
/* ===========================================================
|
2
|
+
* bootstrap-popover.js v2.0.4
|
3
|
+
* http://twitter.github.com/bootstrap/javascript.html#popovers
|
4
|
+
* ===========================================================
|
5
|
+
* Copyright 2012 Twitter, Inc.
|
6
|
+
*
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
* you may not use this file except in compliance with the License.
|
9
|
+
* You may obtain a copy of the License at
|
10
|
+
*
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
*
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
+
* See the License for the specific language governing permissions and
|
17
|
+
* limitations under the License.
|
18
|
+
* =========================================================== */
|
19
|
+
|
20
|
+
|
21
|
+
!function ($) {
|
22
|
+
|
23
|
+
"use strict"; // jshint ;_;
|
24
|
+
|
25
|
+
|
26
|
+
/* POPOVER PUBLIC CLASS DEFINITION
|
27
|
+
* =============================== */
|
28
|
+
|
29
|
+
var Popover = function ( element, options ) {
|
30
|
+
this.init('popover', element, options)
|
31
|
+
}
|
32
|
+
|
33
|
+
|
34
|
+
/* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js
|
35
|
+
========================================== */
|
36
|
+
|
37
|
+
Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype, {
|
38
|
+
|
39
|
+
constructor: Popover
|
40
|
+
|
41
|
+
, setContent: function () {
|
42
|
+
var $tip = this.tip()
|
43
|
+
, title = this.getTitle()
|
44
|
+
, content = this.getContent()
|
45
|
+
|
46
|
+
$tip.find('.popover-title')[this.isHTML(title) ? 'html' : 'text'](title)
|
47
|
+
$tip.find('.popover-content > *')[this.isHTML(content) ? 'html' : 'text'](content)
|
48
|
+
|
49
|
+
$tip.removeClass('fade top bottom left right in')
|
50
|
+
}
|
51
|
+
|
52
|
+
, hasContent: function () {
|
53
|
+
return this.getTitle() || this.getContent()
|
54
|
+
}
|
55
|
+
|
56
|
+
, getContent: function () {
|
57
|
+
var content
|
58
|
+
, $e = this.$element
|
59
|
+
, o = this.options
|
60
|
+
|
61
|
+
content = $e.attr('data-content')
|
62
|
+
|| (typeof o.content == 'function' ? o.content.call($e[0]) : o.content)
|
63
|
+
|
64
|
+
return content
|
65
|
+
}
|
66
|
+
|
67
|
+
, tip: function () {
|
68
|
+
if (!this.$tip) {
|
69
|
+
this.$tip = $(this.options.template)
|
70
|
+
}
|
71
|
+
return this.$tip
|
72
|
+
}
|
73
|
+
|
74
|
+
})
|
75
|
+
|
76
|
+
|
77
|
+
/* POPOVER PLUGIN DEFINITION
|
78
|
+
* ======================= */
|
79
|
+
|
80
|
+
$.fn.popover = function (option) {
|
81
|
+
return this.each(function () {
|
82
|
+
var $this = $(this)
|
83
|
+
, data = $this.data('popover')
|
84
|
+
, options = typeof option == 'object' && option
|
85
|
+
if (!data) $this.data('popover', (data = new Popover(this, options)))
|
86
|
+
if (typeof option == 'string') data[option]()
|
87
|
+
})
|
88
|
+
}
|
89
|
+
|
90
|
+
$.fn.popover.Constructor = Popover
|
91
|
+
|
92
|
+
$.fn.popover.defaults = $.extend({} , $.fn.tooltip.defaults, {
|
93
|
+
placement: 'right'
|
94
|
+
, content: ''
|
95
|
+
, template: '<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><p></p></div></div></div>'
|
96
|
+
})
|
97
|
+
|
98
|
+
}(window.jQuery);
|
@@ -0,0 +1,151 @@
|
|
1
|
+
/* =============================================================
|
2
|
+
* bootstrap-scrollspy.js v2.0.4
|
3
|
+
* http://twitter.github.com/bootstrap/javascript.html#scrollspy
|
4
|
+
* =============================================================
|
5
|
+
* Copyright 2012 Twitter, Inc.
|
6
|
+
*
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
* you may not use this file except in compliance with the License.
|
9
|
+
* You may obtain a copy of the License at
|
10
|
+
*
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
*
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
+
* See the License for the specific language governing permissions and
|
17
|
+
* limitations under the License.
|
18
|
+
* ============================================================== */
|
19
|
+
|
20
|
+
|
21
|
+
!function ($) {
|
22
|
+
|
23
|
+
"use strict"; // jshint ;_;
|
24
|
+
|
25
|
+
|
26
|
+
/* SCROLLSPY CLASS DEFINITION
|
27
|
+
* ========================== */
|
28
|
+
|
29
|
+
function ScrollSpy( element, options) {
|
30
|
+
var process = $.proxy(this.process, this)
|
31
|
+
, $element = $(element).is('body') ? $(window) : $(element)
|
32
|
+
, href
|
33
|
+
this.options = $.extend({}, $.fn.scrollspy.defaults, options)
|
34
|
+
this.$scrollElement = $element.on('scroll.scroll.data-api', process)
|
35
|
+
this.selector = (this.options.target
|
36
|
+
|| ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
|
37
|
+
|| '') + ' .nav li > a'
|
38
|
+
this.$body = $('body')
|
39
|
+
this.refresh()
|
40
|
+
this.process()
|
41
|
+
}
|
42
|
+
|
43
|
+
ScrollSpy.prototype = {
|
44
|
+
|
45
|
+
constructor: ScrollSpy
|
46
|
+
|
47
|
+
, refresh: function () {
|
48
|
+
var self = this
|
49
|
+
, $targets
|
50
|
+
|
51
|
+
this.offsets = $([])
|
52
|
+
this.targets = $([])
|
53
|
+
|
54
|
+
$targets = this.$body
|
55
|
+
.find(this.selector)
|
56
|
+
.map(function () {
|
57
|
+
var $el = $(this)
|
58
|
+
, href = $el.data('target') || $el.attr('href')
|
59
|
+
, $href = /^#\w/.test(href) && $(href)
|
60
|
+
return ( $href
|
61
|
+
&& href.length
|
62
|
+
&& [[ $href.position().top, href ]] ) || null
|
63
|
+
})
|
64
|
+
.sort(function (a, b) { return a[0] - b[0] })
|
65
|
+
.each(function () {
|
66
|
+
self.offsets.push(this[0])
|
67
|
+
self.targets.push(this[1])
|
68
|
+
})
|
69
|
+
}
|
70
|
+
|
71
|
+
, process: function () {
|
72
|
+
var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
|
73
|
+
, scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight
|
74
|
+
, maxScroll = scrollHeight - this.$scrollElement.height()
|
75
|
+
, offsets = this.offsets
|
76
|
+
, targets = this.targets
|
77
|
+
, activeTarget = this.activeTarget
|
78
|
+
, i
|
79
|
+
|
80
|
+
if (scrollTop >= maxScroll) {
|
81
|
+
return activeTarget != (i = targets.last()[0])
|
82
|
+
&& this.activate ( i )
|
83
|
+
}
|
84
|
+
|
85
|
+
for (i = offsets.length; i--;) {
|
86
|
+
activeTarget != targets[i]
|
87
|
+
&& scrollTop >= offsets[i]
|
88
|
+
&& (!offsets[i + 1] || scrollTop <= offsets[i + 1])
|
89
|
+
&& this.activate( targets[i] )
|
90
|
+
}
|
91
|
+
}
|
92
|
+
|
93
|
+
, activate: function (target) {
|
94
|
+
var active
|
95
|
+
, selector
|
96
|
+
|
97
|
+
this.activeTarget = target
|
98
|
+
|
99
|
+
$(this.selector)
|
100
|
+
.parent('.active')
|
101
|
+
.removeClass('active')
|
102
|
+
|
103
|
+
selector = this.selector
|
104
|
+
+ '[data-target="' + target + '"],'
|
105
|
+
+ this.selector + '[href="' + target + '"]'
|
106
|
+
|
107
|
+
active = $(selector)
|
108
|
+
.parent('li')
|
109
|
+
.addClass('active')
|
110
|
+
|
111
|
+
if (active.parent('.dropdown-menu')) {
|
112
|
+
active = active.closest('li.dropdown').addClass('active')
|
113
|
+
}
|
114
|
+
|
115
|
+
active.trigger('activate')
|
116
|
+
}
|
117
|
+
|
118
|
+
}
|
119
|
+
|
120
|
+
|
121
|
+
/* SCROLLSPY PLUGIN DEFINITION
|
122
|
+
* =========================== */
|
123
|
+
|
124
|
+
$.fn.scrollspy = function ( option ) {
|
125
|
+
return this.each(function () {
|
126
|
+
var $this = $(this)
|
127
|
+
, data = $this.data('scrollspy')
|
128
|
+
, options = typeof option == 'object' && option
|
129
|
+
if (!data) $this.data('scrollspy', (data = new ScrollSpy(this, options)))
|
130
|
+
if (typeof option == 'string') data[option]()
|
131
|
+
})
|
132
|
+
}
|
133
|
+
|
134
|
+
$.fn.scrollspy.Constructor = ScrollSpy
|
135
|
+
|
136
|
+
$.fn.scrollspy.defaults = {
|
137
|
+
offset: 10
|
138
|
+
}
|
139
|
+
|
140
|
+
|
141
|
+
/* SCROLLSPY DATA-API
|
142
|
+
* ================== */
|
143
|
+
|
144
|
+
$(function () {
|
145
|
+
$('[data-spy="scroll"]').each(function () {
|
146
|
+
var $spy = $(this)
|
147
|
+
$spy.scrollspy($spy.data())
|
148
|
+
})
|
149
|
+
})
|
150
|
+
|
151
|
+
}(window.jQuery);
|