twitter-bootstrap-rails 1.4.2 → 1.4.3

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.

Files changed (30) hide show
  1. data/README.md +58 -44
  2. data/lib/generators/bootstrap/layout/layout_generator.rb +23 -0
  3. data/lib/generators/bootstrap/layout/templates/layout.html.erb +57 -0
  4. data/lib/generators/bootstrap/themed/templates/_form.html.erb +8 -0
  5. data/lib/generators/bootstrap/themed/templates/builders/builder.rb +24 -0
  6. data/lib/generators/bootstrap/themed/templates/builders/helper.rb +6 -0
  7. data/lib/generators/bootstrap/themed/templates/edit.html.erb +3 -0
  8. data/lib/generators/bootstrap/themed/templates/index.html.erb +33 -0
  9. data/lib/generators/bootstrap/themed/templates/new.html.erb +3 -0
  10. data/lib/generators/bootstrap/themed/templates/show.html.erb +5 -0
  11. data/lib/generators/bootstrap/themed/themed_generator.rb +111 -0
  12. data/lib/twitter/bootstrap/rails/version.rb +1 -1
  13. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-alerts.js +13 -2
  14. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-buttons.js +7 -5
  15. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-dropdown.js +0 -0
  16. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-modal.js +0 -0
  17. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-popover.js +7 -3
  18. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-scrollspy.js +0 -0
  19. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-tabs.js +0 -0
  20. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-twipsy.js +16 -5
  21. data/vendor/toolkit/twitter/bootstrap/bootstrap.less +0 -0
  22. data/vendor/toolkit/twitter/bootstrap/forms.less +1 -1
  23. data/vendor/toolkit/twitter/bootstrap/mixins.less +0 -1
  24. data/vendor/toolkit/twitter/bootstrap/patterns.less +7 -2
  25. data/vendor/toolkit/twitter/bootstrap/reset.less +0 -0
  26. data/vendor/toolkit/twitter/bootstrap/scaffolding.less +16 -14
  27. data/vendor/toolkit/twitter/bootstrap/tables.less +0 -0
  28. data/vendor/toolkit/twitter/bootstrap/type.less +0 -0
  29. data/vendor/toolkit/twitter/bootstrap/variables.less +0 -0
  30. metadata +27 -28
data/README.md CHANGED
@@ -20,17 +20,47 @@ You can run bundle from command line
20
20
 
21
21
  bundle install
22
22
 
23
- ## Installing to App
24
- Run generator to install Twitter Bootstrap
25
- You can run generator from command line
26
23
 
24
+ ## Installing to App (using Generators)
27
25
 
28
- rails g bootstrap:install
26
+ You can run following generators to get started with Twitter Bootstrap quickly.
29
27
 
30
- Generator;
28
+ 1. Install (requires directives to Asset pipeline.)
31
29
 
32
- Adds bootstrap requires to application.css and application.js.
33
- Adds bootstrap boilerplate Less and Coffee files to build with Twitter Bootstrap easily.
30
+
31
+ Usage:
32
+
33
+ rails g bootstrap:install
34
+
35
+
36
+ 2. Layout (generates Twitter Bootstrap compatible layout.)
37
+
38
+
39
+ Usage:
40
+
41
+ rails g bootstrap:layout [LAYOUT_NAME] [*fixed or fluid] [options]
42
+
43
+
44
+ Example:
45
+
46
+
47
+ rails g bootstrap:layout application fixed
48
+
49
+
50
+ 3. Themed (generates Twitter Bootstrap compatible scaffold views.)
51
+
52
+
53
+ Usage:
54
+
55
+
56
+ rails g bootstrap:themed [RESOURCE_NAME] [LAYOUT] [options]
57
+
58
+
59
+ Example:
60
+
61
+
62
+ rails g scaffold post title:string description:text
63
+ rails g bootstrap:themed posts
34
64
 
35
65
 
36
66
  ## Using with Less
@@ -68,10 +98,11 @@ You have to require Bootstrap JS (bootstrap.js) in your application.js
68
98
  });
69
99
 
70
100
 
71
- ## Using With Coffeescript
101
+ ## Using Coffeescript (optionally)
72
102
 
73
103
  Using Twitter Bootstrap with the CoffeeScript is easy.
