bootstrap-generators 2.0.1 → 2.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (127) hide show
  1. data/README.md +258 -33
  2. data/Rakefile +0 -59
  3. data/lib/bootstrap/generators/engine.rb +6 -1
  4. data/lib/bootstrap/generators/version.rb +1 -1
  5. data/lib/generators/bootstrap/install/install_generator.rb +10 -2
  6. data/lib/generators/bootstrap/install/templates/assets/stylesheets/bootstrap-variables.css.scss +120 -15
  7. data/lib/generators/bootstrap/install/templates/assets/stylesheets/bootstrap-variables.less +206 -0
  8. data/lib/generators/bootstrap/install/templates/assets/stylesheets/fluid.css +2 -0
  9. data/lib/generators/bootstrap/install/templates/assets/stylesheets/fluid.css.less +5 -4
  10. data/lib/generators/bootstrap/install/templates/assets/stylesheets/fluid.css.scss +3 -2
  11. data/lib/generators/bootstrap/install/templates/assets/stylesheets/hero.css +2 -0
  12. data/lib/generators/bootstrap/install/templates/assets/stylesheets/hero.css.less +5 -4
  13. data/lib/generators/bootstrap/install/templates/assets/stylesheets/hero.css.scss +3 -2
  14. data/lib/generators/bootstrap/install/templates/config/initializers/simple_form.rb +3 -0
  15. data/lib/generators/bootstrap/install/templates/form_builders/form_builder/_form.html.erb +3 -3
  16. data/lib/generators/bootstrap/install/templates/form_builders/form_builder/_form.html.haml +2 -2
  17. data/lib/generators/bootstrap/install/templates/form_builders/simple_form/_form.html.erb +1 -1
  18. data/lib/generators/bootstrap/install/templates/form_builders/simple_form/_form.html.haml +1 -1
  19. data/test/fixtures/application.js +3 -0
  20. data/test/lib/generators/bootstrap/install_generator_test.rb +4 -3
  21. data/test/test_helper.rb +8 -1
  22. data/vendor/assets/images/glyphicons-halflings-white.png +0 -0
  23. data/vendor/assets/images/glyphicons-halflings.png +0 -0
  24. data/vendor/assets/javascripts/bootstrap-alert.js +28 -32
  25. data/vendor/assets/javascripts/bootstrap-button.js +29 -33
  26. data/vendor/assets/javascripts/bootstrap-carousel.js +33 -21
  27. data/vendor/assets/javascripts/bootstrap-collapse.js +47 -26
  28. data/vendor/assets/javascripts/bootstrap-dropdown.js +18 -10
  29. data/vendor/assets/javascripts/bootstrap-modal.js +25 -17
  30. data/vendor/assets/javascripts/bootstrap-popover.js +13 -10
  31. data/vendor/assets/javascripts/bootstrap-scrollspy.js +44 -18
  32. data/vendor/assets/javascripts/bootstrap-tab.js +12 -7
  33. data/vendor/assets/javascripts/bootstrap-tooltip.js +40 -35
  34. data/vendor/assets/javascripts/bootstrap-transition.js +30 -20
  35. data/vendor/assets/javascripts/bootstrap-typeahead.js +29 -15
  36. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/accordion.less +5 -0
  37. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/alerts.less +2 -14
  38. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/bootstrap.less +2 -2
  39. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/breadcrumbs.less +2 -0
  40. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/button-groups.less +76 -33
  41. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/buttons.less +32 -24
  42. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/carousel.less +0 -0
  43. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/close.less +12 -1
  44. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/code.less +6 -6
  45. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/component-animations.less +7 -5
  46. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/dropdowns.less +58 -45
  47. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/forms.less +205 -144
  48. data/vendor/twitter/bootstrap/less/grid.less +5 -0
  49. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/hero-unit.less +3 -1
  50. data/vendor/twitter/bootstrap/less/labels-badges.less +55 -0
  51. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/layouts.less +1 -1
  52. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/mixins.less +235 -179
  53. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/modals.less +13 -6
  54. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/navbar.less +131 -72
  55. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/navs.less +53 -43
  56. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/pager.less +6 -0
  57. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/pagination.less +1 -0
  58. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/popovers.less +0 -0
  59. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/progress-bars.less +27 -5
  60. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/reset.less +8 -3
  61. data/vendor/twitter/bootstrap/less/responsive-1200px-min.less +26 -0
  62. data/vendor/twitter/bootstrap/less/responsive-767px-max.less +149 -0
  63. data/vendor/twitter/bootstrap/less/responsive-768px-979px.less +17 -0
  64. data/vendor/twitter/bootstrap/less/responsive-navbar.less +153 -0
  65. data/vendor/twitter/bootstrap/less/responsive-utilities.less +41 -0
  66. data/vendor/twitter/bootstrap/less/responsive.less +48 -0
  67. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/scaffolding.less +4 -4
  68. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/sprites.less +42 -9
  69. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/tables.less +46 -20
  70. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/thumbnails.less +14 -2
  71. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/tooltip.less +0 -0
  72. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/type.less +27 -13
  73. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/utilities.less +0 -0
  74. data/vendor/twitter/bootstrap/less/variables.less +206 -0
  75. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/wells.less +10 -0
  76. data/vendor/{assets/stylesheets/scss/accordion.scss → twitter/bootstrap/sass/_accordion.scss} +5 -0
  77. data/vendor/{assets/stylesheets/scss/alerts.scss → twitter/bootstrap/sass/_alerts.scss} +3 -15
  78. data/vendor/{assets/stylesheets/scss/breadcrumbs.scss → twitter/bootstrap/sass/_breadcrumbs.scss} +2 -0
  79. data/vendor/{assets/stylesheets/scss/button-groups.scss → twitter/bootstrap/sass/_button-groups.scss} +76 -33
  80. data/vendor/{assets/stylesheets/scss/buttons.scss → twitter/bootstrap/sass/_buttons.scss} +33 -25
  81. data/vendor/{assets/stylesheets/scss/carousel.scss → twitter/bootstrap/sass/_carousel.scss} +1 -1
  82. data/vendor/{assets/stylesheets/scss/close.scss → twitter/bootstrap/sass/_close.scss} +12 -1
  83. data/vendor/{assets/stylesheets/scss/code.scss → twitter/bootstrap/sass/_code.scss} +7 -7
  84. data/vendor/{assets/stylesheets/scss/component-animations.scss → twitter/bootstrap/sass/_component-animations.scss} +9 -7
  85. data/vendor/{assets/stylesheets/scss/dropdowns.scss → twitter/bootstrap/sass/_dropdowns.scss} +58 -45
  86. data/vendor/{assets/stylesheets/scss/forms.scss → twitter/bootstrap/sass/_forms.scss} +205 -145
  87. data/vendor/twitter/bootstrap/sass/_grid.scss +5 -0
  88. data/vendor/{assets/stylesheets/scss/hero-unit.scss → twitter/bootstrap/sass/_hero-unit.scss} +3 -1
  89. data/vendor/twitter/bootstrap/sass/_labels-badges.scss +52 -0
  90. data/vendor/{assets/stylesheets/scss/layouts.scss → twitter/bootstrap/sass/_layouts.scss} +2 -2
  91. data/vendor/{assets/stylesheets/scss/mixins.scss → twitter/bootstrap/sass/_mixins.scss} +246 -182
  92. data/vendor/{assets/stylesheets/scss/modals.scss → twitter/bootstrap/sass/_modals.scss} +14 -7
  93. data/vendor/{assets/stylesheets/scss/navbar.scss → twitter/bootstrap/sass/_navbar.scss} +132 -73
  94. data/vendor/{assets/stylesheets/scss/navs.scss → twitter/bootstrap/sass/_navs.scss} +53 -43
  95. data/vendor/{assets/stylesheets/scss/pager.scss → twitter/bootstrap/sass/_pager.scss} +6 -0
  96. data/vendor/{assets/stylesheets/scss/pagination.scss → twitter/bootstrap/sass/_pagination.scss} +1 -0
  97. data/vendor/{assets/stylesheets/scss/popovers.scss → twitter/bootstrap/sass/_popovers.scss} +0 -0
  98. data/vendor/{assets/stylesheets/scss/progress-bars.scss → twitter/bootstrap/sass/_progress-bars.scss} +27 -5
  99. data/vendor/{assets/stylesheets/scss/reset.scss → twitter/bootstrap/sass/_reset.scss} +8 -3
  100. data/vendor/twitter/bootstrap/sass/_responsive-1200px-min.scss +26 -0
  101. data/vendor/twitter/bootstrap/sass/_responsive-767px-max.scss +149 -0
  102. data/vendor/twitter/bootstrap/sass/_responsive-768px-979px.scss +17 -0
  103. data/vendor/twitter/bootstrap/sass/_responsive-navbar.scss +153 -0
  104. data/vendor/twitter/bootstrap/sass/_responsive-utilities.scss +41 -0
  105. data/vendor/{assets/stylesheets/scss/scaffolding.scss → twitter/bootstrap/sass/_scaffolding.scss} +4 -4
  106. data/vendor/{assets/stylesheets/scss/sprites.scss → twitter/bootstrap/sass/_sprites.scss} +40 -7
  107. data/vendor/{assets/stylesheets/scss/tables.scss → twitter/bootstrap/sass/_tables.scss} +37 -32
  108. data/vendor/{assets/stylesheets/scss/thumbnails.scss → twitter/bootstrap/sass/_thumbnails.scss} +14 -2
  109. data/vendor/{assets/stylesheets/scss/tooltip.scss → twitter/bootstrap/sass/_tooltip.scss} +1 -1
  110. data/vendor/{assets/stylesheets/scss/type.scss → twitter/bootstrap/sass/_type.scss} +27 -13
  111. data/vendor/{assets/stylesheets/scss/utilities.scss → twitter/bootstrap/sass/_utilities.scss} +0 -0
  112. data/vendor/twitter/bootstrap/sass/_variables.scss +204 -0
  113. data/vendor/{assets/stylesheets/scss/wells.scss → twitter/bootstrap/sass/_wells.scss} +10 -0
  114. data/vendor/{assets/stylesheets/scss → twitter/bootstrap/sass}/bootstrap.scss +3 -3
  115. data/vendor/twitter/bootstrap/sass/responsive.scss +48 -0
  116. metadata +93 -84
  117. data/lib/generators/bootstrap/install/templates/assets/javascripts/bootstrap-generators.js +0 -1
  118. data/lib/generators/bootstrap/install/templates/assets/stylesheets/bootstrap-variables.css.less +0 -98
  119. data/vendor/assets/stylesheets/bootstrap.css +0 -3363
  120. data/vendor/assets/stylesheets/less/grid.less +0 -8
  121. data/vendor/assets/stylesheets/less/labels.less +0 -32
  122. data/vendor/assets/stylesheets/less/responsive.less +0 -327
  123. data/vendor/assets/stylesheets/less/variables.less +0 -107
  124. data/vendor/assets/stylesheets/scss/grid.scss +0 -8
  125. data/vendor/assets/stylesheets/scss/labels.scss +0 -32
  126. data/vendor/assets/stylesheets/scss/responsive.scss +0 -327
  127. data/vendor/assets/stylesheets/scss/variables.scss +0 -107
