Permalink
Browse files

Merge branch 'master' of git://github.com/seyhunak/twitter-bootstrap-…

…rails
  • Loading branch information...
maukoquiroga committed Sep 29, 2012
2 parents 7b171cf + ac20f06 commit 8fb51222a3acd57f848903d93ea096aebefcd0a9
Showing with 2,302 additions and 1,060 deletions.
  1. +5 −2 README.md
  2. +12 −0 app/helpers/glyph_helper.rb
  3. +3 −3 app/views/twitter-bootstrap/_breadcrumbs.html.erb
  4. +8 −12 lib/generators/bootstrap/install/templates/bootstrap_and_overrides.less
  5. +15 −17 lib/generators/bootstrap/layout/templates/layout.html.erb
  6. +12 −13 lib/generators/bootstrap/layout/templates/layout.html.haml
  7. +12 −13 lib/generators/bootstrap/layout/templates/layout.html.slim
  8. +1 −1 lib/twitter/bootstrap/rails/version.rb
  9. +5 −5 twitter-bootstrap-rails.gemspec
  10. BIN vendor/assets/images/twitter/bootstrap/glyphicons-halflings.png
  11. +1 −0 vendor/assets/javascripts/twitter/bootstrap.js
  12. +104 −0 vendor/assets/javascripts/twitter/bootstrap/bootstrap-affix.js
  13. +1 −1 vendor/assets/javascripts/twitter/bootstrap/bootstrap-alert.js
  14. +2 −2 vendor/assets/javascripts/twitter/bootstrap/bootstrap-button.js
  15. +12 −5 vendor/assets/javascripts/twitter/bootstrap/bootstrap-carousel.js
  16. +4 −3 vendor/assets/javascripts/twitter/bootstrap/bootstrap-collapse.js
  17. +66 −16 vendor/assets/javascripts/twitter/bootstrap/bootstrap-dropdown.js
  18. +95 −74 vendor/assets/javascripts/twitter/bootstrap/bootstrap-modal.js
  19. +9 −4 vendor/assets/javascripts/twitter/bootstrap/bootstrap-popover.js
  20. +9 −9 vendor/assets/javascripts/twitter/bootstrap/bootstrap-scrollspy.js
  21. +2 −2 vendor/assets/javascripts/twitter/bootstrap/bootstrap-tab.js
  22. +15 −15 vendor/assets/javascripts/twitter/bootstrap/bootstrap-tooltip.js
  23. +2 −3 vendor/assets/javascripts/twitter/bootstrap/bootstrap-transition.js
  24. +52 −41 vendor/assets/javascripts/twitter/bootstrap/bootstrap-typeahead.js
  25. +245 −0 vendor/toolkit/font-awesome-ie7.less
  26. +7 −24 vendor/toolkit/fontawesome.less
  27. +3 −2 vendor/toolkit/twitter/bootstrap/accordion.less
  28. +16 −9 vendor/toolkit/twitter/bootstrap/alerts.less
  29. +1 −1 vendor/toolkit/twitter/bootstrap/bootstrap.less
  30. +10 −10 vendor/toolkit/twitter/bootstrap/breadcrumbs.less
  31. +79 −25 vendor/toolkit/twitter/bootstrap/button-groups.less
  32. +107 −67 vendor/toolkit/twitter/bootstrap/buttons.less
  33. +13 −3 vendor/toolkit/twitter/bootstrap/carousel.less
  34. +4 −2 vendor/toolkit/twitter/bootstrap/close.less
  35. +6 −5 vendor/toolkit/twitter/bootstrap/code.less
  36. +4 −2 vendor/toolkit/twitter/bootstrap/component-animations.less
  37. +82 −15 vendor/toolkit/twitter/bootstrap/dropdowns.less
  38. +124 −57 vendor/toolkit/twitter/bootstrap/forms.less
  39. +17 −1 vendor/toolkit/twitter/bootstrap/grid.less
  40. +4 −2 vendor/toolkit/twitter/bootstrap/hero-unit.less
  41. +19 −2 vendor/toolkit/twitter/bootstrap/labels-badges.less
  42. +1 −2 vendor/toolkit/twitter/bootstrap/layouts.less
  43. +112 −77 vendor/toolkit/twitter/bootstrap/mixins.less
  44. +12 −4 vendor/toolkit/twitter/bootstrap/modals.less
  45. +245 −128 vendor/toolkit/twitter/bootstrap/navbar.less
  46. +38 −17 vendor/toolkit/twitter/bootstrap/navs.less
  47. +11 −7 vendor/toolkit/twitter/bootstrap/pager.less
  48. +23 −15 vendor/toolkit/twitter/bootstrap/pagination.less
  49. +101 −33 vendor/toolkit/twitter/bootstrap/popovers.less
  50. +18 −13 vendor/toolkit/twitter/bootstrap/progress-bars.less
  51. +10 −4 vendor/toolkit/twitter/bootstrap/reset.less
  52. +9 −7 vendor/toolkit/twitter/bootstrap/responsive-1200px-min.less
  53. +95 −70 vendor/toolkit/twitter/bootstrap/responsive-767px-max.less
  54. +7 −5 vendor/toolkit/twitter/bootstrap/responsive-768px-979px.less
  55. +30 −6 vendor/toolkit/twitter/bootstrap/responsive-navbar.less
  56. +17 −15 vendor/toolkit/twitter/bootstrap/responsive-utilities.less
  57. +5 −5 vendor/toolkit/twitter/bootstrap/responsive.less
  58. +27 −4 vendor/toolkit/twitter/bootstrap/scaffolding.less
  59. +21 −19 vendor/toolkit/twitter/bootstrap/sprites.less
  60. +81 −12 vendor/toolkit/twitter/bootstrap/tables.less
  61. +9 −4 vendor/toolkit/twitter/bootstrap/thumbnails.less
  62. +47 −12 vendor/toolkit/twitter/bootstrap/tooltip.less
  63. +75 −95 vendor/toolkit/twitter/bootstrap/type.less
  64. +9 −2 vendor/toolkit/twitter/bootstrap/utilities.less
  65. +104 −31 vendor/toolkit/twitter/bootstrap/variables.less
  66. +7 −5 vendor/toolkit/twitter/bootstrap/wells.less
