twitter-bootstrap-rails 2.1.1 → 2.1.2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of twitter-bootstrap-rails might be problematic. Click here for more details.
- data/README.md +14 -3
- data/app/helpers/bootstrap_flash_helper.rb +12 -0
- data/lib/generators/bootstrap/layout/templates/layout.html.erb +1 -0
- data/lib/generators/bootstrap/layout/templates/layout.html.haml +1 -0
- data/lib/generators/bootstrap/layout/templates/layout.html.slim +1 -0
- data/lib/generators/bootstrap/partial/partial_generator.rb +20 -0
- data/lib/generators/bootstrap/partial/templates/_login.html.erb +29 -0
- data/lib/generators/bootstrap/partial/templates/_navbar.html.erb +13 -0
- data/lib/generators/bootstrap/themed/templates/index.html.erb +1 -1
- data/lib/generators/bootstrap/themed/templates/index.html.haml +1 -1
- data/lib/generators/bootstrap/themed/templates/index.html.slim +1 -1
- data/lib/generators/bootstrap/themed/templates/show.html.erb +1 -1
- data/lib/generators/bootstrap/themed/templates/show.html.haml +1 -1
- data/lib/generators/bootstrap/themed/templates/show.html.slim +1 -1
- data/lib/twitter/bootstrap/rails/version.rb +1 -1
- data/vendor/assets/javascripts/twitter/bootstrap.js +1 -0
- data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-affix.js +104 -0
- data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-alert.js +1 -1
- data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-button.js +1 -1
- data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-carousel.js +12 -5
- data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-collapse.js +4 -3
- data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-dropdown.js +66 -16
- data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-modal.js +95 -74
- data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-popover.js +9 -4
- data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-scrollspy.js +9 -9
- data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-tab.js +2 -2
- data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-tooltip.js +15 -15
- data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-transition.js +2 -3
- data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-typeahead.js +51 -40
- data/vendor/toolkit/fontawesome.less +5 -5
- data/vendor/toolkit/twitter/bootstrap/accordion.less +3 -2
- data/vendor/toolkit/twitter/bootstrap/alerts.less +16 -9
- data/vendor/toolkit/twitter/bootstrap/bootstrap.less +1 -1
- data/vendor/toolkit/twitter/bootstrap/breadcrumbs.less +10 -10
- data/vendor/toolkit/twitter/bootstrap/button-groups.less +76 -23
- data/vendor/toolkit/twitter/bootstrap/buttons.less +85 -65
- data/vendor/toolkit/twitter/bootstrap/carousel.less +13 -3
- data/vendor/toolkit/twitter/bootstrap/close.less +4 -2
- data/vendor/toolkit/twitter/bootstrap/code.less +6 -5
- data/vendor/toolkit/twitter/bootstrap/component-animations.less +5 -2
- data/vendor/toolkit/twitter/bootstrap/dropdowns.less +81 -14
- data/vendor/toolkit/twitter/bootstrap/forms.less +100 -48
- data/vendor/toolkit/twitter/bootstrap/grid.less +17 -1
- data/vendor/toolkit/twitter/bootstrap/hero-unit.less +4 -2
- data/vendor/toolkit/twitter/bootstrap/labels-badges.less +19 -2
- data/vendor/toolkit/twitter/bootstrap/layouts.less +1 -2
- data/vendor/toolkit/twitter/bootstrap/mixins.less +98 -73
- data/vendor/toolkit/twitter/bootstrap/modals.less +9 -2
- data/vendor/toolkit/twitter/bootstrap/navbar.less +238 -127
- data/vendor/toolkit/twitter/bootstrap/navs.less +38 -17
- data/vendor/toolkit/twitter/bootstrap/pager.less +5 -4
- data/vendor/toolkit/twitter/bootstrap/pagination.less +16 -8
- data/vendor/toolkit/twitter/bootstrap/popovers.less +101 -33
- data/vendor/toolkit/twitter/bootstrap/progress-bars.less +18 -13
- data/vendor/toolkit/twitter/bootstrap/reset.less +6 -3
- data/vendor/toolkit/twitter/bootstrap/responsive-1200px-min.less +9 -7
- data/vendor/toolkit/twitter/bootstrap/responsive-767px-max.less +86 -68
- data/vendor/toolkit/twitter/bootstrap/responsive-768px-979px.less +7 -5
- data/vendor/toolkit/twitter/bootstrap/responsive-navbar.less +18 -5
- data/vendor/toolkit/twitter/bootstrap/responsive-utilities.less +17 -15
- data/vendor/toolkit/twitter/bootstrap/responsive.less +5 -5
- data/vendor/toolkit/twitter/bootstrap/scaffolding.less +26 -4
- data/vendor/toolkit/twitter/bootstrap/sprites.less +15 -19
- data/vendor/toolkit/twitter/bootstrap/tables.less +60 -11
- data/vendor/toolkit/twitter/bootstrap/thumbnails.less +9 -4
- data/vendor/toolkit/twitter/bootstrap/tooltip.less +47 -12
- data/vendor/toolkit/twitter/bootstrap/type.less +57 -92
- data/vendor/toolkit/twitter/bootstrap/utilities.less +9 -2
- data/vendor/toolkit/twitter/bootstrap/variables.less +100 -29
- data/vendor/toolkit/twitter/bootstrap/wells.less +7 -5
- metadata +16 -22
data/README.md
CHANGED
@@ -7,7 +7,6 @@ twitter-bootstrap-rails project integrates Bootstrap CSS toolkit for Rails 3.1 A
|
|
7
7
|
[![Dependency Status](https://gemnasium.com/seyhunak/twitter-bootstrap-rails.png)](https://gemnasium.com/seyhunak/twitter-bootstrap-rails)
|
8
8
|
[![Code Climate](https://codeclimate.com/badge.png)](https://github.com/seyhunak/twitter-bootstrap-rails)
|
9
9
|
|
10
|
-
|
11
10
|
## Screencasts
|
12
11
|
#### Installing twitter-bootstrap-rails, generators, usage and more
|
13
12
|
Screencasts provided by Railscasts (Ryan Bates)
|
@@ -22,10 +21,10 @@ in this episode continues on the Twitter Bootstrap project showing how to displa
|
|
22
21
|
|
23
22
|
## Installing Gem
|
24
23
|
|
25
|
-
Include Bootstrap in Gemfile;
|
24
|
+
Include the [Twitter Bootstrap Rails gem](http://rubygems.org/gems/twitter-bootstrap-rails) in Gemfile to install it from [RubyGems.org](http://rubygems.org);
|
26
25
|
|
27
26
|
```ruby
|
28
|
-
gem "twitter-bootstrap-rails"
|
27
|
+
gem "twitter-bootstrap-rails", :group => :assets
|
29
28
|
```
|
30
29
|
|
31
30
|
or you can install from latest build;
|
@@ -135,6 +134,12 @@ jQuery ->
|
|
135
134
|
$("a[rel=tooltip]").tooltip()
|
136
135
|
```
|
137
136
|
|
137
|
+
## Using Helpers
|
138
|
+
|
139
|
+
### Flash helper
|
140
|
+
Add flash helper <%= bootstrap_flash %> to your layout (built-in with layout generator)
|
141
|
+
|
142
|
+
|
138
143
|
## Using Static CSS, JS (w/o Less)
|
139
144
|
|
140
145
|
twitter-bootstrap-rails has seperate branch (w/o Less) that just serves latest static CSS, JS files.
|
@@ -182,6 +187,8 @@ gem 'twitter-bootstrap-rails', :git => 'git://github.com/seyhunak/twitter-bootst
|
|
182
187
|
<li>Released gem v.2.0.9 (Bootstrap 2.0.4 and FontAwesome 2.0 support)</li>
|
183
188
|
<li>Released gem v.2.1.0 (JRuby support)</li>
|
184
189
|
<li>Released gem v.2.1.1 (minor fixes)</li>
|
190
|
+
<li>Flash block message helper added</li>
|
191
|
+
<li>Released gem v.2.1.2 (minor fixes and updated to Twitter Bootstrap 2.1.0)</li>
|
185
192
|
</ul>
|
186
193
|
|
187
194
|
|
@@ -225,6 +232,10 @@ Seyhun Akyürek - seyhunak [at] gmail com
|
|
225
232
|
|
226
233
|
[Visit My Blog](http://www.seyhunakyurek.com/ "Visit My Blog")
|
227
234
|
|
235
|
+
## Endorse My Skills
|
236
|
+
<a href="http://coderwall.com/seyhunak">
|
237
|
+
<img src="http://api.coderwall.com/seyhunak/endorsecount.png" />
|
238
|
+
</a>
|
228
239
|
|
229
240
|
## Want to Donate?
|
230
241
|
<img src="https://www.paypalobjects.com/en_US/i/logo/PayPal_mark_50x34.gif"></img>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module BootstrapFlashHelper
|
2
|
+
def bootstrap_flash
|
3
|
+
flash_messages = []
|
4
|
+
flash.each do |type, message|
|
5
|
+
type = :success if type == :notice
|
6
|
+
type = :error if type == :alert
|
7
|
+
text = content_tag(:div, link_to("x", "#", :class => "close", "data-dismiss" => "alert") + message, :class => "alert fade in alert-#{type}")
|
8
|
+
flash_messages << text if message
|
9
|
+
end
|
10
|
+
flash_messages.join("\n").html_safe
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'rails/generators'
|
2
|
+
|
3
|
+
module Bootstrap
|
4
|
+
module Generators
|
5
|
+
class PartialGenerator < ::Rails::Generators::Base
|
6
|
+
source_root File.expand_path("../templates", __FILE__)
|
7
|
+
desc "This generator generates bootstrap HTML partials"
|
8
|
+
argument :component_name, :type => :string, :default => "application",
|
9
|
+
:banner => "navbar, navbar-devise, carousel"
|
10
|
+
|
11
|
+
attr_reader :app_name
|
12
|
+
|
13
|
+
def generate_partial
|
14
|
+
app = ::Rails.application
|
15
|
+
ext = app.config.generators.options[:rails][:template_engine] || :erb
|
16
|
+
copy_file "_#{component_name}.html.#{ext}", "app/views/shared/_#{component_name}.html.#{ext}"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<h2>Sign in</h2>
|
2
|
+
|
3
|
+
<%= form_for(resource, :as => resource_name, :url => session_path(resource_name), :html => { :class => 'form-horizontal' }) do |f| %>
|
4
|
+
<div class="control-group">
|
5
|
+
<%= f.label :email, :class => 'control-label' %>
|
6
|
+
<div class="controls">
|
7
|
+
<%= f.email_field :email %>
|
8
|
+
</div>
|
9
|
+
</div>
|
10
|
+
<div class="control-group">
|
11
|
+
<%= f.label :password, :class => 'control-label' %>
|
12
|
+
<div class="controls">
|
13
|
+
<%= f.password_field :password %>
|
14
|
+
</div>
|
15
|
+
</div>
|
16
|
+
|
17
|
+
<% if devise_mapping.rememberable? -%>
|
18
|
+
<div class='control-group' >
|
19
|
+
<%= f.label :remember_me, :class => 'control-label' %>
|
20
|
+
<%= f.check_box :remember_me %>
|
21
|
+
</div>
|
22
|
+
<% end -%>
|
23
|
+
|
24
|
+
<div class="form-actions">
|
25
|
+
<%= f.submit "Sign in", :class => 'btn' %>
|
26
|
+
</div>
|
27
|
+
<% end %>
|
28
|
+
|
29
|
+
<%= render :partial => "devise/shared/links" %>
|
@@ -27,7 +27,7 @@
|
|
27
27
|
<%%= link_to t('.destroy', :default => t("helpers.links.destroy")),
|
28
28
|
<%= singular_controller_routing_path %>_path(<%= resource_name %>),
|
29
29
|
:method => :delete,
|
30
|
-
:confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')),
|
30
|
+
:data => { :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')) },
|
31
31
|
:class => 'btn btn-mini btn-danger' %>
|
32
32
|
</td>
|
33
33
|
</tr>
|
@@ -20,6 +20,6 @@
|
|
20
20
|
%td=l <%= resource_name %>.created_at
|
21
21
|
%td
|
22
22
|
= link_to t('.edit', :default => t("helpers.links.edit")), edit_<%= singular_controller_routing_path %>_path(<%= resource_name %>), :class => 'btn btn-mini'
|
23
|
-
= link_to t('.destroy', :default => t("helpers.links.destroy")), <%= singular_controller_routing_path %>_path(<%= resource_name %>), :method => :delete, :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')), :class => 'btn btn-mini btn-danger'
|
23
|
+
= link_to t('.destroy', :default => t("helpers.links.destroy")), <%= singular_controller_routing_path %>_path(<%= resource_name %>), :method => :delete, :data => { :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')) }, :class => 'btn btn-mini btn-danger'
|
24
24
|
|
25
25
|
= link_to t('.new', :default => t("helpers.links.new")), new_<%= singular_controller_routing_path %>_path, :class => 'btn btn-primary'
|
@@ -21,7 +21,7 @@ table class="table table-striped"
|
|
21
21
|
td
|
22
22
|
= link_to t('.edit', :default => t("helpers.links.edit")), edit_<%= singular_controller_routing_path %>_path(<%= resource_name %>), :class => 'btn btn-mini'
|
23
23
|
'
|
24
|
-
= link_to t('.destroy', :default => t("helpers.links.destroy")), <%= singular_controller_routing_path %>_path(<%= resource_name %>), :method => :delete, :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')), :class => 'btn btn-mini btn-danger'
|
24
|
+
= link_to t('.destroy', :default => t("helpers.links.destroy")), <%= singular_controller_routing_path %>_path(<%= resource_name %>), :method => :delete, :data => { :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')) }, :class => 'btn btn-mini btn-danger'
|
25
25
|
|
26
26
|
= link_to t('.new', :default => t("helpers.links.new")), new_<%= singular_controller_routing_path %>_path, :class => 'btn btn-primary'
|
27
27
|
|
@@ -18,6 +18,6 @@
|
|
18
18
|
<%%= link_to t('.destroy', :default => t("helpers.links.destroy")),
|
19
19
|
<%= singular_controller_routing_path %>_path(@<%= resource_name %>),
|
20
20
|
:method => 'delete',
|
21
|
-
:confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')),
|
21
|
+
:data => { :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')) },
|
22
22
|
:class => 'btn btn-danger' %>
|
23
23
|
</div>
|
@@ -12,4 +12,4 @@
|
|
12
12
|
.form-actions
|
13
13
|
= link_to t('.back', :default => t("helpers.links.back")), <%= controller_routing_path %>_path, :class => 'btn'
|
14
14
|
= link_to t('.edit', :default => t("helpers.links.edit")), edit_<%= singular_controller_routing_path %>_path(@<%= resource_name %>), :class => 'btn'
|
15
|
-
= link_to t('.destroy', :default => t("helpers.links.destroy")), <%= singular_controller_routing_path %>_path(@<%= resource_name %>), :method => "delete", :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')), :class => 'btn btn-danger'
|
15
|
+
= link_to t('.destroy', :default => t("helpers.links.destroy")), <%= singular_controller_routing_path %>_path(@<%= resource_name %>), :method => "delete", :data => { :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')) }, :class => 'btn btn-danger'
|
@@ -14,4 +14,4 @@ p
|
|
14
14
|
'
|
15
15
|
= link_to t('.edit', :default => t("helpers.links.edit")), edit_<%= singular_controller_routing_path %>_path(@<%= resource_name %>), :class => 'btn'
|
16
16
|
'
|
17
|
-
= link_to t('.destroy', :default => t("helpers.links.destroy")), <%= singular_controller_routing_path %>_path(@<%= resource_name %>), :method => "delete", :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')), :class => 'btn btn-danger'
|
17
|
+
= link_to t('.destroy', :default => t("helpers.links.destroy")), <%= singular_controller_routing_path %>_path(@<%= resource_name %>), :method => "delete", :data => { :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')) }, :class => 'btn btn-danger'
|
@@ -0,0 +1,104 @@
|
|
1
|
+
/* ==========================================================
|
2
|
+
* bootstrap-affix.js v2.1.0
|
3
|
+
* http://twitter.github.com/bootstrap/javascript.html#affix
|
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
|
+
/* AFFIX CLASS DEFINITION
|
27
|
+
* ====================== */
|
28
|
+
|
29
|
+
var Affix = function (element, options) {
|
30
|
+
this.options = $.extend({}, $.fn.affix.defaults, options)
|
31
|
+
this.$window = $(window).on('scroll.affix.data-api', $.proxy(this.checkPosition, this))
|
32
|
+
this.$element = $(element)
|
33
|
+
this.checkPosition()
|
34
|
+
}
|
35
|
+
|
36
|
+
Affix.prototype.checkPosition = function () {
|
37
|
+
if (!this.$element.is(':visible')) return
|
38
|
+
|
39
|
+
var scrollHeight = $(document).height()
|
40
|
+
, scrollTop = this.$window.scrollTop()
|
41
|
+
, position = this.$element.offset()
|
42
|
+
, offset = this.options.offset
|
43
|
+
, offsetBottom = offset.bottom
|
44
|
+
, offsetTop = offset.top
|
45
|
+
, reset = 'affix affix-top affix-bottom'
|
46
|
+
, affix
|
47
|
+
|
48
|
+
if (typeof offset != 'object') offsetBottom = offsetTop = offset
|
49
|
+
if (typeof offsetTop == 'function') offsetTop = offset.top()
|
50
|
+
if (typeof offsetBottom == 'function') offsetBottom = offset.bottom()
|
51
|
+
|
52
|
+
affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ?
|
53
|
+
false : offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ?
|
54
|
+
'bottom' : offsetTop != null && scrollTop <= offsetTop ?
|
55
|
+
'top' : false
|
56
|
+
|
57
|
+
if (this.affixed === affix) return
|
58
|
+
|
59
|
+
this.affixed = affix
|
60
|
+
this.unpin = affix == 'bottom' ? position.top - scrollTop : null
|
61
|
+
|
62
|
+
this.$element.removeClass(reset).addClass('affix' + (affix ? '-' + affix : ''))
|
63
|
+
}
|
64
|
+
|
65
|
+
|
66
|
+
/* AFFIX PLUGIN DEFINITION
|
67
|
+
* ======================= */
|
68
|
+
|
69
|
+
$.fn.affix = function (option) {
|
70
|
+
return this.each(function () {
|
71
|
+
var $this = $(this)
|
72
|
+
, data = $this.data('affix')
|
73
|
+
, options = typeof option == 'object' && option
|
74
|
+
if (!data) $this.data('affix', (data = new Affix(this, options)))
|
75
|
+
if (typeof option == 'string') data[option]()
|
76
|
+
})
|
77
|
+
}
|
78
|
+
|
79
|
+
$.fn.affix.Constructor = Affix
|
80
|
+
|
81
|
+
$.fn.affix.defaults = {
|
82
|
+
offset: 0
|
83
|
+
}
|
84
|
+
|
85
|
+
|
86
|
+
/* AFFIX DATA-API
|
87
|
+
* ============== */
|
88
|
+
|
89
|
+
$(window).on('load', function () {
|
90
|
+
$('[data-spy="affix"]').each(function () {
|
91
|
+
var $spy = $(this)
|
92
|
+
, data = $spy.data()
|
93
|
+
|
94
|
+
data.offset = data.offset || {}
|
95
|
+
|
96
|
+
data.offsetBottom && (data.offset.bottom = data.offsetBottom)
|
97
|
+
data.offsetTop && (data.offset.top = data.offsetTop)
|
98
|
+
|
99
|
+
$spy.affix(data)
|
100
|
+
})
|
101
|
+
})
|
102
|
+
|
103
|
+
|
104
|
+
}(window.jQuery);
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/* ==========================================================
|
2
|
-
* bootstrap-alert.js v2.0
|
2
|
+
* bootstrap-alert.js v2.1.0
|
3
3
|
* http://twitter.github.com/bootstrap/javascript.html#alerts
|
4
4
|
* ==========================================================
|
5
5
|
* Copyright 2012 Twitter, Inc.
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/* ============================================================
|
2
|
-
* bootstrap-button.js v2.0
|
2
|
+
* bootstrap-button.js v2.1.0
|
3
3
|
* http://twitter.github.com/bootstrap/javascript.html#buttons
|
4
4
|
* ============================================================
|
5
5
|
* Copyright 2012 Twitter, Inc.
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/* ==========================================================
|
2
|
-
* bootstrap-carousel.js v2.0
|
2
|
+
* bootstrap-carousel.js v2.1.0
|
3
3
|
* http://twitter.github.com/bootstrap/javascript.html#carousel
|
4
4
|
* ==========================================================
|
5
5
|
* Copyright 2012 Twitter, Inc.
|
@@ -46,7 +46,7 @@
|
|
46
46
|
}
|
47
47
|
|
48
48
|
, to: function (pos) {
|
49
|
-
var $active = this.$element.find('.active')
|
49
|
+
var $active = this.$element.find('.item.active')
|
50
50
|
, children = $active.parent().children()
|
51
51
|
, activePos = children.index($active)
|
52
52
|
, that = this
|
@@ -68,6 +68,10 @@
|
|
68
68
|
|
69
69
|
, pause: function (e) {
|
70
70
|
if (!e) this.paused = true
|
71
|
+
if (this.$element.find('.next, .prev').length && $.support.transition.end) {
|
72
|
+
this.$element.trigger($.support.transition.end)
|
73
|
+
this.cycle()
|
74
|
+
}
|
71
75
|
clearInterval(this.interval)
|
72
76
|
this.interval = null
|
73
77
|
return this
|
@@ -84,13 +88,15 @@
|
|
84
88
|
}
|
85
89
|
|
86
90
|
, slide: function (type, next) {
|
87
|
-
var $active = this.$element.find('.active')
|
91
|
+
var $active = this.$element.find('.item.active')
|
88
92
|
, $next = next || $active[type]()
|
89
93
|
, isCycling = this.interval
|
90
94
|
, direction = type == 'next' ? 'left' : 'right'
|
91
95
|
, fallback = type == 'next' ? 'first' : 'last'
|
92
96
|
, that = this
|
93
|
-
, e = $.Event('slide'
|
97
|
+
, e = $.Event('slide', {
|
98
|
+
relatedTarget: $next[0]
|
99
|
+
})
|
94
100
|
|
95
101
|
this.sliding = true
|
96
102
|
|
@@ -138,9 +144,10 @@
|
|
138
144
|
var $this = $(this)
|
139
145
|
, data = $this.data('carousel')
|
140
146
|
, options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option)
|
147
|
+
, action = typeof option == 'string' ? option : options.slide
|
141
148
|
if (!data) $this.data('carousel', (data = new Carousel(this, options)))
|
142
149
|
if (typeof option == 'number') data.to(option)
|
143
|
-
else if (
|
150
|
+
else if (action) data[action]()
|
144
151
|
else if (options.interval) data.cycle()
|
145
152
|
})
|
146
153
|
}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/* =============================================================
|
2
|
-
* bootstrap-collapse.js v2.0
|
2
|
+
* bootstrap-collapse.js v2.1.0
|
3
3
|
* http://twitter.github.com/bootstrap/javascript.html#collapse
|
4
4
|
* =============================================================
|
5
5
|
* Copyright 2012 Twitter, Inc.
|
@@ -67,7 +67,7 @@
|
|
67
67
|
|
68
68
|
this.$element[dimension](0)
|
69
69
|
this.transition('addClass', $.Event('show'), 'shown')
|
70
|
-
this.$element[dimension](this.$element[0][scroll])
|
70
|
+
$.support.transition && this.$element[dimension](this.$element[0][scroll])
|
71
71
|
}
|
72
72
|
|
73
73
|
, hide: function () {
|
@@ -144,12 +144,13 @@
|
|
144
144
|
* ==================== */
|
145
145
|
|
146
146
|
$(function () {
|
147
|
-
$('body').on('click.collapse.data-api', '[data-toggle=collapse]', function (
|
147
|
+
$('body').on('click.collapse.data-api', '[data-toggle=collapse]', function (e) {
|
148
148
|
var $this = $(this), href
|
149
149
|
, target = $this.attr('data-target')
|
150
150
|
|| e.preventDefault()
|
151
151
|
|| (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
|
152
152
|
, option = $(target).data('collapse') ? 'toggle' : $this.data()
|
153
|
+
$this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
|
153
154
|
$(target).collapse(option)
|
154
155
|
})
|
155
156
|
})
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/* ============================================================
|
2
|
-
* bootstrap-dropdown.js v2.0
|
2
|
+
* bootstrap-dropdown.js v2.1.0
|
3
3
|
* http://twitter.github.com/bootstrap/javascript.html#dropdowns
|
4
4
|
* ============================================================
|
5
5
|
* Copyright 2012 Twitter, Inc.
|
@@ -26,7 +26,7 @@
|
|
26
26
|
/* DROPDOWN CLASS DEFINITION
|
27
27
|
* ========================= */
|
28
28
|
|
29
|
-
var toggle = '[data-toggle=
|
29
|
+
var toggle = '[data-toggle=dropdown]'
|
30
30
|
, Dropdown = function (element) {
|
31
31
|
var $el = $(element).on('click.dropdown.data-api', this.toggle)
|
32
32
|
$('html').on('click.dropdown.data-api', function () {
|
@@ -41,34 +41,82 @@
|
|
41
41
|
, toggle: function (e) {
|
42
42
|
var $this = $(this)
|
43
43
|
, $parent
|
44
|
-
, selector
|
45
44
|
, isActive
|
46
45
|
|
47
46
|
if ($this.is('.disabled, :disabled')) return
|
48
47
|
|
49
|
-
|
48
|
+
$parent = getParent($this)
|
50
49
|
|
51
|
-
|
52
|
-
|
53
|
-
|
50
|
+
isActive = $parent.hasClass('open')
|
51
|
+
|
52
|
+
clearMenus()
|
53
|
+
|
54
|
+
if (!isActive) {
|
55
|
+
$parent.toggleClass('open')
|
56
|
+
$this.focus()
|
54
57
|
}
|
55
58
|
|
56
|
-
|
57
|
-
|
59
|
+
return false
|
60
|
+
}
|
61
|
+
|
62
|
+
, keydown: function (e) {
|
63
|
+
var $this
|
64
|
+
, $items
|
65
|
+
, $active
|
66
|
+
, $parent
|
67
|
+
, isActive
|
68
|
+
, index
|
69
|
+
|
70
|
+
if (!/(38|40|27)/.test(e.keyCode)) return
|
71
|
+
|
72
|
+
$this = $(this)
|
73
|
+
|
74
|
+
e.preventDefault()
|
75
|
+
e.stopPropagation()
|
76
|
+
|
77
|
+
if ($this.is('.disabled, :disabled')) return
|
78
|
+
|
79
|
+
$parent = getParent($this)
|
58
80
|
|
59
81
|
isActive = $parent.hasClass('open')
|
60
82
|
|
61
|
-
|
83
|
+
if (!isActive || (isActive && e.keyCode == 27)) return $this.click()
|
62
84
|
|
63
|
-
|
85
|
+
$items = $('[role=menu] li:not(.divider) a', $parent)
|
64
86
|
|
65
|
-
return
|
87
|
+
if (!$items.length) return
|
88
|
+
|
89
|
+
index = $items.index($items.filter(':focus'))
|
90
|
+
|
91
|
+
if (e.keyCode == 38 && index > 0) index-- // up
|
92
|
+
if (e.keyCode == 40 && index < $items.length - 1) index++ // down
|
93
|
+
if (!~index) index = 0
|
94
|
+
|
95
|
+
$items
|
96
|
+
.eq(index)
|
97
|
+
.focus()
|
66
98
|
}
|
67
99
|
|
68
100
|
}
|
69
101
|
|
70
102
|
function clearMenus() {
|
71
|
-
$(toggle)
|
103
|
+
getParent($(toggle))
|
104
|
+
.removeClass('open')
|
105
|
+
}
|
106
|
+
|
107
|
+
function getParent($this) {
|
108
|
+
var selector = $this.attr('data-target')
|
109
|
+
, $parent
|
110
|
+
|
111
|
+
if (!selector) {
|
112
|
+
selector = $this.attr('href')
|
113
|
+
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
|
114
|
+
}
|
115
|
+
|
116
|
+
$parent = $(selector)
|
117
|
+
$parent.length || ($parent = $this.parent())
|
118
|
+
|
119
|
+
return $parent
|
72
120
|
}
|
73
121
|
|
74
122
|
|
@@ -91,10 +139,12 @@
|
|
91
139
|
* =================================== */
|
92
140
|
|
93
141
|
$(function () {
|
94
|
-
$('html')
|
142
|
+
$('html')
|
143
|
+
.on('click.dropdown.data-api touchstart.dropdown.data-api', clearMenus)
|
95
144
|
$('body')
|
96
|
-
.on('click.dropdown', '.dropdown
|
97
|
-
.on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle)
|
145
|
+
.on('click.dropdown touchstart.dropdown.data-api', '.dropdown', function (e) { e.stopPropagation() })
|
146
|
+
.on('click.dropdown.data-api touchstart.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
|
147
|
+
.on('keydown.dropdown.data-api touchstart.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
|
98
148
|
})
|
99
149
|
|
100
150
|
}(window.jQuery);
|