twitter-bootstrap-rails 2.0.6 → 2.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of twitter-bootstrap-rails might be problematic. Click here for more details.

Files changed (53) hide show
  1. data/README.md +40 -22
  2. data/app/helpers/flash_block_helper.rb +17 -0
  3. data/app/helpers/twitter_breadcrumbs_helper.rb +5 -0
  4. data/app/views/twitter-bootstrap/_breadcrumbs.html.erb +14 -0
  5. data/lib/generators/bootstrap/layout/templates/layout.html.erb +1 -5
  6. data/lib/generators/bootstrap/layout/templates/layout.html.haml +1 -5
  7. data/lib/generators/bootstrap/layout/templates/layout.html.slim +1 -5
  8. data/lib/generators/bootstrap/themed/templates/show.html.erb +4 -4
  9. data/lib/twitter/bootstrap/rails/engine.rb +1 -1
  10. data/lib/twitter/bootstrap/rails/version.rb +1 -1
  11. data/vendor/assets/images/twitter/bootstrap/glyphicons-halflings-white.png +0 -0
  12. data/vendor/assets/images/twitter/bootstrap/glyphicons-halflings.png +0 -0
  13. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-alert.js +28 -32
  14. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-button.js +29 -33
  15. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-carousel.js +27 -19
  16. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-collapse.js +45 -26
  17. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-dropdown.js +18 -10
  18. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-modal.js +25 -17
  19. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-popover.js +13 -10
  20. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-scrollspy.js +43 -17
  21. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-tab.js +12 -7
  22. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-tooltip.js +40 -35
  23. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-transition.js +30 -20
  24. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-typeahead.js +25 -11
  25. data/vendor/toolkit/twitter/bootstrap/accordion.less +5 -0
  26. data/vendor/toolkit/twitter/bootstrap/bootstrap.less +2 -3
  27. data/vendor/toolkit/twitter/bootstrap/button-groups.less +55 -36
  28. data/vendor/toolkit/twitter/bootstrap/buttons.less +15 -11
  29. data/vendor/toolkit/twitter/bootstrap/close.less +12 -1
  30. data/vendor/toolkit/twitter/bootstrap/code.less +4 -4
  31. data/vendor/toolkit/twitter/bootstrap/component-animations.less +5 -5
  32. data/vendor/toolkit/twitter/bootstrap/dropdowns.less +15 -20
  33. data/vendor/toolkit/twitter/bootstrap/forms.less +58 -29
  34. data/vendor/toolkit/twitter/bootstrap/labels-badges.less +55 -0
  35. data/vendor/toolkit/twitter/bootstrap/layouts.less +1 -1
  36. data/vendor/toolkit/twitter/bootstrap/mixins.less +53 -36
  37. data/vendor/toolkit/twitter/bootstrap/modals.less +1 -1
  38. data/vendor/toolkit/twitter/bootstrap/navbar.less +64 -41
  39. data/vendor/toolkit/twitter/bootstrap/navs.less +36 -36
  40. data/vendor/toolkit/twitter/bootstrap/progress-bars.less +14 -6
  41. data/vendor/toolkit/twitter/bootstrap/reset.less +3 -3
  42. data/vendor/toolkit/twitter/bootstrap/responsive-1200px-min.less +26 -0
  43. data/vendor/toolkit/twitter/bootstrap/responsive-767px-max.less +149 -0
  44. data/vendor/toolkit/twitter/bootstrap/responsive-768px-979px.less +17 -0
  45. data/vendor/toolkit/twitter/bootstrap/responsive-navbar.less +146 -0
  46. data/vendor/toolkit/twitter/bootstrap/responsive-utilities.less +41 -0
  47. data/vendor/toolkit/twitter/bootstrap/responsive.less +14 -337
  48. data/vendor/toolkit/twitter/bootstrap/sprites.less +39 -6
  49. data/vendor/toolkit/twitter/bootstrap/tables.less +22 -5
  50. data/vendor/toolkit/twitter/bootstrap/thumbnails.less +14 -2
  51. data/vendor/toolkit/twitter/bootstrap/type.less +7 -6
  52. data/vendor/toolkit/twitter/bootstrap/variables.less +10 -6
  53. 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
- gem "twitter-bootstrap-rails"
26
+ ```ruby
27
+ gem "twitter-bootstrap-rails"
28
+ ```
27
29
 
28
30
  or you can install from latest build;
29
31
 
