twbs_sass_rails 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG.md +12 -0
- data/CONTRIBUTING.md +45 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +142 -0
- data/LICENSE +30 -0
- data/README.md +138 -0
- data/Rakefile +108 -0
- data/VERSION +1 -0
- data/app/assets/fonts/fontawesome-webfont.eot +0 -0
- data/app/assets/fonts/fontawesome-webfont.svg +399 -0
- data/app/assets/fonts/fontawesome-webfont.ttf +0 -0
- data/app/assets/fonts/fontawesome-webfont.woff +0 -0
- data/app/assets/fonts/glyphicons-halflings-regular.eot +0 -0
- data/app/assets/fonts/glyphicons-halflings-regular.svg +228 -0
- data/app/assets/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/app/assets/fonts/glyphicons-halflings-regular.woff +0 -0
- data/gemfiles/Gemfile.rails-3.2.x +9 -0
- data/gemfiles/Gemfile.rails-4.0.x +9 -0
- data/lib/generators/twbs_sass_rails/install/install_generator.rb +31 -0
- data/lib/generators/twbs_sass_rails/install/templates/application.css +15 -0
- data/lib/generators/twbs_sass_rails/install/templates/application.js +17 -0
- data/lib/generators/twbs_sass_rails/install/templates/twbs-variables.css.less +5 -0
- data/lib/generators/twbs_sass_rails/install/templates/twbs.css.less +10 -0
- data/lib/generators/twbs_sass_rails/install/templates/twbs.js.coffee +7 -0
- data/lib/tasks/twbs_sass_rails_tasks.rake +4 -0
- data/lib/twbs_sass_rails/engine.rb +7 -0
- data/lib/twbs_sass_rails/version.rb +3 -0
- data/lib/twbs_sass_rails.rb +4 -0
- data/test/dummy/README.rdoc +28 -0
- data/test/dummy/Rakefile +6 -0
- data/test/dummy/app/assets/images/.keep +0 -0
- data/test/dummy/app/assets/javascripts/application.js +14 -0
- data/test/dummy/app/assets/stylesheets/application.css +15 -0
- data/test/dummy/app/assets/stylesheets/default-twbs.css.less +1 -0
- data/test/dummy/app/assets/stylesheets/test.css.less +5 -0
- data/test/dummy/app/assets/stylesheets/twbs-variables.css.less +6 -0
- data/test/dummy/app/assets/stylesheets/twbs.css.less +10 -0
- data/test/dummy/app/controllers/application_controller.rb +5 -0
- data/test/dummy/app/controllers/concerns/.keep +0 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/mailers/.keep +0 -0
- data/test/dummy/app/models/.keep +0 -0
- data/test/dummy/app/models/concerns/.keep +0 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/bin/bundle +3 -0
- data/test/dummy/bin/rails +4 -0
- data/test/dummy/bin/rake +4 -0
- data/test/dummy/config/application.rb +27 -0
- data/test/dummy/config/boot.rb +5 -0
- data/test/dummy/config/database.yml +25 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +29 -0
- data/test/dummy/config/environments/production.rb +80 -0
- data/test/dummy/config/environments/test.rb +36 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/dummy/config/initializers/inflections.rb +16 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/secret_token.rb +18 -0
- data/test/dummy/config/initializers/session_store.rb +3 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +23 -0
- data/test/dummy/config/routes.rb +56 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/db/.keep +0 -0
- data/test/dummy/lib/assets/.keep +0 -0
- data/test/dummy/log/.keep +0 -0
- data/test/dummy/public/404.html +58 -0
- data/test/dummy/public/422.html +58 -0
- data/test/dummy/public/500.html +57 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/generators/default_rails_assets/application.css +13 -0
- data/test/generators/default_rails_assets/application.js +16 -0
- data/test/generators/install_generator_test.rb +47 -0
- data/test/integration/assets_precompile_integration_test.rb +49 -0
- data/test/integration/twbs_sass_rails_integration_test.rb +37 -0
- data/test/test_helper.rb +38 -0
- data/twbs_sass_rails.gemspec +34 -0
- data/vendor/assets/javascripts/respond.js +342 -0
- data/vendor/assets/javascripts/twbs/bootstrap/affix.js +126 -0
- data/vendor/assets/javascripts/twbs/bootstrap/alert.js +98 -0
- data/vendor/assets/javascripts/twbs/bootstrap/button.js +109 -0
- data/vendor/assets/javascripts/twbs/bootstrap/carousel.js +217 -0
- data/vendor/assets/javascripts/twbs/bootstrap/collapse.js +179 -0
- data/vendor/assets/javascripts/twbs/bootstrap/dropdown.js +154 -0
- data/vendor/assets/javascripts/twbs/bootstrap/modal.js +246 -0
- data/vendor/assets/javascripts/twbs/bootstrap/popover.js +117 -0
- data/vendor/assets/javascripts/twbs/bootstrap/scrollspy.js +158 -0
- data/vendor/assets/javascripts/twbs/bootstrap/tab.js +135 -0
- data/vendor/assets/javascripts/twbs/bootstrap/tooltip.js +386 -0
- data/vendor/assets/javascripts/twbs/bootstrap/transition.js +56 -0
- data/vendor/assets/javascripts/twbs/bootstrap.js +12 -0
- data/vendor/assets/stylesheets/fontawesome/bootstrap.less +84 -0
- data/vendor/assets/stylesheets/fontawesome/core.less +129 -0
- data/vendor/assets/stylesheets/fontawesome/extras.less +93 -0
- data/vendor/assets/stylesheets/fontawesome/font-awesome.less +33 -0
- data/vendor/assets/stylesheets/fontawesome/icons.less +381 -0
- data/vendor/assets/stylesheets/fontawesome/mixins.less +48 -0
- data/vendor/assets/stylesheets/fontawesome/path.less +14 -0
- data/vendor/assets/stylesheets/fontawesome/variables.less +735 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/alerts.less +67 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/badges.less +51 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/bootstrap.less +58 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/breadcrumbs.less +23 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/button-groups.less +248 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/buttons.less +160 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/carousel.less +209 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/close.less +33 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/code.less +56 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/component-animations.less +29 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/dropdowns.less +193 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/forms.less +362 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/glyphicons.less +236 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/grid.less +346 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/input-groups.less +127 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/jumbotron.less +40 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/labels.less +58 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/list-group.less +88 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/media.less +56 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/mixins.less +744 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/modals.less +141 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/navbar.less +621 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/navs.less +248 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/normalize.less +396 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/pager.less +55 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/pagination.less +85 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/panels.less +148 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/popovers.less +133 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/print.less +100 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/progress-bars.less +95 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/responsive-utilities.less +220 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/scaffolding.less +130 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/tables.less +238 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/theme.less +241 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/thumbnails.less +32 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/tooltip.less +95 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/type.less +242 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/utilities.less +42 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/variables.less +628 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/wells.less +29 -0
- data/vendor/assets/stylesheets/twbs/bootstrap.less +1 -0
- metadata +388 -0
@@ -0,0 +1,154 @@
|
|
1
|
+
/* ========================================================================
|
2
|
+
* Bootstrap: dropdown.js v3.0.0
|
3
|
+
* http://twbs.github.com/bootstrap/javascript.html#dropdowns
|
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 ($) { "use strict";
|
22
|
+
|
23
|
+
// DROPDOWN CLASS DEFINITION
|
24
|
+
// =========================
|
25
|
+
|
26
|
+
var backdrop = '.dropdown-backdrop'
|
27
|
+
var toggle = '[data-toggle=dropdown]'
|
28
|
+
var Dropdown = function (element) {
|
29
|
+
var $el = $(element).on('click.bs.dropdown', this.toggle)
|
30
|
+
}
|
31
|
+
|
32
|
+
Dropdown.prototype.toggle = function (e) {
|
33
|
+
var $this = $(this)
|
34
|
+
|
35
|
+
if ($this.is('.disabled, :disabled')) return
|
36
|
+
|
37
|
+
var $parent = getParent($this)
|
38
|
+
var isActive = $parent.hasClass('open')
|
39
|
+
|
40
|
+
clearMenus()
|
41
|
+
|
42
|
+
if (!isActive) {
|
43
|
+
if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
|
44
|
+
// if mobile we we use a backdrop because click events don't delegate
|
45
|
+
$('<div class="dropdown-backdrop"/>').insertAfter($(this)).on('click', clearMenus)
|
46
|
+
}
|
47
|
+
|
48
|
+
$parent.trigger(e = $.Event('show.bs.dropdown'))
|
49
|
+
|
50
|
+
if (e.isDefaultPrevented()) return
|
51
|
+
|
52
|
+
$parent
|
53
|
+
.toggleClass('open')
|
54
|
+
.trigger('shown.bs.dropdown')
|
55
|
+
|
56
|
+
$this.focus()
|
57
|
+
}
|
58
|
+
|
59
|
+
return false
|
60
|
+
}
|
61
|
+
|
62
|
+
Dropdown.prototype.keydown = function (e) {
|
63
|
+
if (!/(38|40|27)/.test(e.keyCode)) return
|
64
|
+
|
65
|
+
var $this = $(this)
|
66
|
+
|
67
|
+
e.preventDefault()
|
68
|
+
e.stopPropagation()
|
69
|
+
|
70
|
+
if ($this.is('.disabled, :disabled')) return
|
71
|
+
|
72
|
+
var $parent = getParent($this)
|
73
|
+
var isActive = $parent.hasClass('open')
|
74
|
+
|
75
|
+
if (!isActive || (isActive && e.keyCode == 27)) {
|
76
|
+
if (e.which == 27) $parent.find(toggle).focus()
|
77
|
+
return $this.click()
|
78
|
+
}
|
79
|
+
|
80
|
+
var $items = $('[role=menu] li:not(.divider):visible a', $parent)
|
81
|
+
|
82
|
+
if (!$items.length) return
|
83
|
+
|
84
|
+
var index = $items.index($items.filter(':focus'))
|
85
|
+
|
86
|
+
if (e.keyCode == 38 && index > 0) index-- // up
|
87
|
+
if (e.keyCode == 40 && index < $items.length - 1) index++ // down
|
88
|
+
if (!~index) index=0
|
89
|
+
|
90
|
+
$items.eq(index).focus()
|
91
|
+
}
|
92
|
+
|
93
|
+
function clearMenus() {
|
94
|
+
$(backdrop).remove()
|
95
|
+
$(toggle).each(function (e) {
|
96
|
+
var $parent = getParent($(this))
|
97
|
+
if (!$parent.hasClass('open')) return
|
98
|
+
$parent.trigger(e = $.Event('hide.bs.dropdown'))
|
99
|
+
if (e.isDefaultPrevented()) return
|
100
|
+
$parent.removeClass('open').trigger('hidden.bs.dropdown')
|
101
|
+
})
|
102
|
+
}
|
103
|
+
|
104
|
+
function getParent($this) {
|
105
|
+
var selector = $this.attr('data-target')
|
106
|
+
|
107
|
+
if (!selector) {
|
108
|
+
selector = $this.attr('href')
|
109
|
+
selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
|
110
|
+
}
|
111
|
+
|
112
|
+
var $parent = selector && $(selector)
|
113
|
+
|
114
|
+
return $parent && $parent.length ? $parent : $this.parent()
|
115
|
+
}
|
116
|
+
|
117
|
+
|
118
|
+
// DROPDOWN PLUGIN DEFINITION
|
119
|
+
// ==========================
|
120
|
+
|
121
|
+
var old = $.fn.dropdown
|
122
|
+
|
123
|
+
$.fn.dropdown = function (option) {
|
124
|
+
return this.each(function () {
|
125
|
+
var $this = $(this)
|
126
|
+
var data = $this.data('dropdown')
|
127
|
+
|
128
|
+
if (!data) $this.data('dropdown', (data = new Dropdown(this)))
|
129
|
+
if (typeof option == 'string') data[option].call($this)
|
130
|
+
})
|
131
|
+
}
|
132
|
+
|
133
|
+
$.fn.dropdown.Constructor = Dropdown
|
134
|
+
|
135
|
+
|
136
|
+
// DROPDOWN NO CONFLICT
|
137
|
+
// ====================
|
138
|
+
|
139
|
+
$.fn.dropdown.noConflict = function () {
|
140
|
+
$.fn.dropdown = old
|
141
|
+
return this
|
142
|
+
}
|
143
|
+
|
144
|
+
|
145
|
+
// APPLY TO STANDARD DROPDOWN ELEMENTS
|
146
|
+
// ===================================
|
147
|
+
|
148
|
+
$(document)
|
149
|
+
.on('click.bs.dropdown.data-api', clearMenus)
|
150
|
+
.on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
|
151
|
+
.on('click.bs.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
|
152
|
+
.on('keydown.bs.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
|
153
|
+
|
154
|
+
}(window.jQuery);
|
@@ -0,0 +1,246 @@
|
|
1
|
+
/* ========================================================================
|
2
|
+
* Bootstrap: modal.js v3.0.0
|
3
|
+
* http://twbs.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 ($) { "use strict";
|
22
|
+
|
23
|
+
// MODAL CLASS DEFINITION
|
24
|
+
// ======================
|
25
|
+
|
26
|
+
var Modal = function (element, options) {
|
27
|
+
this.options = options
|
28
|
+
this.$element = $(element)
|
29
|
+
this.$backdrop =
|
30
|
+
this.isShown = null
|
31
|
+
|
32
|
+
if (this.options.remote) this.$element.load(this.options.remote)
|
33
|
+
}
|
34
|
+
|
35
|
+
Modal.DEFAULTS = {
|
36
|
+
backdrop: true
|
37
|
+
, keyboard: true
|
38
|
+
, show: true
|
39
|
+
}
|
40
|
+
|
41
|
+
Modal.prototype.toggle = function (_relatedTarget) {
|
42
|
+
return this[!this.isShown ? 'show' : 'hide'](_relatedTarget)
|
43
|
+
}
|
44
|
+
|
45
|
+
Modal.prototype.show = function (_relatedTarget) {
|
46
|
+
var that = this
|
47
|
+
var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
|
48
|
+
|
49
|
+
this.$element.trigger(e)
|
50
|
+
|
51
|
+
if (this.isShown || e.isDefaultPrevented()) return
|
52
|
+
|
53
|
+
this.isShown = true
|
54
|
+
|
55
|
+
this.escape()
|
56
|
+
|
57
|
+
this.$element.on('click.dismiss.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
|
58
|
+
|
59
|
+
this.backdrop(function () {
|
60
|
+
var transition = $.support.transition && that.$element.hasClass('fade')
|
61
|
+
|
62
|
+
if (!that.$element.parent().length) {
|
63
|
+
that.$element.appendTo(document.body) // don't move modals dom position
|
64
|
+
}
|
65
|
+
|
66
|
+
that.$element.show()
|
67
|
+
|
68
|
+
if (transition) {
|
69
|
+
that.$element[0].offsetWidth // force reflow
|
70
|
+
}
|
71
|
+
|
72
|
+
that.$element
|
73
|
+
.addClass('in')
|
74
|
+
.attr('aria-hidden', false)
|
75
|
+
|
76
|
+
that.enforceFocus()
|
77
|
+
|
78
|
+
var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget })
|
79
|
+
|
80
|
+
transition ?
|
81
|
+
that.$element.find('.modal-dialog') // wait for modal to slide in
|
82
|
+
.one($.support.transition.end, function () {
|
83
|
+
that.$element.focus().trigger(e)
|
84
|
+
})
|
85
|
+
.emulateTransitionEnd(300) :
|
86
|
+
that.$element.focus().trigger(e)
|
87
|
+
})
|
88
|
+
}
|
89
|
+
|
90
|
+
Modal.prototype.hide = function (e) {
|
91
|
+
if (e) e.preventDefault()
|
92
|
+
|
93
|
+
e = $.Event('hide.bs.modal')
|
94
|
+
|
95
|
+
this.$element.trigger(e)
|
96
|
+
|
97
|
+
if (!this.isShown || e.isDefaultPrevented()) return
|
98
|
+
|
99
|
+
this.isShown = false
|
100
|
+
|
101
|
+
this.escape()
|
102
|
+
|
103
|
+
$(document).off('focusin.bs.modal')
|
104
|
+
|
105
|
+
this.$element
|
106
|
+
.removeClass('in')
|
107
|
+
.attr('aria-hidden', true)
|
108
|
+
.off('click.dismiss.modal')
|
109
|
+
|
110
|
+
$.support.transition && this.$element.hasClass('fade') ?
|
111
|
+
this.$element
|
112
|
+
.one($.support.transition.end, $.proxy(this.hideModal, this))
|
113
|
+
.emulateTransitionEnd(300) :
|
114
|
+
this.hideModal()
|
115
|
+
}
|
116
|
+
|
117
|
+
Modal.prototype.enforceFocus = function () {
|
118
|
+
$(document)
|
119
|
+
.off('focusin.bs.modal') // guard against infinite focus loop
|
120
|
+
.on('focusin.bs.modal', $.proxy(function (e) {
|
121
|
+
if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {
|
122
|
+
this.$element.focus()
|
123
|
+
}
|
124
|
+
}, this))
|
125
|
+
}
|
126
|
+
|
127
|
+
Modal.prototype.escape = function () {
|
128
|
+
if (this.isShown && this.options.keyboard) {
|
129
|
+
this.$element.on('keyup.dismiss.bs.modal', $.proxy(function (e) {
|
130
|
+
e.which == 27 && this.hide()
|
131
|
+
}, this))
|
132
|
+
} else if (!this.isShown) {
|
133
|
+
this.$element.off('keyup.dismiss.bs.modal')
|
134
|
+
}
|
135
|
+
}
|
136
|
+
|
137
|
+
Modal.prototype.hideModal = function () {
|
138
|
+
var that = this
|
139
|
+
this.$element.hide()
|
140
|
+
this.backdrop(function () {
|
141
|
+
that.removeBackdrop()
|
142
|
+
that.$element.trigger('hidden.bs.modal')
|
143
|
+
})
|
144
|
+
}
|
145
|
+
|
146
|
+
Modal.prototype.removeBackdrop = function () {
|
147
|
+
this.$backdrop && this.$backdrop.remove()
|
148
|
+
this.$backdrop = null
|
149
|
+
}
|
150
|
+
|
151
|
+
Modal.prototype.backdrop = function (callback) {
|
152
|
+
var that = this
|
153
|
+
var animate = this.$element.hasClass('fade') ? 'fade' : ''
|
154
|
+
|
155
|
+
if (this.isShown && this.options.backdrop) {
|
156
|
+
var doAnimate = $.support.transition && animate
|
157
|
+
|
158
|
+
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
|
159
|
+
.appendTo(document.body)
|
160
|
+
|
161
|
+
this.$element.on('click.dismiss.modal', $.proxy(function (e) {
|
162
|
+
if (e.target !== e.currentTarget) return
|
163
|
+
this.options.backdrop == 'static'
|
164
|
+
? this.$element[0].focus.call(this.$element[0])
|
165
|
+
: this.hide.call(this)
|
166
|
+
}, this))
|
167
|
+
|
168
|
+
if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
|
169
|
+
|
170
|
+
this.$backdrop.addClass('in')
|
171
|
+
|
172
|
+
if (!callback) return
|
173
|
+
|
174
|
+
doAnimate ?
|
175
|
+
this.$backdrop
|
176
|
+
.one($.support.transition.end, callback)
|
177
|
+
.emulateTransitionEnd(150) :
|
178
|
+
callback()
|
179
|
+
|
180
|
+
} else if (!this.isShown && this.$backdrop) {
|
181
|
+
this.$backdrop.removeClass('in')
|
182
|
+
|
183
|
+
$.support.transition && this.$element.hasClass('fade')?
|
184
|
+
this.$backdrop
|
185
|
+
.one($.support.transition.end, callback)
|
186
|
+
.emulateTransitionEnd(150) :
|
187
|
+
callback()
|
188
|
+
|
189
|
+
} else if (callback) {
|
190
|
+
callback()
|
191
|
+
}
|
192
|
+
}
|
193
|
+
|
194
|
+
|
195
|
+
// MODAL PLUGIN DEFINITION
|
196
|
+
// =======================
|
197
|
+
|
198
|
+
var old = $.fn.modal
|
199
|
+
|
200
|
+
$.fn.modal = function (option, _relatedTarget) {
|
201
|
+
return this.each(function () {
|
202
|
+
var $this = $(this)
|
203
|
+
var data = $this.data('bs.modal')
|
204
|
+
var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
|
205
|
+
|
206
|
+
if (!data) $this.data('bs.modal', (data = new Modal(this, options)))
|
207
|
+
if (typeof option == 'string') data[option](_relatedTarget)
|
208
|
+
else if (options.show) data.show(_relatedTarget)
|
209
|
+
})
|
210
|
+
}
|
211
|
+
|
212
|
+
$.fn.modal.Constructor = Modal
|
213
|
+
|
214
|
+
|
215
|
+
// MODAL NO CONFLICT
|
216
|
+
// =================
|
217
|
+
|
218
|
+
$.fn.modal.noConflict = function () {
|
219
|
+
$.fn.modal = old
|
220
|
+
return this
|
221
|
+
}
|
222
|
+
|
223
|
+
|
224
|
+
// MODAL DATA-API
|
225
|
+
// ==============
|
226
|
+
|
227
|
+
$(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
|
228
|
+
var $this = $(this)
|
229
|
+
var href = $this.attr('href')
|
230
|
+
var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
|
231
|
+
var option = $target.data('modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
|
232
|
+
|
233
|
+
e.preventDefault()
|
234
|
+
|
235
|
+
$target
|
236
|
+
.modal(option, this)
|
237
|
+
.one('hide', function () {
|
238
|
+
$this.is(':visible') && $this.focus()
|
239
|
+
})
|
240
|
+
})
|
241
|
+
|
242
|
+
$(document)
|
243
|
+
.on('show.bs.modal', '.modal', function () { $(document.body).addClass('modal-open') })
|
244
|
+
.on('hidden.bs.modal', '.modal', function () { $(document.body).removeClass('modal-open') })
|
245
|
+
|
246
|
+
}(window.jQuery);
|
@@ -0,0 +1,117 @@
|
|
1
|
+
/* ========================================================================
|
2
|
+
* Bootstrap: popover.js v3.0.0
|
3
|
+
* http://twbs.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 ($) { "use strict";
|
22
|
+
|
23
|
+
// POPOVER PUBLIC CLASS DEFINITION
|
24
|
+
// ===============================
|
25
|
+
|
26
|
+
var Popover = function (element, options) {
|
27
|
+
this.init('popover', element, options)
|
28
|
+
}
|
29
|
+
|
30
|
+
if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
|
31
|
+
|
32
|
+
Popover.DEFAULTS = $.extend({} , $.fn.tooltip.Constructor.DEFAULTS, {
|
33
|
+
placement: 'right'
|
34
|
+
, trigger: 'click'
|
35
|
+
, content: ''
|
36
|
+
, template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
|
37
|
+
})
|
38
|
+
|
39
|
+
|
40
|
+
// NOTE: POPOVER EXTENDS tooltip.js
|
41
|
+
// ================================
|
42
|
+
|
43
|
+
Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype)
|
44
|
+
|
45
|
+
Popover.prototype.constructor = Popover
|
46
|
+
|
47
|
+
Popover.prototype.getDefaults = function () {
|
48
|
+
return Popover.DEFAULTS
|
49
|
+
}
|
50
|
+
|
51
|
+
Popover.prototype.setContent = function () {
|
52
|
+
var $tip = this.tip()
|
53
|
+
var title = this.getTitle()
|
54
|
+
var content = this.getContent()
|
55
|
+
|
56
|
+
$tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
|
57
|
+
$tip.find('.popover-content')[this.options.html ? 'html' : 'text'](content)
|
58
|
+
|
59
|
+
$tip.removeClass('fade top bottom left right in')
|
60
|
+
|
61
|
+
// IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do
|
62
|
+
// this manually by checking the contents.
|
63
|
+
if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide()
|
64
|
+
}
|
65
|
+
|
66
|
+
Popover.prototype.hasContent = function () {
|
67
|
+
return this.getTitle() || this.getContent()
|
68
|
+
}
|
69
|
+
|
70
|
+
Popover.prototype.getContent = function () {
|
71
|
+
var $e = this.$element
|
72
|
+
var o = this.options
|
73
|
+
|
74
|
+
return $e.attr('data-content')
|
75
|
+
|| (typeof o.content == 'function' ?
|
76
|
+
o.content.call($e[0]) :
|
77
|
+
o.content)
|
78
|
+
}
|
79
|
+
|
80
|
+
Popover.prototype.arrow = function () {
|
81
|
+
return this.$arrow = this.$arrow || this.tip().find('.arrow')
|
82
|
+
}
|
83
|
+
|
84
|
+
Popover.prototype.tip = function () {
|
85
|
+
if (!this.$tip) this.$tip = $(this.options.template)
|
86
|
+
return this.$tip
|
87
|
+
}
|
88
|
+
|
89
|
+
|
90
|
+
// POPOVER PLUGIN DEFINITION
|
91
|
+
// =========================
|
92
|
+
|
93
|
+
var old = $.fn.popover
|
94
|
+
|
95
|
+
$.fn.popover = function (option) {
|
96
|
+
return this.each(function () {
|
97
|
+
var $this = $(this)
|
98
|
+
var data = $this.data('bs.popover')
|
99
|
+
var options = typeof option == 'object' && option
|
100
|
+
|
101
|
+
if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
|
102
|
+
if (typeof option == 'string') data[option]()
|
103
|
+
})
|
104
|
+
}
|
105
|
+
|
106
|
+
$.fn.popover.Constructor = Popover
|
107
|
+
|
108
|
+
|
109
|
+
// POPOVER NO CONFLICT
|
110
|
+
// ===================
|
111
|
+
|
112
|
+
$.fn.popover.noConflict = function () {
|
113
|
+
$.fn.popover = old
|
114
|
+
return this
|
115
|
+
}
|
116
|
+
|
117
|
+
}(window.jQuery);
|
@@ -0,0 +1,158 @@
|
|
1
|
+
/* ========================================================================
|
2
|
+
* Bootstrap: scrollspy.js v3.0.0
|
3
|
+
* http://twbs.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 ($) { "use strict";
|
22
|
+
|
23
|
+
// SCROLLSPY CLASS DEFINITION
|
24
|
+
// ==========================
|
25
|
+
|
26
|
+
function ScrollSpy(element, options) {
|
27
|
+
var href
|
28
|
+
var process = $.proxy(this.process, this)
|
29
|
+
|
30
|
+
this.$element = $(element).is('body') ? $(window) : $(element)
|
31
|
+
this.$body = $('body')
|
32
|
+
this.$scrollElement = this.$element.on('scroll.bs.scroll-spy.data-api', process)
|
33
|
+
this.options = $.extend({}, ScrollSpy.DEFAULTS, options)
|
34
|
+
this.selector = (this.options.target
|
35
|
+
|| ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
|
36
|
+
|| '') + ' .nav li > a'
|
37
|
+
this.offsets = $([])
|
38
|
+
this.targets = $([])
|
39
|
+
this.activeTarget = null
|
40
|
+
|
41
|
+
this.refresh()
|
42
|
+
this.process()
|
43
|
+
}
|
44
|
+
|
45
|
+
ScrollSpy.DEFAULTS = {
|
46
|
+
offset: 10
|
47
|
+
}
|
48
|
+
|
49
|
+
ScrollSpy.prototype.refresh = function () {
|
50
|
+
var offsetMethod = this.$element[0] == window ? 'offset' : 'position'
|
51
|
+
|
52
|
+
this.offsets = $([])
|
53
|
+
this.targets = $([])
|
54
|
+
|
55
|
+
var self = this
|
56
|
+
var $targets = this.$body
|
57
|
+
.find(this.selector)
|
58
|
+
.map(function () {
|
59
|
+
var $el = $(this)
|
60
|
+
var href = $el.data('target') || $el.attr('href')
|
61
|
+
var $href = /^#\w/.test(href) && $(href)
|
62
|
+
|
63
|
+
return ($href
|
64
|
+
&& $href.length
|
65
|
+
&& [[ $href[offsetMethod]().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href ]]) || null
|
66
|
+
})
|
67
|
+
.sort(function (a, b) { return a[0] - b[0] })
|
68
|
+
.each(function () {
|
69
|
+
self.offsets.push(this[0])
|
70
|
+
self.targets.push(this[1])
|
71
|
+
})
|
72
|
+
}
|
73
|
+
|
74
|
+
ScrollSpy.prototype.process = function () {
|
75
|
+
var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
|
76
|
+
var scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight
|
77
|
+
var maxScroll = scrollHeight - this.$scrollElement.height()
|
78
|
+
var offsets = this.offsets
|
79
|
+
var targets = this.targets
|
80
|
+
var activeTarget = this.activeTarget
|
81
|
+
var i
|
82
|
+
|
83
|
+
if (scrollTop >= maxScroll) {
|
84
|
+
return activeTarget != (i = targets.last()[0]) && this.activate(i)
|
85
|
+
}
|
86
|
+
|
87
|
+
for (i = offsets.length; i--;) {
|
88
|
+
activeTarget != targets[i]
|
89
|
+
&& scrollTop >= offsets[i]
|
90
|
+
&& (!offsets[i + 1] || scrollTop <= offsets[i + 1])
|
91
|
+
&& this.activate( targets[i] )
|
92
|
+
}
|
93
|
+
}
|
94
|
+
|
95
|
+
ScrollSpy.prototype.activate = function (target) {
|
96
|
+
this.activeTarget = target
|
97
|
+
|
98
|
+
$(this.selector)
|
99
|
+
.parents('.active')
|
100
|
+
.removeClass('active')
|
101
|
+
|
102
|
+
var selector = this.selector
|
103
|
+
+ '[data-target="' + target + '"],'
|
104
|
+
+ this.selector + '[href="' + target + '"]'
|
105
|
+
|
106
|
+
var active = $(selector)
|
107
|
+
.parents('li')
|
108
|
+
.addClass('active')
|
109
|
+
|
110
|
+
if (active.parent('.dropdown-menu').length) {
|
111
|
+
active = active
|
112
|
+
.closest('li.dropdown')
|
113
|
+
.addClass('active')
|
114
|
+
}
|
115
|
+
|
116
|
+
active.trigger('activate')
|
117
|
+
}
|
118
|
+
|
119
|
+
|
120
|
+
// SCROLLSPY PLUGIN DEFINITION
|
121
|
+
// ===========================
|
122
|
+
|
123
|
+
var old = $.fn.scrollspy
|
124
|
+
|
125
|
+
$.fn.scrollspy = function (option) {
|
126
|
+
return this.each(function () {
|
127
|
+
var $this = $(this)
|
128
|
+
var data = $this.data('bs.scrollspy')
|
129
|
+
var options = typeof option == 'object' && option
|
130
|
+
|
131
|
+
if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options)))
|
132
|
+
if (typeof option == 'string') data[option]()
|
133
|
+
})
|
134
|
+
}
|
135
|
+
|
136
|
+
$.fn.scrollspy.Constructor = ScrollSpy
|
137
|
+
|
138
|
+
|
139
|
+
// SCROLLSPY NO CONFLICT
|
140
|
+
// =====================
|
141
|
+
|
142
|
+
$.fn.scrollspy.noConflict = function () {
|
143
|
+
$.fn.scrollspy = old
|
144
|
+
return this
|
145
|
+
}
|
146
|
+
|
147
|
+
|
148
|
+
// SCROLLSPY DATA-API
|
149
|
+
// ==================
|
150
|
+
|
151
|
+
$(window).on('load', function () {
|
152
|
+
$('[data-spy="scroll"]').each(function () {
|
153
|
+
var $spy = $(this)
|
154
|
+
$spy.scrollspy($spy.data())
|
155
|
+
})
|
156
|
+
})
|
157
|
+
|
158
|
+
}(window.jQuery);
|