74
- Just create a "bootstrap.js.coffee" file to /app/assets/javascripts/ folder and put lines below.
104
+ twitter-bootstrap-rails generates a "bootstrap.js.coffee" file for you
105
+ to /app/assets/javascripts/ folder.
75
106
 
76
107
  $ ->
77
108
  $("body > .topbar").scrollSpy()
@@ -96,36 +127,31 @@ Just create a "bootstrap.js.coffee" file to /app/assets/javascripts/ folder and
96
127
  $(".btn").button "complete"
97
128
 
98
129
 
99
- ## Using Static CSS, JS (w/o Less)
130
+ ## Using simple_form and integrating Twitter Bootstrap (optionally)
100
131
 
101
- twitter-bootstrap-rails has seperate branch (w/o Less) that just serves latest static CSS, JS files.
132
+ First, include simple_form in Gemfile;
102
133
 
103
- You can install from latest build (from branch);
134
+ gem 'simple_form'
135
+
136
+
137
+ Create initializer for simple_form to ("/config/initializers/simple_form.rb")
104
138
 
105
- gem 'twitter-bootstrap-rails', :git => "git://github.com/seyhunak/twitter-bootstrap-rails.git", :branch => "static"
106
139
 
140
+ Check this gist;
107
141
 
108
- ## Changelog
109
- <ul>
110
- <li>Version 0.0.5 deprecated</li>
111
- <li>Asset files updated to latest and removed version numbers</li>
112
- <li>Implemented Less::Rails Railtie to use with LESS</li>
113
- <li>Fixed railtie to only initialize Less when installed</li>
114
- <li>Created new branch for the static version of Bootstrap (w/o Less) - check static branch</li>
115
- <li>Added path to support heroku deploy</li>
116
- <li>Rake precompile issue fixed</li>
117
- <li>Updated asset files to 1.4.0</li>
118
- <li>Updated dependency less-rails (now requires 2.1.0)</li>
119
- <li>Added generators</li>
120
- <li>Fixed generators</li>
121
- <li>Fixed class name conflicts from (bootstrap.js.coffee)</li>
122
- </ul>
142
+ https://gist.github.com/1479043
123
143
 
124
144
 
125
- ## Future
126
- <ul>
127
- <li>Writing tests (not implemented yet)</li>
128
- </ul>
145
+ Note: Don't forget to reboot server.
146
+
147
+
148
+ ## Using Static CSS, JS (w/o Less)
149
+
150
+ twitter-bootstrap-rails has seperate branch (w/o Less) that just serves latest static CSS, JS files.
151
+
152
+ You can install from latest build (from branch);
153
+
154
+ gem 'twitter-bootstrap-rails', :git => "git://github.com/seyhunak/twitter-bootstrap-rails.git", :branch => "static"
129
155
 
130
156
 
131
157
  ## Credits