@@ -1,5 +1,7 @@
1
1
  /*
2
2
  *= require bootstrap
3
+ *= require_self
4
+ *= require bootstrap-responsive
3
5
  */
4
6
 
5
7
  body {
@@ -1,10 +1,13 @@
1
- @import "bootstrap-variables";
1
+ @import "bootstrap";
2
2
 
3
3
  body {
4
- padding-top: $navbarHeight + 20px;
4
+ padding-top: @navbarHeight + 20px;
5
5
  padding-bottom: 40px;
6
6
  }
7
7
 
8
+ @import "responsive";
9
+ @import "bootstrap-variables";
10
+
8
11
  .sidebar-nav {
9
12
  padding: 9px 0;
10
13
  }
@@ -18,5 +21,3 @@ body {
18
21
  margin-right: 8px;
19
22
  }
20
23
  }
21
-
22
- @import "less/bootstrap";
@@ -1,10 +1,13 @@
1
1
  @import "bootstrap-variables";
2
+ @import "bootstrap";
2
3
 
3
4
  body {
4
5
  padding-top: $navbarHeight + 20px;
5
6
  padding-bottom: 40px;
6
7
  }
7
8
 
9
+ @import "responsive";
10
+
8
11
  .sidebar-nav {
9
12
  padding: 9px 0;
10
13
  }