30
- gem 'twitter-bootstrap-rails', :git => 'git://github.com/seyhunak/twitter-bootstrap-rails.git'
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 post title:string description:text
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
- *= require bootstrap_and_overrides
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
- @linkColor: #ff0000;
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
- //= require twitter/bootstrap
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
- jQuery ->
124
- $("a[rel=popover]").popover()
125
- $(".tooltip").tooltip()
126
- $("a[rel=tooltip]").tooltip()
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
- You can install from latest build (from branch);
141
+ You can install from latest build (from branch);
134
142
 
135
- gem 'twitter-bootstrap-rails', :git => "git://github.com/seyhunak/twitter-bootstrap-rails.git", :branch => "static"
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("&times;"),:class => 'close', :data => {:dismiss => 'alert'}) +
14
+ message
15
+ end)
16
+ end
17
+ end
@@ -0,0 +1,5 @@
1
+ module TwitterBreadcrumbsHelper
2
+ def render_breadcrumbs(divider = '/')
3
+ render partial: 'twitter-bootstrap/breadcrumbs', locals: {divider: divider}
4
+ end
5
+ 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
- <%- if layout_type == "fluid" -%>
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
- <%- if layout_type == "fluid" -%>
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
- <%- if layout_type == "fluid" -%>
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
- <p>
6
- <strong><%%= model_class.human_attribute_name(:<%= column.name %>) %>:</strong><br>
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
@@ -1,7 +1,7 @@
1
1
  module Twitter
2
2
  module Bootstrap
3
3
  module Rails
4
- VERSION = "2.0.6"
4
+ VERSION = "2.0.7"
5
5
  end
6
6
  end
7
7
  end
@@ -1,5 +1,5 @@
1
1
  /* ==========================================================
2
- * bootstrap-alert.js v2.0.2
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 ( el ) {
30
+ , Alert = function (el) {
30
31
  $(el).on('click', dismiss, this.close)
31
32
  }
32
33
 
33
- Alert.prototype = {
34
-
35
- constructor: Alert
34
+ Alert.prototype.close = function (e) {
35
+ var $this = $(this)
36
+ , selector = $this.attr('data-target')
37
+ , $parent
36
38
 
37
- , close: function ( e ) {
38
- var $this = $(this)
39
- , selector = $this.attr('data-target')
40
- , $parent
39
+ if (!selector) {
40
+ selector = $this.attr('href')
41
+ selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
42
+ }
41
43
 
42
- if (!selector) {
43
- selector = $this.attr('href')
44
- selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
45
- }
44
+ $parent = $(selector)
46
45
 
47
- $parent = $(selector)
48
- $parent.trigger('close')
46
+ e && e.preventDefault()
49
47
 
50
- e && e.preventDefault()
48
+ $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
51
49
 
52
- $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
50
+ $parent.trigger(e = $.Event('close'))
53
51
 
54
- $parent
55
- .trigger('close')
56
- .removeClass('in')
52
+ if (e.isDefaultPrevented()) return
57
53
 
58
- function removeElement() {
59
- $parent
60
- .trigger('closed')
61
- .remove()
62
- }
54
+ $parent.removeClass('in')
63
55
 
64
- $.support.transition && $parent.hasClass('fade') ?
65
- $parent.on($.support.transition.end, removeElement) :
66
- removeElement()
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 ( option ) {
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
- }( window.jQuery );
90
+ }(window.jQuery);
@@ -1,5 +1,5 @@
1
1
  /* ============================================================
2
- * bootstrap-button.js v2.0.2
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
- "use strict"
21
+ !function ($) {
22
+
23
+ "use strict"; // jshint ;_;
24
+
23
25
 
24
26
  /* BUTTON PUBLIC CLASS DEFINITION
25
27
  * ============================== */
26
28
 
27
- var Button = function ( element, options ) {
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
- constructor: Button
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
- , setState: function ( state ) {
37
- var d = 'disabled'
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
- state = state + 'Text'
43
- data.resetText || $el.data('resetText', $el[val]())
43
+ $el[val](data[state] || this.options[state])
44
44
 
45
- $el[val](data[state] || this.options[state])
46
-
47
- // push to event loop to allow forms to submit
48
- setTimeout(function () {
49
- state == 'loadingText' ?
50
- $el.addClass(d).attr(d, d) :
51
- $el.removeClass(d).removeAttr(d)
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
- $parent && $parent
59
- .find('.active')
60
- .removeClass('active')
53
+ Button.prototype.toggle = function () {
54
+ var $parent = this.$element.parent('[data-toggle="buttons-radio"]')
61
55
 
62
- this.$element.toggleClass('active')
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 ( option ) {
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
- }( window.jQuery );
96
+ }(window.jQuery);