View
@@ -5,7 +5,7 @@ twitter-bootstrap-rails project integrates Bootstrap CSS toolkit for Rails 3.1 A
[![Build Status](https://secure.travis-ci.org/seyhunak/twitter-bootstrap-rails.png)](http://travis-ci.org/seyhunak/twitter-bootstrap-rails)
[![Dependency Status](https://gemnasium.com/seyhunak/twitter-bootstrap-rails.png)](https://gemnasium.com/seyhunak/twitter-bootstrap-rails)
-[![Code Climate](https://codeclimate.com/badge.png)](https://github.com/seyhunak/twitter-bootstrap-rails)
+[![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/seyhunak/twitter-bootstrap-rails)
## Screencasts
#### Installing twitter-bootstrap-rails, generators, usage and more
@@ -83,7 +83,7 @@ Example:
rake db:migrate
rails g bootstrap:themed Posts
-
+Notice the plural usage of the resource to generate bootstrap:themed.
## Using with Less
@@ -188,6 +188,8 @@ gem 'twitter-bootstrap-rails', :git => 'git://github.com/seyhunak/twitter-bootst
<li>Released gem v.2.1.0 (JRuby support)</li>
<li>Released gem v.2.1.1 (minor fixes)</li>
<li>Flash block message helper added</li>
+ <li>Released gem v.2.1.2 (minor fixes and updated to Twitter Bootstrap 2.1.0)</li>
+ <li>Released gem v.2.1.3 (minor fixes and updated to Twitter Bootstrap 2.1.1)</li>
</ul>
@@ -208,6 +210,7 @@ gem 'twitter-bootstrap-rails', :git => 'git://github.com/seyhunak/twitter-bootst
<li>Sébastien Grosjean</li>
<li>Nick DeSteffen</li>
<li>Christian Joudrey</li>
+ <li>Todd Baur</li>
</ul>
@@ -0,0 +1,12 @@
+module GlyphHelper
+ # ==== Examples
+ # glyph(:share_alt)
+ # # => <i class="icon-share-alt"></i>
+ # glyph(:lock, :white)
+ # # => <i class="icon-lock icon-white"></i>
+
+ def glyph(*names)
+ content_tag :i, nil, class: names.map{|name| "icon-#{name.to_s.gsub('_','-')}" }
+ end
+end
+
@@ -3,12 +3,12 @@
<% separator = divider %>
<% @breadcrumbs[0..-2].each do |crumb| %>
<li>
- <%= link_to crumb[:name], crumb[:url], crumb[:options] %>
+ <%= link_to crumb[:name], crumb[:url], crumb[:options] %>
<span class="divider"><%= separator %></span>
</li>
<% end %>
<li class="active">
- <%= link_to @breadcrumbs.last[:name], @breadcrumbs.last[:url], @breadcrumbs.last[:options] %>
+ <%= @breadcrumbs.last[:name] %>
</li>
</ul>
-<% end %>
+<% end %>
@@ -1,21 +1,17 @@
@import "twitter/bootstrap/bootstrap";
-body {
- padding-top: 60px;
-}
-
@import "twitter/bootstrap/responsive";
// Set the correct sprite paths
-@iconSpritePath: asset-path('twitter/bootstrap/glyphicons-halflings.png');
-@iconWhiteSpritePath: asset-path('twitter/bootstrap/glyphicons-halflings-white.png');
+@iconSpritePath: asset-path("twitter/bootstrap/glyphicons-halflings.png");
+@iconWhiteSpritePath: asset-path("twitter/bootstrap/glyphicons-halflings-white.png");
// Set the Font Awesome (Font Awesome is default. You can disable by commenting below lines)
-// Note: If you use asset_path() here, your compiled boostrap_and_overrides.css will not
+// Note: If you use asset_path() here, your compiled boostrap_and_overrides.css will not
// have the proper paths. So for now we use the absolute path.
-@fontAwesomeEotPath: '/assets/fontawesome-webfont.eot';
-@fontAwesomeWoffPath: '/assets/fontawesome-webfont.woff';
-@fontAwesomeTtfPath: '/assets/fontawesome-webfont.ttf';
-@fontAwesomeSvgPath: '/assets/fontawesome-webfont.svg';
+@fontAwesomeEotPath: "/assets/fontawesome-webfont.eot";
+@fontAwesomeWoffPath: "/assets/fontawesome-webfont.woff";
+@fontAwesomeTtfPath: "/assets/fontawesome-webfont.ttf";
+@fontAwesomeSvgPath: "/assets/fontawesome-webfont.svg";
// Font Awesome
@import "fontawesome";
@@ -26,7 +22,7 @@ body {
// you may use and inherit here
//
// If you'd like to override bootstrap's own variables, you can do so here as well
-// See http://twitter.github.com/bootstrap/less.html for their names and documentation
+// See http://twitter.github.com/bootstrap/customize.html#variables for their names and documentation
//
// Example:
// @linkColor: #ff0000;
@@ -70,29 +70,27 @@
</div><!--/.well -->
</div><!--/span-->
<div class="span9">
- <%%= bootstap_flash %>
+ <%%= bootstrap_flash %>
<%%= yield %>
</div>
</div><!--/row-->
<%- else -%>
- <div class="content">
<div class="row">
- <div class="span9">
- <%%= yield %>
- </div>
- <div class="span3">
- <div class="well sidebar-nav">
- <h3>Sidebar</h3>
- <ul class="nav nav-list">
- <li class="nav-header">Sidebar</li>
- <li><%%= link_to "Link1", "/path1" %></li>
- <li><%%= link_to "Link2", "/path2" %></li>
- <li><%%= link_to "Link3", "/path3" %></li>
- </ul>
- </div><!--/.well -->
- </div><!--/span-->
+ <div class="span9">
+ <%%= yield %>
+ </div>
+ <div class="span3">
+ <div class="well sidebar-nav">
+ <h3>Sidebar</h3>
+ <ul class="nav nav-list">
+ <li class="nav-header">Sidebar</li>
+ <li><%%= link_to "Link1", "/path1" %></li>
+ <li><%%= link_to "Link2", "/path2" %></li>
+ <li><%%= link_to "Link3", "/path3" %></li>
+ </ul>
+ </div><!--/.well -->
+ </div><!--/span-->
</div><!--/row-->
- </div><!--/content-->
<%- end -%>
<footer>
@@ -46,19 +46,18 @@
.span9
= yield
<% else %>
- .content
- .row
- .span9
- = bootstap_flash
- = yield
- .span3
- .well.sidebar-nav
- %h3 Sidebar
- %ul.nav.nav-list
- %li.nav-header Sidebar
- %li= link_to "Link 1", "/path1"
- %li= link_to "Link 2", "/path2"
- %li= link_to "Link 3", "/path3"
+ .row
+ .span9
+ = bootstrap_flash
+ = yield
+ .span3
+ .well.sidebar-nav
+ %h3 Sidebar
+ %ul.nav.nav-list
+ %li.nav-header Sidebar
+ %li= link_to "Link 1", "/path1"
+ %li= link_to "Link 2", "/path2"
+ %li= link_to "Link 3", "/path3"
<% end %>
%footer
%p &copy; Company 2012
@@ -46,19 +46,18 @@ html lang="en"
.span9
= yield
<% else %>
- .content
- .row
- .span9
- = bootstap_flash
- = yield
- .span3
- .well.sidebar-nav
- h3 Sidebar
- ul.nav.nav-list
- li.nav-header Sidebar
- li= link_to "Link 1", "/path1"
- li= link_to "Link 2", "/path2"
- li= link_to "Link 3", "/path3"
+ .row
+ .span9
+ = bootstrap_flash
+ = yield
+ .span3
+ .well.sidebar-nav
+ h3 Sidebar
+ ul.nav.nav-list
+ li.nav-header Sidebar
+ li= link_to "Link 1", "/path1"
+ li= link_to "Link 2", "/path2"
+ li= link_to "Link 3", "/path3"
<% end %>
footer
p &copy; Company 2012
@@ -1,7 +1,7 @@
module Twitter
module Bootstrap
module Rails
- VERSION = "2.1.1"
+ VERSION = "2.1.3"
end
end
end
@@ -20,13 +20,13 @@ Gem::Specification.new do |s|
s.add_dependency 'railties', '>= 3.1'
s.add_dependency 'actionpack', '>= 3.1'
-
+
if (RUBY_PLATFORM == 'java')
- s.add_dependency 'therubyrhino', '~> 1.73.4'
- elsif (RUBY_PLATFORM != 'i386-mingw32')
- s.add_dependency 'therubyracer', '0.10.1'
+ s.add_dependency 'therubyrhino', '~> 1.73.4'
+ else
+ s.add_dependency 'therubyracer', '>= 0.10.2'
end
-
+
s.add_runtime_dependency 'less-rails', '~> 2.2.3'
s.add_development_dependency 'rails', '>= 3.1'
end
@@ -10,3 +10,4 @@
//= require twitter/bootstrap/bootstrap-collapse
//= require twitter/bootstrap/bootstrap-carousel
//= require twitter/bootstrap/bootstrap-typeahead
+//= require twitter/bootstrap/bootstrap-affix
@@ -0,0 +1,104 @@
+/* ==========================================================
+ * bootstrap-affix.js v2.1.1
+ * http://twitter.github.com/bootstrap/javascript.html#affix
+ * ==========================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ========================================================== */
+
+
+!function ($) {
+
+ "use strict"; // jshint ;_;
+
+
+ /* AFFIX CLASS DEFINITION
+ * ====================== */
+
+ var Affix = function (element, options) {
+ this.options = $.extend({}, $.fn.affix.defaults, options)
+ this.$window = $(window).on('scroll.affix.data-api', $.proxy(this.checkPosition, this))
+ this.$element = $(element)
+ this.checkPosition()
+ }
+
+ Affix.prototype.checkPosition = function () {
+ if (!this.$element.is(':visible')) return
+
+ var scrollHeight = $(document).height()
+ , scrollTop = this.$window.scrollTop()
+ , position = this.$element.offset()
+ , offset = this.options.offset
+ , offsetBottom = offset.bottom
+ , offsetTop = offset.top
+ , reset = 'affix affix-top affix-bottom'
+ , affix
+
+ if (typeof offset != 'object') offsetBottom = offsetTop = offset
+ if (typeof offsetTop == 'function') offsetTop = offset.top()
+ if (typeof offsetBottom == 'function') offsetBottom = offset.bottom()
+
+ affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ?
+ false : offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ?
+ 'bottom' : offsetTop != null && scrollTop <= offsetTop ?
+ 'top' : false
+
+ if (this.affixed === affix) return
+
+ this.affixed = affix
+ this.unpin = affix == 'bottom' ? position.top - scrollTop : null
+
+ this.$element.removeClass(reset).addClass('affix' + (affix ? '-' + affix : ''))
+ }
+
+
+ /* AFFIX PLUGIN DEFINITION
+ * ======================= */
+
+ $.fn.affix = function (option) {
+ return this.each(function () {
+ var $this = $(this)
+ , data = $this.data('affix')
+ , options = typeof option == 'object' && option
+ if (!data) $this.data('affix', (data = new Affix(this, options)))
+ if (typeof option == 'string') data[option]()
+ })
+ }
+
+ $.fn.affix.Constructor = Affix
+
+ $.fn.affix.defaults = {
+ offset: 0
+ }
+
+
+ /* AFFIX DATA-API
+ * ============== */
+
+ $(window).on('load', function () {
+ $('[data-spy="affix"]').each(function () {
+ var $spy = $(this)
+ , data = $spy.data()
+
+ data.offset = data.offset || {}
+
+ data.offsetBottom && (data.offset.bottom = data.offsetBottom)
+ data.offsetTop && (data.offset.top = data.offsetTop)
+
+ $spy.affix(data)
+ })
+ })
+
+
+}(window.jQuery);
@@ -1,5 +1,5 @@
/* ==========================================================
- * bootstrap-alert.js v2.0.4
+ * bootstrap-alert.js v2.1.1
* http://twitter.github.com/bootstrap/javascript.html#alerts
* ==========================================================
* Copyright 2012 Twitter, Inc.
@@ -1,5 +1,5 @@
/* ============================================================
- * bootstrap-button.js v2.0.4
+ * bootstrap-button.js v2.1.1
* http://twitter.github.com/bootstrap/javascript.html#buttons
* ============================================================
* Copyright 2012 Twitter, Inc.
@@ -51,7 +51,7 @@
}
Button.prototype.toggle = function () {
- var $parent = this.$element.parent('[data-toggle="buttons-radio"]')
+ var $parent = this.$element.closest('[data-toggle="buttons-radio"]')
$parent && $parent
.find('.active')
Oops, something went wrong.

0 comments on commit 8fb5122

Please sign in to comment.