twitter-bootstrap-rails 2.1.7 → 2.2.8

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 (117) hide show
  1. data/README.md +428 -21
  2. data/Rakefile +15 -3
  3. data/app/assets/fonts/fontawesome-webfont.eot +0 -0
  4. data/app/assets/fonts/fontawesome-webfont.svg +399 -0
  5. data/app/assets/fonts/fontawesome-webfont.ttf +0 -0
  6. data/app/assets/fonts/fontawesome-webfont.woff +0 -0
  7. data/{vendor → app}/assets/javascripts/twitter/bootstrap/bootstrap-affix.js +12 -1
  8. data/{vendor → app}/assets/javascripts/twitter/bootstrap/bootstrap-alert.js +12 -1
  9. data/{vendor → app}/assets/javascripts/twitter/bootstrap/bootstrap-button.js +12 -1
  10. data/{vendor → app}/assets/javascripts/twitter/bootstrap/bootstrap-carousel.js +42 -11
  11. data/{vendor → app}/assets/javascripts/twitter/bootstrap/bootstrap-collapse.js +18 -7
  12. data/{vendor → app}/assets/javascripts/twitter/bootstrap/bootstrap-dropdown.js +32 -11
  13. data/{vendor → app}/assets/javascripts/twitter/bootstrap/bootstrap-modal.js +25 -12
  14. data/{vendor → app}/assets/javascripts/twitter/bootstrap/bootstrap-popover.js +17 -6
  15. data/{vendor → app}/assets/javascripts/twitter/bootstrap/bootstrap-scrollspy.js +13 -2
  16. data/{vendor → app}/assets/javascripts/twitter/bootstrap/bootstrap-tab.js +12 -1
  17. data/{vendor → app}/assets/javascripts/twitter/bootstrap/bootstrap-tooltip.js +115 -30
  18. data/{vendor → app}/assets/javascripts/twitter/bootstrap/bootstrap-transition.js +1 -1
  19. data/{vendor → app}/assets/javascripts/twitter/bootstrap/bootstrap-typeahead.js +38 -13
  20. data/app/assets/stylesheets/twitter-bootstrap-static/bootstrap.css.erb +890 -0
  21. data/app/assets/stylesheets/twitter-bootstrap-static/fontawesome.css.erb +787 -0
  22. data/{vendor → app}/assets/stylesheets/twitter-bootstrap-static/sprites.css.erb +2 -2
  23. data/app/helpers/badge_label_helper.rb +16 -0
  24. data/app/helpers/bootstrap_flash_helper.rb +22 -16
  25. data/app/helpers/glyph_helper.rb +7 -2
  26. data/app/helpers/modal_helper.rb +29 -16
  27. data/app/helpers/navbar_helper.rb +194 -0
  28. data/app/helpers/twitter_breadcrumbs_helper.rb +7 -2
  29. data/app/views/twitter-bootstrap/_breadcrumbs.html.erb +2 -2
  30. data/lib/generators/bootstrap/install/install_generator.rb +19 -6
  31. data/lib/generators/bootstrap/install/templates/bootstrap.coffee +2 -3
  32. data/lib/generators/bootstrap/install/templates/bootstrap.js +2 -3
  33. data/lib/generators/bootstrap/install/templates/bootstrap_and_overrides.less +8 -10
  34. data/lib/generators/bootstrap/install/templates/en.bootstrap.yml +18 -0
  35. data/lib/generators/bootstrap/layout/templates/layout.html.erb +10 -12
  36. data/lib/generators/bootstrap/layout/templates/layout.html.haml +8 -11
  37. data/lib/generators/bootstrap/layout/templates/layout.html.slim +10 -11
  38. data/lib/generators/bootstrap/themed/templates/edit.html.erb +1 -2
  39. data/lib/generators/bootstrap/themed/templates/edit.html.haml +1 -1
  40. data/lib/generators/bootstrap/themed/templates/edit.html.slim +1 -1
  41. data/lib/generators/bootstrap/themed/templates/index.html.erb +1 -1
  42. data/lib/generators/bootstrap/themed/templates/index.html.haml +1 -1
  43. data/lib/generators/bootstrap/themed/templates/index.html.slim +1 -1
  44. data/lib/generators/bootstrap/themed/templates/new.html.erb +1 -2
  45. data/lib/generators/bootstrap/themed/templates/new.html.haml +1 -1
  46. data/lib/generators/bootstrap/themed/templates/new.html.slim +1 -1
  47. data/lib/generators/bootstrap/themed/templates/show.html.erb +1 -1
  48. data/lib/generators/bootstrap/themed/templates/show.html.haml +1 -1
  49. data/lib/generators/bootstrap/themed/templates/show.html.slim +1 -1
  50. data/lib/generators/bootstrap/themed/themed_generator.rb +2 -2
  51. data/lib/twitter/bootstrap/rails/engine.rb +3 -0
  52. data/lib/twitter/bootstrap/rails/twitter-bootstrap-breadcrumbs.rb +14 -2
  53. data/lib/twitter/bootstrap/rails/version.rb +2 -2
  54. data/lib/twitter-bootstrap-rails.rb +4 -4
  55. data/spec/lib/twitter_bootstrap_rails/badge_label_helper_spec.rb +22 -0
  56. data/spec/lib/twitter_bootstrap_rails/modal_helper_spec.rb +62 -0
  57. data/spec/lib/twitter_bootstrap_rails/navbar_helper_spec.rb +362 -0
  58. data/spec/lib/twitter_bootstrap_rails/uri_state_spec.rb +47 -0
  59. data/spec/spec_helper.rb +11 -0
  60. data/test/lib/breadcrumbs_test.rb +75 -0
  61. data/test/test_helper.rb +11 -0
  62. data/vendor/assets/stylesheets/twitter-bootstrap-static/bootstrap.css.erb +316 -294
  63. data/vendor/static-source/fontawesome.less +8 -6
  64. data/vendor/static-source/sprites.less +3 -2
  65. data/vendor/toolkit/fontawesome/bootstrap.less +84 -0
  66. data/vendor/toolkit/fontawesome/core.less +129 -0
  67. data/vendor/toolkit/fontawesome/extras.less +93 -0
  68. data/vendor/toolkit/fontawesome/font-awesome-ie7.less +1953 -0
  69. data/vendor/toolkit/fontawesome/font-awesome.less +33 -0
  70. data/vendor/toolkit/fontawesome/icons.less +381 -0
  71. data/vendor/toolkit/fontawesome/mixins.less +48 -0
  72. data/vendor/toolkit/fontawesome/path.less +14 -0
  73. data/vendor/toolkit/fontawesome/variables.less +735 -0
  74. data/vendor/toolkit/twitter/bootstrap/alerts.less +14 -0
  75. data/vendor/toolkit/twitter/bootstrap/bootstrap.less +4 -4
  76. data/vendor/toolkit/twitter/bootstrap/breadcrumbs.less +6 -6
  77. data/vendor/toolkit/twitter/bootstrap/button-groups.less +31 -44
  78. data/vendor/toolkit/twitter/bootstrap/buttons.less +13 -17
  79. data/vendor/toolkit/twitter/bootstrap/carousel.less +48 -21
  80. data/vendor/toolkit/twitter/bootstrap/close.less +2 -1
  81. data/vendor/toolkit/twitter/bootstrap/code.less +3 -0
  82. data/vendor/toolkit/twitter/bootstrap/dropdowns.less +32 -21
  83. data/vendor/toolkit/twitter/bootstrap/forms.less +17 -10
  84. data/vendor/toolkit/twitter/bootstrap/labels-badges.less +12 -2
  85. data/vendor/toolkit/twitter/bootstrap/media.less +2 -2
  86. data/vendor/toolkit/twitter/bootstrap/mixins.less +25 -9
  87. data/vendor/toolkit/twitter/bootstrap/modals.less +4 -3
  88. data/vendor/toolkit/twitter/bootstrap/navbar.less +35 -13
  89. data/vendor/toolkit/twitter/bootstrap/navs.less +45 -21
  90. data/vendor/toolkit/twitter/bootstrap/pager.less +3 -1
  91. data/vendor/toolkit/twitter/bootstrap/pagination.less +3 -1
  92. data/vendor/toolkit/twitter/bootstrap/popovers.less +55 -39
  93. data/vendor/toolkit/twitter/bootstrap/reset.less +82 -4
  94. data/vendor/toolkit/twitter/bootstrap/responsive-767px-max.less +2 -2
  95. data/vendor/toolkit/twitter/bootstrap/responsive-navbar.less +6 -2
  96. data/vendor/toolkit/twitter/bootstrap/responsive-utilities.less +16 -0
  97. data/vendor/toolkit/twitter/bootstrap/responsive.less +1 -1
  98. data/vendor/toolkit/twitter/bootstrap/scaffolding.less +2 -1
  99. data/vendor/toolkit/twitter/bootstrap/sprites.less +9 -5
  100. data/vendor/toolkit/twitter/bootstrap/tables.less +54 -46
  101. data/vendor/toolkit/twitter/bootstrap/thumbnails.less +3 -2
  102. data/vendor/toolkit/twitter/bootstrap/tooltip.less +6 -6
  103. data/vendor/toolkit/twitter/bootstrap/type.less +44 -24
  104. data/vendor/toolkit/twitter/bootstrap/variables.less +3 -3
  105. metadata +130 -44
  106. data/lib/generators/bootstrap/partial/templates/_navbar.html.erb +0 -13
  107. data/vendor/assets/fonts/fontawesome-webfont.eot +0 -0
  108. data/vendor/assets/fonts/fontawesome-webfont.svg +0 -255
  109. data/vendor/assets/fonts/fontawesome-webfont.ttf +0 -0
  110. data/vendor/assets/fonts/fontawesome-webfont.woff +0 -0
  111. data/vendor/assets/stylesheets/twitter-bootstrap-static/fontawesome.css.erb +0 -218
  112. data/vendor/toolkit/font-awesome-ie7.less +0 -245
  113. data/vendor/toolkit/fontawesome.less +0 -327
  114. /data/{vendor → app}/assets/images/twitter/bootstrap/glyphicons-halflings-white.png +0 -0
  115. /data/{vendor → app}/assets/images/twitter/bootstrap/glyphicons-halflings.png +0 -0
  116. /data/{vendor → app}/assets/javascripts/twitter/bootstrap.js +0 -0
  117. /data/{vendor → app}/assets/javascripts/twitter/bootstrap_ujs.js +0 -0