@@ -18,5 +21,3 @@ body {
18
21
  margin-right: 8px;
19
22
  }
20
23
  }
21
-
22
- @import "scss/bootstrap";
@@ -1,5 +1,7 @@
1
1
  /*
2
2
  *= require bootstrap
3
+ *= require_self
4
+ *= require bootstrap-responsive
3
5
  */
4
6
 
5
7
  body {
@@ -1,10 +1,13 @@
1
- @import "bootstrap-variables"
1
+ @import "bootstrap";
2
2
 
3
3
  body {
4
- padding-top: $navbarHeight + 20px;
4
+ padding-top: @navbarHeight + 20px;
5
5
  padding-bottom: 40px;
6
6
  }
7
7
 
8
+ @import "responsive";
9
+ @import "bootstrap-variables";
10
+
8
11
  .page-header {
9
12
  a.btn {
10
13
  float: right;
@@ -14,5 +17,3 @@ body {
14
17
  margin-right: 8px;
15
18
  }
16
19
  }
17
-
18
- @import "less/bootstrap";
@@ -1,10 +1,13 @@
1
1
  @import "bootstrap-variables";
2
+ @import "bootstrap";
2
3
 
3
4
  body {
4
5
  padding-top: $navbarHeight + 20px;
5
6
  padding-bottom: 40px;
6
7
  }
7
8
 
9
+ @import "responsive";
10
+
8
11
  .page-header {
9
12
  a.btn {
10
13
  float: right;
@@ -14,5 +17,3 @@ body {
14
17
  margin-right: 8px;
15
18
  }
16
19
  }
17
-
18
- @import "scss/bootstrap";
@@ -46,6 +46,7 @@ SimpleForm.setup do |config|
46
46
  end
47
47
 
48
48
  config.wrappers :bootstrap, :tag => 'div', :class => 'control-group', :error_class => 'error' do |b|
49
+ b.use :html5
49
50
  b.use :placeholder
50
51
  b.use :label
51
52
  b.wrapper :tag => 'div', :class => 'controls' do |ba|
@@ -56,6 +57,7 @@ SimpleForm.setup do |config|
56
57
  end
57
58
 
58
59
  config.wrappers :prepend, :tag => 'div', :class => "control-group", :error_class => 'error' do |b|
60
+ b.use :html5
59
61
  b.use :placeholder
60
62
  b.use :label
61
63
  b.wrapper :tag => 'div', :class => 'controls' do |input|
@@ -68,6 +70,7 @@ SimpleForm.setup do |config|
68
70
  end
69
71
 
70
72
  config.wrappers :append, :tag => 'div', :class => "control-group", :error_class => 'error' do |b|
73
+ b.use :html5
71
74
  b.use :placeholder
72
75
  b.use :label
73
76
  b.wrapper :tag => 'div', :class => 'controls' do |input|
@@ -1,4 +1,4 @@
1
- <%%= form_for(@<%= singular_table_name %>) do |f| %>
1
+ <%%= form_for(@<%= singular_table_name %>, :html => { :class => "form-horizontal" }) do |f| %>
2
2
  <%% if @<%= singular_table_name %>.errors.any? %>
3
3
  <div class="alert alert-error">
4
4
  <a class="close" data-dismiss="alert" href="#">×</a>
@@ -16,11 +16,11 @@
16
16
  <div class="control-group">
17
17
  <%%= f.label :<%= attribute.name %>, :class => "control-label" %>
18
18
  <div class="controls">
19
- <%%= f.<%= attribute.field_type %> :<%= attribute.name %>, :class => "input-xxlarge" %>
19
+ <%%= f.<%= attribute.field_type %> :<%= attribute.name %>, :class => "input-xlarge" %>
20
20
  </div>
21
21
  </div>
22
22
  <% end -%>
23
23
  <div class="form-actions">
24
- <%%= f.submit, :class => "btn btn-primary" %>
24
+ <%%= f.submit :class => "btn btn-primary" %>
25
25
  </div>
26
26
  <%% end %>
@@ -1,4 +1,4 @@
1
- = form_for @<%= singular_table_name %> do |f|
1
+ = form_for @<%= singular_table_name %>, :html => { :class => "form-horizontal" } do |f|
2
2
  -if @<%= singular_table_name %>.errors.any?
3
3
  .alert.alert-error
4
4
  %a.close{:href => "#", :"data-dismiss" => "alert"} ×
@@ -12,7 +12,7 @@
12
12
  .control-group
13
13
  = f.label :<%= attribute.name %>, :class => 'control-label'
14
14
  .controls
15
- = f.<%= attribute.field_type %> :<%= attribute.name %>, :class => 'input-xxlarge'
15
+ = f.<%= attribute.field_type %> :<%= attribute.name %>, :class => 'input-xlarge'
16
16
  <% end -%>
17
17
  .actions
18
18
  = f.submit :class => 'btn btn-primary'
@@ -1,4 +1,4 @@
1
- <%%= simple_form_for(@<%= singular_table_name %>, :defaults => { :input_html => { :class => 'input-xxlarge' } }) do |f| %>
1
+ <%%= simple_form_for(@<%= singular_table_name %>, :defaults => { :input_html => { :class => 'input-xlarge' } }) do |f| %>
2
2
  <%%= f.error_notification %>
3
3
 
4
4
  <div class="form-inputs">
@@ -1,4 +1,4 @@
1
- = simple_form_for(@<%= singular_table_name %>, :defaults => { :input_html => { :class => 'input-xxlarge' } }) do |f|
1
+ = simple_form_for(@<%= singular_table_name %>, :defaults => { :input_html => { :class => 'input-xlarge' } }) do |f|
2
2
  = f.error_notification
3
3
 
4
4
  .form-inputs
@@ -0,0 +1,3 @@
1
+ //= require jquery
2
+ //= require jquery_ujs
3
+ //= require_tree .
@@ -7,6 +7,7 @@ class Bootstrap::Generators::InstallGeneratorTest < ::Rails::Generators::TestCas
7
7
 
8
8
  setup :prepare_destination
9
9
  setup :copy_routes
10
+ setup :copy_application_javascript
10
11
 
11
12
  test "should copy controller erb templates" do
12
13
  run_generator
@@ -40,10 +41,10 @@ class Bootstrap::Generators::InstallGeneratorTest < ::Rails::Generators::TestCas
40
41
  }
41
42
  end
42
43
 
43
- test "should copy javascript files" do
44
+ test "should require javascript bootstrap file" do
44
45
  run_generator
45
46
 
46
- assert_file "app/assets/javascripts/bootstrap-generators.js"
47
+ assert_file "app/assets/javascripts/application.js", /require bootstrap/
47
48
  end
48
49
 
49
50
  test "should copy css files" do
@@ -63,7 +64,7 @@ class Bootstrap::Generators::InstallGeneratorTest < ::Rails::Generators::TestCas
63
64
  run_generator %w(--stylesheet-engine less)
64
65
 
65
66
  assert_file "app/assets/stylesheets/bootstrap-generators.css.less"
66
- assert_file "app/assets/stylesheets/bootstrap-variables.css.less"
67
+ assert_file "app/assets/stylesheets/bootstrap-variables.less"
67
68
  end
68
69
 
69
70
  test "should create erb layout" do
data/test/test_helper.rb CHANGED
@@ -28,7 +28,14 @@ def copy_routes
28
28
  routes = File.expand_path(File.join(File.dirname(__FILE__), 'fixtures', 'routes.rb'))
29
29
  destination = File.join(Rails.root, "config")
30
30
  FileUtils.mkdir_p(destination)
31
- FileUtils.cp File.expand_path(routes), destination
31
+ FileUtils.cp routes, destination
32
+ end
33
+
34
+ def copy_application_javascript
35
+ application_js = File.expand_path(File.join(File.dirname(__FILE__), 'fixtures', 'application.js'))
36
+ destination = File.join(Rails.root, "app", "assets", "javascripts")
37
+ FileUtils.mkdir_p(destination)
38
+ FileUtils.cp application_js, destination
32
39
  end
33
40
 
34
41
  require 'generators/bootstrap/install/install_generator'
@@ -1,5 +1,5 @@
1
1
  /* ==========================================================
2
- * bootstrap-alert.js v2.0.1
2
+ * bootstrap-alert.js v2.0.4
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.1
2
+ * bootstrap-button.js v2.0.4
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);
@@ -1,5 +1,5 @@
1
1
  /* ==========================================================
2
- * bootstrap-carousel.js v2.0.1
2
+ * bootstrap-carousel.js v2.0.4
3
3
  * http://twitter.github.com/bootstrap/javascript.html#carousel
4
4
  * ==========================================================
5
5
  * Copyright 2012 Twitter, Inc.
@@ -18,23 +18,30 @@
18
18
  * ========================================================== */
19
19
 
20
20
 
21
- !function( $ ){
21
+ !function ($) {
22
+
23
+ "use strict"; // jshint ;_;
22
24
 
23
- "use strict"
24
25
 
25
26
  /* CAROUSEL CLASS DEFINITION
26
27
  * ========================= */
27
28
 
28
29
  var Carousel = function (element, options) {
29
30
  this.$element = $(element)
30
- this.options = $.extend({}, $.fn.carousel.defaults, options)
31
+ this.options = options
31
32
  this.options.slide && this.slide(this.options.slide)
33
+ this.options.pause == 'hover' && this.$element
34
+ .on('mouseenter', $.proxy(this.pause, this))
35
+ .on('mouseleave', $.proxy(this.cycle, this))
32
36
  }
33
37
 
34
38
  Carousel.prototype = {
35
39
 
36
- cycle: function () {
37
- this.interval = setInterval($.proxy(this.next, this), this.options.interval)
40
+ cycle: function (e) {
41
+ if (!e) this.paused = false
42
+ this.options.interval
43
+ && !this.paused
44
+ && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
38
45
  return this
39
46
  }
40
47
 
@@ -59,7 +66,8 @@
59
66
  return this.slide(pos > activePos ? 'next' : 'prev', $(children[pos]))
60
67
  }
61
68
 
62
- , pause: function () {
69
+ , pause: function (e) {
70
+ if (!e) this.paused = true
63
71
  clearInterval(this.interval)
64
72
  this.interval = null
65
73
  return this
@@ -82,8 +90,7 @@
82
90
  , direction = type == 'next' ? 'left' : 'right'
83
91
  , fallback = type == 'next' ? 'first' : 'last'
84
92
  , that = this
85
-
86
- if (!$next.length) return
93
+ , e = $.Event('slide')
87
94
 
88
95
  this.sliding = true
89
96
 
@@ -91,24 +98,28 @@
91
98
 
92
99
  $next = $next.length ? $next : this.$element.find('.item')[fallback]()
93
100
 
94
- if (!$.support.transition && this.$element.hasClass('slide')) {
95
- this.$element.trigger('slide')
96
- $active.removeClass('active')
97
- $next.addClass('active')
98
- this.sliding = false
99
- this.$element.trigger('slid')
100
- } else {
101
+ if ($next.hasClass('active')) return
102
+
103
+ if ($.support.transition && this.$element.hasClass('slide')) {
104
+ this.$element.trigger(e)
105
+ if (e.isDefaultPrevented()) return
101
106
  $next.addClass(type)
102
107
  $next[0].offsetWidth // force reflow
103
108
  $active.addClass(direction)
104
109
  $next.addClass(direction)
105
- this.$element.trigger('slide')
106
110
  this.$element.one($.support.transition.end, function () {
107
111
  $next.removeClass([type, direction].join(' ')).addClass('active')
108
112
  $active.removeClass(['active', direction].join(' '))
109
113
  that.sliding = false
110
114
  setTimeout(function () { that.$element.trigger('slid') }, 0)
111
115
  })
116
+ } else {
117
+ this.$element.trigger(e)
118
+ if (e.isDefaultPrevented()) return
119
+ $active.removeClass('active')
120
+ $next.addClass('active')
121
+ this.sliding = false
122
+ this.$element.trigger('slid')
112
123
  }
113
124
 
114
125
  isCycling && this.cycle()
@@ -122,20 +133,21 @@
122
133
  /* CAROUSEL PLUGIN DEFINITION
123
134
  * ========================== */
124
135
 
125
- $.fn.carousel = function ( option ) {
136
+ $.fn.carousel = function (option) {
126
137
  return this.each(function () {
127
138
  var $this = $(this)
128
139
  , data = $this.data('carousel')
129
- , options = typeof option == 'object' && option
140
+ , options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option)
130
141
  if (!data) $this.data('carousel', (data = new Carousel(this, options)))
131
142
  if (typeof option == 'number') data.to(option)
132
143
  else if (typeof option == 'string' || (option = options.slide)) data[option]()
133
- else data.cycle()
144
+ else if (options.interval) data.cycle()
134
145
  })
135
146
  }
136
147
 
137
148
  $.fn.carousel.defaults = {
138
149
  interval: 5000
150
+ , pause: 'hover'
139
151
  }
140
152
 
141
153
  $.fn.carousel.Constructor = Carousel
@@ -154,4 +166,4 @@
154
166
  })
155
167
  })
156
168
 
157
- }( window.jQuery );
169
+ }(window.jQuery);