@@ -134,18 +160,6 @@ Seyhun Akyürek - seyhunak [at] gmail com
134
160
  [Follow me on Twitter](http://twitter.com/seyhunak "Twitter")
135
161
 
136
162
 
137
- ## Contributors & Patches
138
- <ul>
139
- <li>Daniel Morris</li>
140
- <li>Bradly Feeley</li>
141
- <li>Guilherme Moreira</li>
142
- <li>Alex Behar</li>
143
- <li>Brandon Keene</li>
144
- <li>Anthony Corcutt</li>
145
- <li>Colin Warren</li>
146
- </ul>
147
-
148
-
149
163
  ## Thanks
150
164
  Twitter Bootstrap
151
165
  http://twitter.github.com/bootstrap
@@ -0,0 +1,23 @@
1
+ require 'rails/generators'
2
+
3
+ module Bootstrap
4
+ module Generators
5
+ class LayoutGenerator < Rails::Generators::Base
6
+ source_root File.expand_path("../templates", __FILE__)
7
+ desc "This generator creates layout file with navigation."
8
+ argument :layout_name, :type => :string, :default => "application"
9
+ argument :layout_type, :type => :string, :default => "fixed",
10
+ :banner => "*fixed or fluid"
11
+
12
+ attr_reader :app_name, :container_class
13
+
14
+ def generate_layout
15
+ app = Rails.application
16
+ @app_name = app.class.to_s.split("::").first
17
+ @container_class = layout_type == "fluid" ? "container-fluid" : "container"
18
+ ext = app.config.generators.options[:rails][:template_engine] || :erb
19
+ template "layout.html.erb", "app/views/layouts/#{layout_name}.html.erb"
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,57 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title><%= app_name %></title>
5
+ <%%= stylesheet_link_tag "application" %>
6
+ <%%= javascript_include_tag "application" %>
7
+ <%%= csrf_meta_tags %>
8
+ </head>
9
+ <body style="padding-top: 60px">
10
+ <div class="topbar">
11
+ <div class="topbar-inner">
12
+ <div class="<%= container_class %>">
13
+ <h3><%%= link_to "<%= app_name %>", "/" %></h3>
14
+ <ul class="nav">
15
+ <%- (1..3).each do |i| -%>
16
+ <li><%%= link_to "Link<%= i %>", "/path<%= i %>" %></li>
17
+ <%- end -%>
18
+ </ul>
19
+ </div>
20
+ </div>
21
+ </div>
22
+ <div class="<%= container_class %>">
23
+ <%- if layout_type == "fluid" -%>
24
+ <div class="sidebar">
25
+ <div class="well">
26
+ <h5>Sidebar</h5>
27
+ <ul>
28
+ <%- (1..3).each do |i| -%>
29
+ <li><%%= link_to "Link<%= i %>", "/path<%= i %>" %></li>
30
+ <%- end -%>
31
+ </ul>
32
+ </div>
33
+ </div>
34
+ <div class="content">
35
+ <%%= yield %>
36
+ </div>
37
+ <%- else -%>
38
+ <div class="content">
39
+ <div class="row">
40
+ <div class="span11">
41
+ <%%= yield %>
42
+ </div>
43
+ <div class="span1">&nbsp;</div>
44
+ <div class="span4">
45
+ <h3>Sidebar</h3>
46
+ <ul>
47
+ <%- (1..3).each do |i| -%>
48
+ <li><%%= link_to "Link<%= i %>", "/path<%= i %>" %></li>
49
+ <%- end -%>
50
+ </ul>
51
+ </div>
52
+ </div>
53
+ </div>
54
+ <%- end -%>
55
+ </div>
56
+ </body>
57
+ </html>
@@ -0,0 +1,8 @@
1
+ <% columns.each do |column| %>
2
+ <%%= f.label :<%= column.name %>, t("activerecord.attributes.<%= model_name.underscore %>.<%= column.name %>", :default => "<%= column.name.humanize %>"), :class => :label %>
3
+ <%%= f.<%= column.field_type %> :<%= column.name %>, :class => '<%= column.field_type %>' %>
4
+ <%- end -%>
5
+ <div class="actions">
6
+ <button class="btn primary" type="submit">Save</button> or
7
+ <%%= link_to "Cancel", <%= controller_routing_path %>_path %>
8
+ </div>
@@ -0,0 +1,24 @@
1
+ class BootstrapFormBuilder < ActionView::Helpers::FormBuilder
2
+ helpers = field_helpers +
3
+ %w{date_select datetime_select time_select} +
4
+ %w{collection_select select country_select time_zone_select} -
5
+ %w{hidden_field label fields_for}
6
+
7
+ helpers.each do |name|
8
+ define_method(name) do |field, *args|
9
+ options_index = ActionView::Helpers::FormBuilder.instance_method(name.to_sym).parameters.index([:opt,:options])
10
+ if options_index.nil?
11
+ options = args.last.is_a?(Hash) ? args.pop : {}
12
+ else
13
+ options = args[options_index - 1]
14
+ end
15
+ label = label(field, options[:label], :class => options[:label_class])
16
+ @template.content_tag(:div, :class => 'clearfix') do
17
+ @template.concat(label)
18
+ @template.concat(@template.content_tag(:div, :class => 'input') { @template.concat(super(field, *args)) })
19
+ end
20
+ end
21
+ end
22
+ end
23
+
24
+ ActionView::Base.default_form_builder = BootstrapFormBuilder
@@ -0,0 +1,6 @@
1
+ module ApplicationHelper
2
+ def bootstrap_form_for(object, options = {}, &block)
3
+ options[:builder] = BootstrapFormBuilder
4
+ form_for(object, options, &block)
5
+ end
6
+ end
@@ -0,0 +1,3 @@
1
+ <%%= bootstrap_form_for :<%= model_name.underscore %>, :url => <%= controller_routing_path %>_path, :html => { :class => :form } do |f| -%>
2
+ <%%= render :partial => "form", :locals => {:f => f} %>
3
+ <%% end -%>
@@ -0,0 +1,33 @@
1
+ <table class="zebra-striped">
2
+ <thead>
3
+ <tr>
4
+ <th>ID</th>
5
+ <% unless columns.empty? -%>
6
+ <th>
7
+ <%%= t("activerecord.attributes.<%= singular_controller_routing_path %>.<%= columns.first.name %>", :default => t("activerecord.labels.<%= columns.first.name %>", :default => "<%= columns.first.name.capitalize %>")) %>
8
+ </th>
9
+ <% end -%>
10
+ <th>Created at</th>
11
+ <th>Actions</th>
12
+ </tr>
13
+ </thead>
14
+ <tbody>
15
+ <%% @<%= plural_resource_name %>.each do |<%= resource_name %>| -%>
16
+ <tr>
17
+ <td><%%= <%= resource_name %>.id %></td>
18
+ <% unless columns.empty? -%>
19
+ <td><%%= link_to <%= resource_name %>.<%= columns.first.name %>, <%= singular_controller_routing_path %>_path(<%= resource_name %>) %>
20
+ </td>
21
+ <% end -%>
22
+ <td><%%= <%= resource_name %>.created_at %></td>
23
+ <td>
24
+ <%%= link_to "Show", <%= singular_controller_routing_path %>_path(<%= resource_name %>) %>
25
+ <%%= link_to "Edit", edit_<%= singular_controller_routing_path %>_path(<%= resource_name %>) %>
26
+ <%%= link_to "Destroy", <%= singular_controller_routing_path %>_path(<%= resource_name %>), :method => :delete, :confirm => "#{t("web-app-theme.confirm", :default => "Are you sure?")}" %>
27
+ </td>
28
+ </tr>
29
+ <%% end -%>
30
+ </tbody>
31
+ </table>
32
+
33
+ <%%= link_to "New", new_<%= singular_controller_routing_path %>_path, :class => 'btn primary' %>
@@ -0,0 +1,3 @@
1
+ <%%= bootstrap_form_for :<%= model_name.underscore %>, :url => <%= controller_routing_path %>_path, :html => { :class => :form } do |f| -%>
2
+ <%%= render :partial => "form", :locals => {:f => f} %>
3
+ <%% end -%>
@@ -0,0 +1,5 @@
1
+ <% columns.each do |column| %>
2
+ <label class="label"><%%= t("activerecord.attributes.<%= singular_controller_routing_path %>.<%= column.name %>", :default => t("activerecord.labels.<%= column.name %>", :default => "<%= column.name.humanize %>")) %>:</label>
3
+ <p><%%= @<%= resource_name %>.<%= column.name %> %></p>
4
+ <%- end -%>
5
+ <%%= link_to "Back", <%= controller_routing_path %>_path %>
@@ -0,0 +1,111 @@
1
+ require 'rails/generators'
2
+ require 'rails/generators/generated_attribute'
3
+
4
+ module Bootstrap
5
+ module Generators
6
+ class ThemedGenerator < Rails::Generators::Base
7
+ source_root File.expand_path('../templates', __FILE__)
8
+ argument :controller_path, :type => :string
9
+ argument :model_name, :type => :string, :required => false
10
+ argument :layout, :type => :string, :default => "application",
11
+ :banner => "Specify application layout"
12
+
13
+ def initialize(args, *options)
14
+ super(args, *options)
15
+ initialize_views_variables
16
+ end
17
+
18
+ def copy_form_builder
19
+ copy_file "builders/builder.rb", "app/form_builders/bootstrap_form_builder.rb"
20
+ end
21
+
22
+ def copy_helper
23
+ if File.exist?('app/helpers/application_helper.rb')
24
+ insert_into_file "app/helpers/application_helper.rb"," def bootstrap_form_for(object, options = {}, &block)
25
+ options[:builder] = BootstrapFormBuilder
26
+ form_for(object, options, &block)
27
+ end\n", :after => "module ApplicationHelper\n"
28
+ else
29
+ copy_file "builders/helper.rb", "app/helpers/application_helper.rb"
30
+ end
31
+ end
32
+
33
+ def copy_views
34
+ generate_views
35
+ gsub_file(File.join('app/views/layouts', "#{layout}.html.erb"), /\<ul\s+class=\"nav\">.*\<\/ul\>/mi) do |match|
36
+ match.gsub!(/\<\/ul\>/, "")
37
+ %|#{match} <li class="<%= controller.controller_path == '#{@controller_file_path}' ? 'active' : '' %>"><a href="<%= #{controller_routing_path}_path %>">#{plural_model_name}</a></li></ul>|
38
+ end
39
+ end
40
+
41
+ protected
42
+
43
+ def initialize_views_variables
44
+ @base_name, @controller_class_path, @controller_file_path, @controller_class_nesting, @controller_class_nesting_depth = extract_modules(controller_path)
45
+ @controller_routing_path = @controller_file_path.gsub(/\//, '_')
46
+ @model_name = @base_name.singularize unless @model_name
47
+ @model_name = @model_name.camelize
48
+ end
49
+
50
+ def controller_routing_path
51
+ @controller_routing_path
52
+ end
53
+
54
+ def singular_controller_routing_path
55
+ @controller_routing_path.singularize
56
+ end
57
+
58
+ def model_name
59
+ @model_name
60
+ end
61
+
62
+ def plural_model_name
63
+ @model_name.pluralize
64
+ end
65
+
66
+ def resource_name
67
+ @model_name.underscore
68
+ end
69
+
70
+ def plural_resource_name
71
+ resource_name.pluralize
72
+ end
73
+
74
+ def columns
75
+ begin
76
+ excluded_column_names = %w[id created_at updated_at]
77
+ Kernel.const_get(@model_name).columns.reject{|c| excluded_column_names.include?(c.name) }.collect{|c| Rails::Generators::GeneratedAttribute.new(c.name, c.type)}
78
+ rescue NoMethodError
79
+ Kernel.const_get(@model_name).fields.collect{|c| c[1]}.reject{|c| excluded_column_names.include?(c.name) }.collect{|c| Rails::Generators::GeneratedAttribute.new(c.name, c.type.to_s)}
80
+ end
81
+ end
82
+
83
+ def extract_modules(name)
84
+ modules = name.include?('/') ? name.split('/') : name.split('::')
85
+ name = modules.pop
86
+ path = modules.map { |m| m.underscore }
87
+ file_path = (path + [name.underscore]).join('/')
88
+ nesting = modules.map { |m| m.camelize }.join('::')
89
+ [name, path, file_path, nesting, modules.size]
90
+ end
91
+
92
+ def generate_views
93
+ views = {
94
+ 'index.html.erb' => File.join('app/views', @controller_file_path, "index.html.erb"),
95
+ 'new.html.erb' => File.join('app/views', @controller_file_path, "new.html.erb"),
96
+ 'edit.html.erb' => File.join('app/views', @controller_file_path, "edit.html.erb"),
97
+ '_form.html.erb' => File.join('app/views', @controller_file_path, "_form.html.erb"),
98
+ 'show.html.erb' => File.join('app/views', @controller_file_path, "show.html.erb")}
99
+ selected_views = views
100
+ options.engine == generate_erb(selected_views)
101
+ end
102
+
103
+ def generate_erb(views)
104
+ views.each do |template_name, output_path|
105
+ template template_name, output_path
106
+ end
107
+ end
108
+
109
+ end
110
+ end
111
+ end
@@ -1,7 +1,7 @@
1
1
  module Twitter
2
2
  module Bootstrap
3
3
  module Rails
4
- VERSION = "1.4.2"
4
+ VERSION = "1.4.3"
5
5
  end
6
6
  end
7
7
  end
@@ -54,6 +54,7 @@
54
54
  * ====================== */
55
55
 
56
56
  var Alert = function ( content, options ) {
57
+ if (options == 'close') return this.close.call(content)
57
58
  this.settings = $.extend({}, $.fn.alert.defaults, options)
58
59
  this.$element = $(content)
59
60
  .delegate(this.settings.selector, 'click', this.close)
@@ -62,7 +63,10 @@
62
63
  Alert.prototype = {
63
64
 
64
65
  close: function (e) {
65
- var $element = $(this).parent('.alert-message')
66
+ var $element = $(this)
67
+ , className = 'alert-message'
68
+
69
+ $element = $element.hasClass(className) ? $element : $element.parent()
66
70
 
67
71
  e && e.preventDefault()
68
72
  $element.removeClass('in')
@@ -90,9 +94,16 @@
90
94
 
91
95
  return this.each(function () {
92
96
  var $this = $(this)
97
+ , data
93
98
 
94
99
  if ( typeof options == 'string' ) {
95
- return $this.data('alert')[options]()
100
+
101
+ data = $this.data('alert')
102
+
103
+ if (typeof data == 'object') {
104
+ return data[options].call( $this )
105
+ }
106
+
96
107
  }
97
108
 
98
109
  $(this).data('alert', new Alert( this, options ))
@@ -1,6 +1,6 @@
1
1
  /* ============================================================
2
- * bootstrap-dropdown.js v1.4.0
3
- * http://twitter.github.com/bootstrap/javascript.html#dropdown
2
+ * bootstrap-buttons.js v1.4.0
3
+ * http://twitter.github.com/bootstrap/javascript.html#buttons
4
4
  * ============================================================
5
5
  * Copyright 2011 Twitter, Inc.
6
6
  *
@@ -31,9 +31,11 @@
31
31
 
32
32
  $el.html( data[state] || $.fn.button.defaults[state] )
33
33
 
34
- state == 'loadingText' ?
35
- $el.addClass(d).attr(d, d) :
36
- $el.removeClass(d).removeAttr(d)
34
+ setTimeout(function () {
35
+ state == 'loadingText' ?
36
+ $el.addClass(d).attr(d, d) :
37
+ $el.removeClass(d).removeAttr(d)
38
+ }, 0)
37
39
  }
38
40
 
39
41
  function toggle(el) {
@@ -37,7 +37,7 @@
37
37
  setContent: function () {
38
38
  var $tip = this.tip()
39
39
  $tip.find('.title')[this.options.html ? 'html' : 'text'](this.getTitle())
40
- $tip.find('.content p')[this.options.html ? 'html' : 'text'](this.getContent())
40
+ $tip.find('.content > *')[this.options.html ? 'html' : 'text'](this.getContent())
41
41
  $tip[0].className = 'popover'
42
42
  }
43
43
 
@@ -51,10 +51,11 @@
51
51
  , o = this.options
52
52
 
53
53
  if (typeof this.options.content == 'string') {
54
- content = this.options.content
54
+ content = $e.attr(this.options.content)
55
55
  } else if (typeof this.options.content == 'function') {
56
56
  content = this.options.content.call(this.$element[0])
57
57
  }
58
+
58
59
  return content
59
60
  }
60
61
 
@@ -80,7 +81,10 @@
80
81
 
81
82
  $.fn.popover.defaults = $.extend({} , $.fn.twipsy.defaults, {
82
83
  placement: 'right'
84
+ , content: 'data-content'
83
85
  , template: '<div class="arrow"></div><div class="inner"><h3 class="title"></h3><div class="content"><p></p></div></div>'
84
86
  })
85
87
 
86
- }( window.jQuery || window.ender );
88
+ $.fn.twipsy.rejectAttrOptions.push( 'content' )
89
+
90
+ }( window.jQuery || window.ender );
@@ -168,10 +168,7 @@
168
168
  }
169
169
 
170
170
  , tip: function() {
171
- if (!this.$tip) {
172
- this.$tip = $('<div class="twipsy" />').html(this.options.template)
173
- }
174
- return this.$tip
171
+ return this.$tip = this.$tip || $('<div class="twipsy" />').html(this.options.template)
175
172
  }
176
173
 
177
174
  , validate: function() {
@@ -194,6 +191,10 @@
194
191
  this.enabled = !this.enabled
195
192
  }
196
193
 
194
+ , toggle: function () {
195
+ this[this.tip().hasClass('in') ? 'hide' : 'show']()
196
+ }
197
+
197
198
  }
198
199
 
199
200
 
@@ -303,8 +304,18 @@
303
304
  , template: '<div class="twipsy-arrow"></div><div class="twipsy-inner"></div>'
304
305
  }
305
306
 
307
+ $.fn.twipsy.rejectAttrOptions = [ 'title' ]
308
+
306
309
  $.fn.twipsy.elementOptions = function(ele, options) {
307
- return $.extend({}, options, $(ele).data())
310
+ var data = $(ele).data()
311
+ , rejects = $.fn.twipsy.rejectAttrOptions
312
+ , i = rejects.length
313
+
314
+ while (i--) {
315
+ delete data[rejects[i]]
316
+ }
317
+
318
+ return $.extend({}, options, data)
308
319
  }
309
320
 
310
321
  }( window.jQuery || window.ender );
File without changes
@@ -184,7 +184,7 @@ select:focus {
184
184
  border-color: @borderColor;
185
185
  &:focus {
186
186
  border-color: darken(@borderColor, 10%);
187
- .box-shadow(0 0 6px lighten(@borderColor, 20%);
187
+ .box-shadow(0 0 6px lighten(@borderColor, 20%));
188
188
  }
189
189
  }
190
190
  // Give a small background color for input-prepend/-append
@@ -111,7 +111,6 @@
111
111
 
112
112
  // Transitions
113
113
  .transition(@transition) {
114
- -webkit-transform-style: e(%("preserve-3d"));
115
114
  -webkit-transition: @transition;
116
115
  -moz-transition: @transition;
117
116
  -ms-transition: @transition;
@@ -430,7 +430,9 @@ a.menu:after,
430
430
  .pill-content {
431
431
  }
432
432
  .tab-content > .tab-pane,
433
- .pill-content > .pill-pane {
433
+ .pill-content > .pill-pane,
434
+ .tab-content > div,
435
+ .pill-content > div {
434
436
  display: none;
435
437
  }
436
438
  .tab-content > .active,
@@ -579,7 +581,7 @@ footer {
579
581
 
580
582
  // Active and Disabled states
581
583
  &.active,
582
- :active {
584
+ &:active {
583
585
  @shadow: inset 0 2px 4px rgba(0,0,0,.25), 0 1px 2px rgba(0,0,0,.05);
584
586
  .box-shadow(@shadow);
585
587
  }
@@ -832,6 +834,8 @@ input[type=submit].btn {
832
834
  top: 50%;
833
835
  left: 50%;
834
836
  z-index: 11000;
837
+ max-height: 500px;
838
+ overflow: auto;
835
839
  width: 560px;
836
840
  margin: -250px 0 0 -280px;
837
841
  background-color: @white;
@@ -1023,6 +1027,7 @@ input[type=submit].btn {
1023
1027
  white-space: nowrap;
1024
1028
  background-color: @grayLight;
1025
1029
  .border-radius(3px);
1030
+ text-shadow: none;
1026
1031
  &.important { background-color: #c43c35; }
1027
1032
  &.warning { background-color: @orange; }
1028
1033
  &.success { background-color: @green; }
File without changes
@@ -116,22 +116,24 @@ a {
116
116
 
117
117
  // Offset column options
118
118
  .row {
119
- & > .offset1 { .offset(1); }
120
- & > .offset2 { .offset(2); }
121
- & > .offset3 { .offset(3); }
122
- & > .offset4 { .offset(4); }
123
- & > .offset5 { .offset(5); }
124
- & > .offset6 { .offset(6); }
125
- & > .offset7 { .offset(7); }
126
- & > .offset8 { .offset(8); }
127
- & > .offset9 { .offset(9); }
128
- & > .offset10 { .offset(10); }
129
- & > .offset11 { .offset(11); }
130
- & > .offset12 { .offset(12); }
119
+ > .offset1 { .offset(1); }
120
+ > .offset2 { .offset(2); }
121
+ > .offset3 { .offset(3); }
122
+ > .offset4 { .offset(4); }
123
+ > .offset5 { .offset(5); }
124
+ > .offset6 { .offset(6); }
125
+ > .offset7 { .offset(7); }
126
+ > .offset8 { .offset(8); }
127
+ > .offset9 { .offset(9); }
128
+ > .offset10 { .offset(10); }
129
+ > .offset11 { .offset(11); }
130
+ > .offset12 { .offset(12); }
131
131
  }
132
132
 
133
133
  // Unique column sizes for 16-column grid
134
134
  .span-one-third { width: 300px; }
135
135
  .span-two-thirds { width: 620px; }
136
- .offset-one-third { margin-left: 340px; }
137
- .offset-two-thirds { margin-left: 660px; }
136
+ .row {
137
+ > .offset-one-third { margin-left: 340px; }
138
+ > .offset-two-thirds { margin-left: 660px; }
139
+ }
File without changes
File without changes
File without changes
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twitter-bootstrap-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.2
4
+ version: 1.4.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,22 +9,22 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-12-11 00:00:00.000000000Z
12
+ date: 2011-12-29 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- name: less
16
- requirement: &82671160 !ruby/object:Gem::Requirement
15
+ name: jquery-rails
16
+ requirement: &82471270 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
20
20
  - !ruby/object:Gem::Version
21
- version: '0'
21
+ version: '1.0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *82671160
24
+ version_requirements: *82471270
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: less-rails
27
- requirement: &82670810 !ruby/object:Gem::Requirement
27
+ requirement: &82470700 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,21 +32,10 @@ dependencies:
32
32
  version: 2.1.0
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *82670810
36
- - !ruby/object:Gem::Dependency
37
- name: jquery-rails
38
- requirement: &82670380 !ruby/object:Gem::Requirement
39
- none: false
40
- requirements:
41
- - - ~>
42
- - !ruby/object:Gem::Version
43
- version: '1.0'
44
- type: :runtime
45
- prerelease: false
46
- version_requirements: *82670380
35
+ version_requirements: *82470700
47
36
  - !ruby/object:Gem::Dependency
48
37
  name: railties
49
- requirement: &82669710 !ruby/object:Gem::Requirement
38
+ requirement: &82470090 !ruby/object:Gem::Requirement
50
39
  none: false
51
40
  requirements:
52
41
  - - ! '>='
@@ -54,10 +43,10 @@ dependencies:
54
43
  version: '0'
55
44
  type: :runtime
56
45
  prerelease: false
57
- version_requirements: *82669710
46
+ version_requirements: *82470090
58
47
  - !ruby/object:Gem::Dependency
59
48
  name: actionpack
60
- requirement: &82669460 !ruby/object:Gem::Requirement
49
+ requirement: &82469280 !ruby/object:Gem::Requirement
61
50
  none: false
62
51
  requirements:
63
52
  - - ! '>='
@@ -65,10 +54,10 @@ dependencies:
65
54
  version: '0'
66
55
  type: :runtime
67
56
  prerelease: false
68
- version_requirements: *82669460
57
+ version_requirements: *82469280
69
58
  - !ruby/object:Gem::Dependency
70
59
  name: bundler
71
- requirement: &82669160 !ruby/object:Gem::Requirement
60
+ requirement: &82468840 !ruby/object:Gem::Requirement
72
61
  none: false
73
62
  requirements:
74
63
  - - ! '>='
@@ -76,18 +65,18 @@ dependencies:
76
65
  version: '0'
77
66
  type: :development
78
67
  prerelease: false
79
- version_requirements: *82669160
68
+ version_requirements: *82468840
80
69
  - !ruby/object:Gem::Dependency
81
70
  name: rails
82
- requirement: &82668840 !ruby/object:Gem::Requirement
71
+ requirement: &82468390 !ruby/object:Gem::Requirement
83
72
  none: false
84
73
  requirements:
85
- - - ~>
74
+ - - ! '>='
86
75
  - !ruby/object:Gem::Version
87
76
  version: 3.1.1
88
77
  type: :development
89
78
  prerelease: false
90
- version_requirements: *82668840
79
+ version_requirements: *82468390
91
80
  description: twitter-bootstrap-rails project integrates Bootstrap CSS toolkit for
92
81
  Rails 3.1 Asset Pipeline
93
82
  email:
@@ -96,6 +85,16 @@ executables: []
96
85
  extensions: []
97
86
  extra_rdoc_files: []
98
87
  files:
88
+ - lib/generators/bootstrap/layout/layout_generator.rb
89
+ - lib/generators/bootstrap/layout/templates/layout.html.erb
90
+ - lib/generators/bootstrap/themed/themed_generator.rb
91
+ - lib/generators/bootstrap/themed/templates/builders/builder.rb
92
+ - lib/generators/bootstrap/themed/templates/builders/helper.rb
93
+ - lib/generators/bootstrap/themed/templates/show.html.erb
94
+ - lib/generators/bootstrap/themed/templates/new.html.erb
95
+ - lib/generators/bootstrap/themed/templates/index.html.erb
96
+ - lib/generators/bootstrap/themed/templates/_form.html.erb
97
+ - lib/generators/bootstrap/themed/templates/edit.html.erb
99
98
  - lib/generators/bootstrap/install/templates/bootstrap.coffee
100
99
  - lib/generators/bootstrap/install/templates/application.js
101
100
  - lib/generators/bootstrap/install/templates/application.css