@@ -0,0 +1,47 @@
1
+ require 'spec_helper'
2
+ require 'action_view'
3
+ require 'active_support'
4
+ require_relative '../../../app/helpers/navbar_helper'
5
+
6
+ include ActionView::Helpers
7
+ include ActionView::Context
8
+ include NavbarHelper
9
+
10
+ describe NavbarHelper, 'uri_state', type: :helper do
11
+ before do
12
+ subject.stub_chain("request.host_with_port").and_return("#{HOST}")
13
+ subject.stub_chain("request.protocol").and_return("http://")
14
+ subject.stub_chain("request.url").and_return("#{HOST}/a/b")
15
+ subject.stub_chain("request.path").and_return('/a/b')
16
+ end
17
+
18
+ it 'must return active state' do
19
+ subject.uri_state('/a/b').should == :active
20
+ subject.uri_state("#{HOST}/a/b").should == :active
21
+ end
22
+
23
+ it 'must not return chosen for non get method' do
24
+ subject.uri_state('/a/b', :method => 'delete').should == :inactive
25
+ subject.uri_state("#{HOST}/a/b", :method => 'delete').should == :inactive
26
+ subject.uri_state('/a/b', "data-method" => 'delete').should == :inactive
27
+ subject.uri_state("#{HOST}/a/b", "data-method" => 'delete').should == :inactive
28
+ end
29
+
30
+ it 'must return chosen state' do
31
+ subject.uri_state('/a').should == :chosen
32
+ subject.uri_state("#{HOST}/a").should == :chosen
33
+ end
34
+
35
+ it 'must return inactive state' do
36
+ subject.uri_state('/test').should == :inactive
37
+ subject.uri_state("#{HOST}/test").should == :inactive
38
+ end
39
+
40
+ it 'must not return chosen for root url' do
41
+ subject.uri_state('/').should == :inactive
42
+ subject.uri_state("#{HOST}/").should == :inactive
43
+ end
44
+
45
+ end
46
+
47
+ HOST = "http://example.com:80"
@@ -0,0 +1,11 @@
1
+ # This file was generated by the `rspec --init` command. Conventionally, all
2
+ # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
3
+ # Require this file using `require "spec_helper"` to ensure that it is only
4
+ # loaded once.
5
+ #
6
+ # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
7
+ require 'rubygems'
8
+ require 'bundler/setup'
9
+ require 'action_view'
10
+ require 'active_support'
11
+ require 'twitter-bootstrap-rails'
@@ -0,0 +1,75 @@
1
+ require "test_helper"
2
+
3
+ module AbstractController
4
+ module Testing
5
+
6
+ class TestHelper
7
+ BREADCRUMB_NAMES = [:class_level, :class_level_i18n, :instance_level,
8
+ :instance_level_i18n, :base_level, :base_level_i18n]
9
+
10
+ class << self
11
+ BREADCRUMB_NAMES.each do |name|
12
+ define_method "#{name}_name" do
13
+ "test-breadcrumb-#{name}"
14
+ end
15
+
16
+ define_method "#{name}_path" do
17
+ "/test/breadcrumb/#{name}"
18
+ end
19
+ end
20
+ end
21
+ end
22
+
23
+ class BaseTestController < AbstractController::Base
24
+ include Twitter::Bootstrap::BreadCrumbs
25
+ include AbstractController::Callbacks
26
+
27
+ add_breadcrumb TestHelper.base_level_name, TestHelper.base_level_path
28
+ add_breadcrumb :base_level_i18n, TestHelper.base_level_i18n_path
29
+
30
+ def breadcrumbs
31
+ @breadcrumbs
32
+ end
33
+ end
34
+
35
+ class TestController < BaseTestController
36
+ add_breadcrumb TestHelper.class_level_name, TestHelper.class_level_path
37
+ add_breadcrumb :class_level_i18n, TestHelper.class_level_i18n_path
38
+
39
+ def index
40
+ add_breadcrumb TestHelper.instance_level_name, TestHelper.instance_level_path
41
+ add_breadcrumb :instance_level_i18n, TestHelper.instance_level_i18n_path
42
+ end
43
+ end
44
+
45
+ class BreadcrumbsTest < MiniTest::Unit::TestCase
46
+ def setup
47
+ options = { :scope => [:breadcrumbs, 'abstract_controller', 'testing', 'test'] }
48
+ [:class_level_i18n, :instance_level_i18n].each do |name|
49
+ I18n.expects(:t).with(name, options).returns(TestHelper.send("#{name}_name"))
50
+ end
51
+
52
+ name = :base_level_i18n
53
+ options = { :scope => [:breadcrumbs, 'abstract_controller', 'testing', 'base_test'] }
54
+ I18n.expects(:t).with(name, options).returns(TestHelper.send("#{name}_name"))
55
+
56
+ @controller = TestController.new
57
+ @controller.process(:index)
58
+ end
59
+
60
+ def test_should_have_breadcrumbs
61
+ TestHelper::BREADCRUMB_NAMES.each do |name|
62
+ assert include_breadcrumb?(name), "#{name} breadcrumb not found"
63
+ end
64
+ end
65
+
66
+ def include_breadcrumb?(name)
67
+ selected = @controller.breadcrumbs.select { |b|
68
+ b[:name] == TestHelper.send("#{name}_name") &&
69
+ b[:url] == TestHelper.send("#{name}_path")
70
+ }
71
+ selected.any?
72
+ end
73
+ end
74
+ end
75
+ end
@@ -0,0 +1,11 @@
1
+ require 'coveralls'
2
+ Coveralls.wear!
3
+
4
+ require "bundler/setup"
5
+ Bundler.require
6
+
7
+ require "minitest/autorun"
8
+ require "abstract_controller"
9
+ require "action_controller"
10
+ require "active_support/dependencies"
11
+ require "mocha/setup"