twitter-bootstrap-rails 2.0.6 → 2.0.7
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 +40 -22
- data/app/helpers/flash_block_helper.rb +17 -0
- data/app/helpers/twitter_breadcrumbs_helper.rb +5 -0
- data/app/views/twitter-bootstrap/_breadcrumbs.html.erb +14 -0
- data/lib/generators/bootstrap/layout/templates/layout.html.erb +1 -5
- data/lib/generators/bootstrap/layout/templates/layout.html.haml +1 -5
- data/lib/generators/bootstrap/layout/templates/layout.html.slim +1 -5
- data/lib/generators/bootstrap/themed/templates/show.html.erb +4 -4
- data/lib/twitter/bootstrap/rails/engine.rb +1 -1
- data/lib/twitter/bootstrap/rails/version.rb +1 -1
- data/vendor/assets/images/twitter/bootstrap/glyphicons-halflings-white.png +0 -0
- data/vendor/assets/images/twitter/bootstrap/glyphicons-halflings.png +0 -0
- data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-alert.js +28 -32
- data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-button.js +29 -33
- data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-carousel.js +27 -19
- data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-collapse.js +45 -26
- data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-dropdown.js +18 -10
- data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-modal.js +25 -17
- data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-popover.js +13 -10
- data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-scrollspy.js +43 -17
- data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-tab.js +12 -7
- data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-tooltip.js +40 -35
- data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-transition.js +30 -20
- data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-typeahead.js +25 -11
- data/vendor/toolkit/twitter/bootstrap/accordion.less +5 -0
- data/vendor/toolkit/twitter/bootstrap/bootstrap.less +2 -3
- data/vendor/toolkit/twitter/bootstrap/button-groups.less +55 -36
- data/vendor/toolkit/twitter/bootstrap/buttons.less +15 -11
- data/vendor/toolkit/twitter/bootstrap/close.less +12 -1
- data/vendor/toolkit/twitter/bootstrap/code.less +4 -4
- data/vendor/toolkit/twitter/bootstrap/component-animations.less +5 -5
- data/vendor/toolkit/twitter/bootstrap/dropdowns.less +15 -20
- data/vendor/toolkit/twitter/bootstrap/forms.less +58 -29
- data/vendor/toolkit/twitter/bootstrap/labels-badges.less +55 -0
- data/vendor/toolkit/twitter/bootstrap/layouts.less +1 -1
- data/vendor/toolkit/twitter/bootstrap/mixins.less +53 -36
- data/vendor/toolkit/twitter/bootstrap/modals.less +1 -1
- data/vendor/toolkit/twitter/bootstrap/navbar.less +64 -41
- data/vendor/toolkit/twitter/bootstrap/navs.less +36 -36
- data/vendor/toolkit/twitter/bootstrap/progress-bars.less +14 -6
- data/vendor/toolkit/twitter/bootstrap/reset.less +3 -3
- data/vendor/toolkit/twitter/bootstrap/responsive-1200px-min.less +26 -0
- data/vendor/toolkit/twitter/bootstrap/responsive-767px-max.less +149 -0
- data/vendor/toolkit/twitter/bootstrap/responsive-768px-979px.less +17 -0
- data/vendor/toolkit/twitter/bootstrap/responsive-navbar.less +146 -0
- data/vendor/toolkit/twitter/bootstrap/responsive-utilities.less +41 -0
- data/vendor/toolkit/twitter/bootstrap/responsive.less +14 -337
- data/vendor/toolkit/twitter/bootstrap/sprites.less +39 -6
- data/vendor/toolkit/twitter/bootstrap/tables.less +22 -5
- data/vendor/toolkit/twitter/bootstrap/thumbnails.less +14 -2
- data/vendor/toolkit/twitter/bootstrap/type.less +7 -6
- data/vendor/toolkit/twitter/bootstrap/variables.less +10 -6
- metadata +31 -11
data/README.md
CHANGED
@@ -23,11 +23,15 @@ in this episode continues on the Twitter Bootstrap project showing how to displa
|
|
23
23
|
|
24
24
|
Include Bootstrap in Gemfile;
|
25
25
|
|
26
|
-
|
26
|
+
```ruby
|
27
|
+
gem "twitter-bootstrap-rails"
|
28
|
+
```
|
27
29
|
|
28
30
|
or you can install from latest build;
|
29
31
|
|
30
|
-
|
32
|
+
```ruby
|
33
|
+
gem 'twitter-bootstrap-rails', :git => 'git://github.com/seyhunak/twitter-bootstrap-rails.git'
|
34
|
+
```
|
31
35
|
|
32
36
|
You can run bundle from command line
|
33
37
|
|
@@ -75,7 +79,7 @@ Usage:
|
|
75
79
|
Example:
|
76
80
|
|
77
81
|
|
78
|
-
rails g scaffold
|
82
|
+
rails g scaffold Post title:string description:text
|
79
83
|
rake db:migrate
|
80
84
|
rails g bootstrap:themed Posts
|
81
85
|
|
@@ -89,30 +93,33 @@ Bootstrap was built with Preboot, an open-source pack of mixins and variables to
|
|
89
93
|
|
90
94
|
You have to require Bootstrap LESS (bootstrap_and_overrides.css.less) in your application.css
|
91
95
|
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
/* Your stylesheets goes here... */
|
96
|
+
```css
|
97
|
+
/*
|
98
|
+
*= require bootstrap_and_overrides
|
99
|
+
*/
|
97
100
|
|
101
|
+
/* Your stylesheets goes here... */
|
102
|
+
```
|
98
103
|
|
99
104
|
If you'd like to alter Bootstrap's own variables, or define your LESS
|
100
105
|
styles inheriting Bootstrap's mixins, you can do so inside bootstrap_and_overrides.css.less:
|
101
106
|
|
102
|
-
|
103
|
-
|
107
|
+
```css
|
108
|
+
@linkColor: #ff0000;
|
109
|
+
```
|
104
110
|
|
105
111
|
|
106
112
|
## Using Javascripts
|
107
113
|
|
108
114
|
You have to require Bootstrap JS (bootstrap.js) in your application.js
|
109
115
|
|
110
|
-
|
111
|
-
|
112
|
-
$(document).ready(function(){
|
113
|
-
/* Your javascripts goes here... */
|
114
|
-
});
|
116
|
+
```js
|
117
|
+
//= require twitter/bootstrap
|
115
118
|
|
119
|
+
$(document).ready(function(){
|
120
|
+
/* Your javascripts goes here... */
|
121
|
+
});
|
122
|
+
```
|
116
123
|
|
117
124
|
## Using Coffeescript (optionally)
|
118
125
|
|
@@ -120,19 +127,23 @@ Using Twitter Bootstrap with the CoffeeScript is easy.
|
|
120
127
|
twitter-bootstrap-rails generates a "bootstrap.js.coffee" file for you
|
121
128
|
to /app/assets/javascripts/ folder.
|
122
129
|
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
130
|
+
```coffee
|
131
|
+
jQuery ->
|
132
|
+
$("a[rel=popover]").popover()
|
133
|
+
$(".tooltip").tooltip()
|
134
|
+
$("a[rel=tooltip]").tooltip()
|
135
|
+
```
|
128
136
|
|
129
137
|
## Using Static CSS, JS (w/o Less)
|
130
138
|
|
131
139
|
twitter-bootstrap-rails has seperate branch (w/o Less) that just serves latest static CSS, JS files.
|
132
140
|
|
133
|
-
|
141
|
+
You can install from latest build (from branch);
|
134
142
|
|
135
|
-
|
143
|
+
```ruby
|
144
|
+
gem 'twitter-bootstrap-rails', :git => 'git://github.com/seyhunak/twitter-bootstrap-rails.git',
|
145
|
+
:branch => 'static'
|
146
|
+
```
|
136
147
|
|
137
148
|
|
138
149
|
## Changelog
|
@@ -184,6 +195,7 @@ twitter-bootstrap-rails has seperate branch (w/o Less) that just serves latest s
|
|
184
195
|
<li>Thiago Almeida</li>
|
185
196
|
<li>Sébastien Grosjean</li>
|
186
197
|
<li>Nick DeSteffen</li>
|
198
|
+
<li>Christian Joudrey</li>
|
187
199
|
</ul>
|
188
200
|
|
189
201
|
|
@@ -207,6 +219,12 @@ Seyhun Akyürek - seyhunak [at] gmail com
|
|
207
219
|
|
208
220
|
[Visit My Blog](http://www.seyhunakyurek.com/ "Visit My Blog")
|
209
221
|
|
222
|
+
## Score me
|
223
|
+
<img src="https://addons.opera.com/media/extensions/55/14355/1.0.1-rev1/icons/icon_64x64.png"></img>
|
224
|
+
|
225
|
+
Please +K my influence in Ruby on Rails on @klout
|
226
|
+
|
227
|
+
http://klout.com/#/seyhunak
|
210
228
|
|
211
229
|
## Thanks
|
212
230
|
Twitter Bootstrap and all twitter-bootstrap-rails contributors
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module FlashBlockHelper
|
2
|
+
def flash_block
|
3
|
+
output = ''
|
4
|
+
flash.each do |type, message|
|
5
|
+
output += flash_container(type, message)
|
6
|
+
end
|
7
|
+
|
8
|
+
raw(output)
|
9
|
+
end
|
10
|
+
|
11
|
+
def flash_container(type, message)
|
12
|
+
raw(content_tag(:div, :class => "alert alert-#{type}") do
|
13
|
+
content_tag(:a, raw("×"),:class => 'close', :data => {:dismiss => 'alert'}) +
|
14
|
+
message
|
15
|
+
end)
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<% if @breadcrumbs %>
|
2
|
+
<ul class="breadcrumb">
|
3
|
+
<% separator = divider %>
|
4
|
+
<% @breadcrumbs[0..-2].each do |crumb| %>
|
5
|
+
<li>
|
6
|
+
<a href="<%= crumb[:url] %>"><%= crumb[:name] %></a>
|
7
|
+
<span class="divider"><%= separator %></span>
|
8
|
+
</li>
|
9
|
+
<% end %>
|
10
|
+
<li class="active">
|
11
|
+
<a href="<%= @breadcrumbs.last[:url] %>"><%= @breadcrumbs.last[:name] %></a>
|
12
|
+
</li>
|
13
|
+
</ul>
|
14
|
+
<% end %>
|
@@ -22,11 +22,7 @@
|
|
22
22
|
|
23
23
|
<div class="navbar navbar-fixed-top">
|
24
24
|
<div class="navbar-inner">
|
25
|
-
|
26
|
-
<div class="container-fluid">
|
27
|
-
<%- else -%>
|
28
|
-
<div class="container">
|
29
|
-
<%- end -%>
|
25
|
+
<div class="<%= container_class %>">
|
30
26
|
<a class="btn btn-navbar" data-target=".nav-collapse" data-toggle="collapse">
|
31
27
|
<span class="icon-bar"></span>
|
32
28
|
<span class="icon-bar"></span>
|
@@ -17,11 +17,7 @@
|
|
17
17
|
%body
|
18
18
|
.navbar.navbar-fixed-top
|
19
19
|
.navbar-inner
|
20
|
-
|
21
|
-
.container-fluid
|
22
|
-
<%- else -%>
|
23
|
-
.container
|
24
|
-
<%- end -%>
|
20
|
+
.<%= container_class %>
|
25
21
|
%a.btn.btn-navbar(data-target=".nav-collapse" data-toggle="collapse")
|
26
22
|
%span.icon-bar
|
27
23
|
%span.icon-bar
|
@@ -18,11 +18,7 @@ html lang="en"
|
|
18
18
|
body
|
19
19
|
.navbar.navbar-fixed-top
|
20
20
|
.navbar-inner
|
21
|
-
|
22
|
-
.container-fluid
|
23
|
-
<%- else -%>
|
24
|
-
.container
|
25
|
-
<%- end -%>
|
21
|
+
.<%= container_class %>
|
26
22
|
a.btn.btn-navbar data-target=".nav-collapse" data-toggle="collapse"
|
27
23
|
span.icon-bar
|
28
24
|
span.icon-bar
|
@@ -1,12 +1,12 @@
|
|
1
1
|
<%%- model_class = @<%= resource_name %>.class -%>
|
2
2
|
<h1><%%=t '.title', :default => model_class.model_name.human %></h1>
|
3
3
|
|
4
|
+
<dl class="dl-horizontal">
|
4
5
|
<%- columns.each do |column| -%>
|
5
|
-
<
|
6
|
-
<
|
7
|
-
<%%= @<%= resource_name %>.<%= column.name %> %>
|
8
|
-
</p>
|
6
|
+
<dt><strong><%%= model_class.human_attribute_name(:<%= column.name %>) %>:</strong></dt>
|
7
|
+
<dd><%%= @<%= resource_name %>.<%= column.name %> %></dd>
|
9
8
|
<%- end -%>
|
9
|
+
</dl>
|
10
10
|
|
11
11
|
<div class="form-actions">
|
12
12
|
<%%= link_to t('.back', :default => t("helpers.links.back")),
|
@@ -15,7 +15,7 @@ module Twitter
|
|
15
15
|
initializer 'twitter-bootstrap-rails.setup_helpers' do |app|
|
16
16
|
app.config.to_prepare do
|
17
17
|
ActionController::Base.send :include, BreadCrumbs
|
18
|
-
ActionController::Base.send :helper_method, :render_breadcrumbs
|
18
|
+
#ActionController::Base.send :helper_method, :render_breadcrumbs
|
19
19
|
end
|
20
20
|
end
|
21
21
|
end
|
Binary file
|
Binary file
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/* ==========================================================
|
2
|
-
* bootstrap-alert.js v2.0.
|
2
|
+
* bootstrap-alert.js v2.0.3
|
3
3
|
* http://twitter.github.com/bootstrap/javascript.html#alerts
|
4
4
|
* ==========================================================
|
5
5
|
* Copyright 2012 Twitter, Inc.
|
@@ -18,61 +18,57 @@
|
|
18
18
|
* ========================================================== */
|
19
19
|
|
20
20
|
|
21
|
-
!function(
|
21
|
+
!function ($) {
|
22
|
+
|
23
|
+
"use strict"; // jshint ;_;
|
22
24
|
|
23
|
-
"use strict"
|
24
25
|
|
25
26
|
/* ALERT CLASS DEFINITION
|
26
27
|
* ====================== */
|
27
28
|
|
28
29
|
var dismiss = '[data-dismiss="alert"]'
|
29
|
-
, Alert = function (
|
30
|
+
, Alert = function (el) {
|
30
31
|
$(el).on('click', dismiss, this.close)
|
31
32
|
}
|
32
33
|
|
33
|
-
Alert.prototype = {
|
34
|
-
|
35
|
-
|
34
|
+
Alert.prototype.close = function (e) {
|
35
|
+
var $this = $(this)
|
36
|
+
, selector = $this.attr('data-target')
|
37
|
+
, $parent
|
36
38
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
39
|
+
if (!selector) {
|
40
|
+
selector = $this.attr('href')
|
41
|
+
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
|
42
|
+
}
|
41
43
|
|
42
|
-
|
43
|
-
selector = $this.attr('href')
|
44
|
-
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
|
45
|
-
}
|
44
|
+
$parent = $(selector)
|
46
45
|
|
47
|
-
|
48
|
-
$parent.trigger('close')
|
46
|
+
e && e.preventDefault()
|
49
47
|
|
50
|
-
|
48
|
+
$parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
|
51
49
|
|
52
|
-
|
50
|
+
$parent.trigger(e = $.Event('close'))
|
53
51
|
|
54
|
-
|
55
|
-
.trigger('close')
|
56
|
-
.removeClass('in')
|
52
|
+
if (e.isDefaultPrevented()) return
|
57
53
|
|
58
|
-
|
59
|
-
$parent
|
60
|
-
.trigger('closed')
|
61
|
-
.remove()
|
62
|
-
}
|
54
|
+
$parent.removeClass('in')
|
63
55
|
|
64
|
-
|
65
|
-
|
66
|
-
|
56
|
+
function removeElement() {
|
57
|
+
$parent
|
58
|
+
.trigger('closed')
|
59
|
+
.remove()
|
67
60
|
}
|
68
61
|
|
62
|
+
$.support.transition && $parent.hasClass('fade') ?
|
63
|
+
$parent.on($.support.transition.end, removeElement) :
|
64
|
+
removeElement()
|
69
65
|
}
|
70
66
|
|
71
67
|
|
72
68
|
/* ALERT PLUGIN DEFINITION
|
73
69
|
* ======================= */
|
74
70
|
|
75
|
-
$.fn.alert = function (
|
71
|
+
$.fn.alert = function (option) {
|
76
72
|
return this.each(function () {
|
77
73
|
var $this = $(this)
|
78
74
|
, data = $this.data('alert')
|
@@ -91,4 +87,4 @@
|
|
91
87
|
$('body').on('click.alert.data-api', dismiss, Alert.prototype.close)
|
92
88
|
})
|
93
89
|
|
94
|
-
}(
|
90
|
+
}(window.jQuery);
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/* ============================================================
|
2
|
-
* bootstrap-button.js v2.0.
|
2
|
+
* bootstrap-button.js v2.0.3
|
3
3
|
* http://twitter.github.com/bootstrap/javascript.html#buttons
|
4
4
|
* ============================================================
|
5
5
|
* Copyright 2012 Twitter, Inc.
|
@@ -17,58 +17,54 @@
|
|
17
17
|
* limitations under the License.
|
18
18
|
* ============================================================ */
|
19
19
|
|
20
|
-
!function( $ ){
|
21
20
|
|
22
|
-
|
21
|
+
!function ($) {
|
22
|
+
|
23
|
+
"use strict"; // jshint ;_;
|
24
|
+
|
23
25
|
|
24
26
|
/* BUTTON PUBLIC CLASS DEFINITION
|
25
27
|
* ============================== */
|
26
28
|
|
27
|
-
var Button = function (
|
29
|
+
var Button = function (element, options) {
|
28
30
|
this.$element = $(element)
|
29
31
|
this.options = $.extend({}, $.fn.button.defaults, options)
|
30
32
|
}
|
31
33
|
|
32
|
-
Button.prototype = {
|
33
|
-
|
34
|
-
|
34
|
+
Button.prototype.setState = function (state) {
|
35
|
+
var d = 'disabled'
|
36
|
+
, $el = this.$element
|
37
|
+
, data = $el.data()
|
38
|
+
, val = $el.is('input') ? 'val' : 'html'
|
35
39
|
|
36
|
-
|
37
|
-
|
38
|
-
, $el = this.$element
|
39
|
-
, data = $el.data()
|
40
|
-
, val = $el.is('input') ? 'val' : 'html'
|
40
|
+
state = state + 'Text'
|
41
|
+
data.resetText || $el.data('resetText', $el[val]())
|
41
42
|
|
42
|
-
|
43
|
-
data.resetText || $el.data('resetText', $el[val]())
|
43
|
+
$el[val](data[state] || this.options[state])
|
44
44
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
}, 0)
|
53
|
-
}
|
54
|
-
|
55
|
-
, toggle: function () {
|
56
|
-
var $parent = this.$element.parent('[data-toggle="buttons-radio"]')
|
45
|
+
// push to event loop to allow forms to submit
|
46
|
+
setTimeout(function () {
|
47
|
+
state == 'loadingText' ?
|
48
|
+
$el.addClass(d).attr(d, d) :
|
49
|
+
$el.removeClass(d).removeAttr(d)
|
50
|
+
}, 0)
|
51
|
+
}
|
57
52
|
|
58
|
-
|
59
|
-
|
60
|
-
.removeClass('active')
|
53
|
+
Button.prototype.toggle = function () {
|
54
|
+
var $parent = this.$element.parent('[data-toggle="buttons-radio"]')
|
61
55
|
|
62
|
-
|
63
|
-
|
56
|
+
$parent && $parent
|
57
|
+
.find('.active')
|
58
|
+
.removeClass('active')
|
64
59
|
|
60
|
+
this.$element.toggleClass('active')
|
65
61
|
}
|
66
62
|
|
67
63
|
|
68
64
|
/* BUTTON PLUGIN DEFINITION
|
69
65
|
* ======================== */
|
70
66
|
|
71
|
-
$.fn.button = function (
|
67
|
+
$.fn.button = function (option) {
|
72
68
|
return this.each(function () {
|
73
69
|
var $this = $(this)
|
74
70
|
, data = $this.data('button')
|
@@ -97,4 +93,4 @@
|
|
97
93
|
})
|
98
94
|
})
|
99
95
|
|
100
|
-
}(
|
96
|
+
}(window.jQuery);
|