compass_twitter_bootstrap 2.0.3 → 2.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (113) hide show
  1. data/CHANGELOG.md +6 -0
  2. data/README.md +41 -7
  3. data/build/convert.rb +27 -11
  4. data/lib/compass_twitter_bootstrap/version.rb +1 -1
  5. data/stylesheets/_compass_twitter_bootstrap.scss +2 -1
  6. data/stylesheets/_compass_twitter_bootstrap_awesome.scss +1 -1
  7. data/stylesheets/_compass_twitter_bootstrap_responsive.scss +1 -1
  8. data/stylesheets/compass_twitter_bootstrap/_accordion.scss +4 -3
  9. data/stylesheets/compass_twitter_bootstrap/_alerts.scss +31 -10
  10. data/stylesheets/compass_twitter_bootstrap/_breadcrumbs.scss +14 -14
  11. data/stylesheets/compass_twitter_bootstrap/_button-groups.scss +91 -55
  12. data/stylesheets/compass_twitter_bootstrap/_buttons.scss +126 -84
  13. data/stylesheets/compass_twitter_bootstrap/_carousel.scss +33 -23
  14. data/stylesheets/compass_twitter_bootstrap/_close.scss +7 -5
  15. data/stylesheets/compass_twitter_bootstrap/_code.scss +12 -8
  16. data/stylesheets/compass_twitter_bootstrap/_component-animations.scss +9 -7
  17. data/stylesheets/compass_twitter_bootstrap/_dropdowns.scss +112 -22
  18. data/stylesheets/compass_twitter_bootstrap/_font-awesome.scss +258 -196
  19. data/stylesheets/compass_twitter_bootstrap/_forms.scss +262 -161
  20. data/stylesheets/compass_twitter_bootstrap/_grid.scss +18 -2
  21. data/stylesheets/compass_twitter_bootstrap/_hero-unit.scss +11 -8
  22. data/stylesheets/compass_twitter_bootstrap/_labels-badges.scss +42 -26
  23. data/stylesheets/compass_twitter_bootstrap/_layouts.scss +3 -4
  24. data/stylesheets/compass_twitter_bootstrap/_media.scss +55 -0
  25. data/stylesheets/compass_twitter_bootstrap/_mixins.scss +243 -189
  26. data/stylesheets/compass_twitter_bootstrap/_modals.scss +28 -23
  27. data/stylesheets/compass_twitter_bootstrap/_navbar.scss +269 -143
  28. data/stylesheets/compass_twitter_bootstrap/_navs.scss +59 -46
  29. data/stylesheets/compass_twitter_bootstrap/_pager.scss +17 -12
  30. data/stylesheets/compass_twitter_bootstrap/_pagination.scss +92 -27
  31. data/stylesheets/compass_twitter_bootstrap/_popovers.scss +116 -36
  32. data/stylesheets/compass_twitter_bootstrap/_progress-bars.scss +35 -30
  33. data/stylesheets/compass_twitter_bootstrap/_reset.scss +101 -11
  34. data/stylesheets/compass_twitter_bootstrap/_responsive-1200px-min.scss +9 -7
  35. data/stylesheets/compass_twitter_bootstrap/_responsive-767px-max.scss +115 -71
  36. data/stylesheets/compass_twitter_bootstrap/_responsive-768px-979px.scss +8 -6
  37. data/stylesheets/compass_twitter_bootstrap/_responsive-navbar.scss +53 -14
  38. data/stylesheets/compass_twitter_bootstrap/_responsive-utilities.scss +17 -15
  39. data/stylesheets/compass_twitter_bootstrap/_responsive.scss +48 -0
  40. data/stylesheets/compass_twitter_bootstrap/_scaffolding.scss +27 -4
  41. data/stylesheets/compass_twitter_bootstrap/_sprites.scss +24 -22
  42. data/stylesheets/compass_twitter_bootstrap/_tables.scss +122 -61
  43. data/stylesheets/compass_twitter_bootstrap/_thumbnails.scss +12 -7
  44. data/stylesheets/compass_twitter_bootstrap/_tooltip.scss +50 -15
  45. data/stylesheets/compass_twitter_bootstrap/_type.scss +93 -93
  46. data/stylesheets/compass_twitter_bootstrap/_utilities.scss +9 -2
  47. data/stylesheets/compass_twitter_bootstrap/_variables.scss +134 -38
  48. data/stylesheets/compass_twitter_bootstrap/_wells.scss +11 -10
  49. data/stylesheets_sass/_compass_twitter_bootstrap.sass +2 -1
  50. data/stylesheets_sass/_compass_twitter_bootstrap_awesome.sass +1 -1
  51. data/stylesheets_sass/_compass_twitter_bootstrap_responsive.sass +1 -1
  52. data/stylesheets_sass/compass_twitter_bootstrap/_accordion.sass +4 -3
  53. data/stylesheets_sass/compass_twitter_bootstrap/_alerts.sass +27 -9
  54. data/stylesheets_sass/compass_twitter_bootstrap/_breadcrumbs.sass +12 -13
  55. data/stylesheets_sass/compass_twitter_bootstrap/_button-groups.sass +93 -55
  56. data/stylesheets_sass/compass_twitter_bootstrap/_buttons.sass +113 -88
  57. data/stylesheets_sass/compass_twitter_bootstrap/_carousel.sass +31 -23
  58. data/stylesheets_sass/compass_twitter_bootstrap/_close.sass +5 -4
  59. data/stylesheets_sass/compass_twitter_bootstrap/_code.sass +12 -9
  60. data/stylesheets_sass/compass_twitter_bootstrap/_component-animations.sass +7 -6
  61. data/stylesheets_sass/compass_twitter_bootstrap/_dropdowns.sass +105 -21
  62. data/stylesheets_sass/compass_twitter_bootstrap/_font-awesome.sass +228 -31
  63. data/stylesheets_sass/compass_twitter_bootstrap/_forms.sass +255 -155
  64. data/stylesheets_sass/compass_twitter_bootstrap/_grid.sass +16 -2
  65. data/stylesheets_sass/compass_twitter_bootstrap/_hero-unit.sass +10 -7
  66. data/stylesheets_sass/compass_twitter_bootstrap/_labels-badges.sass +38 -31
  67. data/stylesheets_sass/compass_twitter_bootstrap/_layouts.sass +3 -4
  68. data/stylesheets_sass/compass_twitter_bootstrap/_media.sass +48 -0
  69. data/stylesheets_sass/compass_twitter_bootstrap/_mixins.sass +215 -174
  70. data/stylesheets_sass/compass_twitter_bootstrap/_modals.sass +25 -26
  71. data/stylesheets_sass/compass_twitter_bootstrap/_navbar.sass +229 -134
  72. data/stylesheets_sass/compass_twitter_bootstrap/_navs.sass +53 -46
  73. data/stylesheets_sass/compass_twitter_bootstrap/_pager.sass +16 -12
  74. data/stylesheets_sass/compass_twitter_bootstrap/_pagination.sass +78 -23
  75. data/stylesheets_sass/compass_twitter_bootstrap/_popovers.sass +106 -40
  76. data/stylesheets_sass/compass_twitter_bootstrap/_progress-bars.sass +35 -30
  77. data/stylesheets_sass/compass_twitter_bootstrap/_reset.sass +80 -12
  78. data/stylesheets_sass/compass_twitter_bootstrap/_responsive-1200px-min.sass +8 -7
  79. data/stylesheets_sass/compass_twitter_bootstrap/_responsive-767px-max.sass +89 -54
  80. data/stylesheets_sass/compass_twitter_bootstrap/_responsive-768px-979px.sass +7 -6
  81. data/stylesheets_sass/compass_twitter_bootstrap/_responsive-navbar.sass +38 -13
  82. data/stylesheets_sass/compass_twitter_bootstrap/_responsive-utilities.sass +18 -17
  83. data/stylesheets_sass/compass_twitter_bootstrap/_responsive.sass +44 -0
  84. data/stylesheets_sass/compass_twitter_bootstrap/_scaffolding.sass +24 -4
  85. data/stylesheets_sass/compass_twitter_bootstrap/_sprites.sass +25 -8
  86. data/stylesheets_sass/compass_twitter_bootstrap/_tables.sass +110 -83
  87. data/stylesheets_sass/compass_twitter_bootstrap/_thumbnails.sass +11 -7
  88. data/stylesheets_sass/compass_twitter_bootstrap/_tooltip.sass +43 -19
  89. data/stylesheets_sass/compass_twitter_bootstrap/_type.sass +123 -75
  90. data/stylesheets_sass/compass_twitter_bootstrap/_utilities.sass +7 -2
  91. data/stylesheets_sass/compass_twitter_bootstrap/_variables.sass +141 -37
  92. data/stylesheets_sass/compass_twitter_bootstrap/_wells.sass +10 -9
  93. data/vendor/assets/fonts/fontawesome-webfont.eot +0 -0
  94. data/vendor/assets/fonts/fontawesome-webfont.svg +247 -167
  95. data/vendor/assets/fonts/fontawesome-webfont.ttf +0 -0
  96. data/vendor/assets/fonts/fontawesome-webfont.woff +0 -0
  97. data/vendor/assets/images/glyphicons-halflings-white.png +0 -0
  98. data/vendor/assets/images/glyphicons-halflings.png +0 -0
  99. data/vendor/assets/javascripts/bootstrap-affix.js +117 -0
  100. data/vendor/assets/javascripts/bootstrap-alert.js +13 -4
  101. data/vendor/assets/javascripts/bootstrap-all.js +2 -1
  102. data/vendor/assets/javascripts/bootstrap-button.js +17 -8
  103. data/vendor/assets/javascripts/bootstrap-carousel.js +30 -14
  104. data/vendor/assets/javascripts/bootstrap-collapse.js +24 -14
  105. data/vendor/assets/javascripts/bootstrap-dropdown.js +80 -19
  106. data/vendor/assets/javascripts/bootstrap-modal.js +111 -84
  107. data/vendor/assets/javascripts/bootstrap-popover.js +21 -5
  108. data/vendor/assets/javascripts/bootstrap-scrollspy.js +21 -10
  109. data/vendor/assets/javascripts/bootstrap-tab.js +17 -8
  110. data/vendor/assets/javascripts/bootstrap-tooltip.js +36 -24
  111. data/vendor/assets/javascripts/bootstrap-transition.js +6 -7
  112. data/vendor/assets/javascripts/bootstrap-typeahead.js +87 -49
  113. metadata +17 -7
File without changes
@@ -0,0 +1,117 @@
1
+ /* ==========================================================
2
+ * bootstrap-affix.js v2.2.2
3
+ * http://twitter.github.com/bootstrap/javascript.html#affix
4
+ * ==========================================================
5
+ * Copyright 2012 Twitter, Inc.
6
+ *
7
+ * Licensed under the Apache License, Version 2.0 (the "License");
8
+ * you may not use this file except in compliance with the License.
9
+ * You may obtain a copy of the License at
10
+ *
11
+ * http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ * ========================================================== */
19
+
20
+
21
+ !function ($) {
22
+
23
+ "use strict"; // jshint ;_;
24
+
25
+
26
+ /* AFFIX CLASS DEFINITION
27
+ * ====================== */
28
+
29
+ var Affix = function (element, options) {
30
+ this.options = $.extend({}, $.fn.affix.defaults, options)
31
+ this.$window = $(window)
32
+ .on('scroll.affix.data-api', $.proxy(this.checkPosition, this))
33
+ .on('click.affix.data-api', $.proxy(function () { setTimeout($.proxy(this.checkPosition, this), 1) }, this))
34
+ this.$element = $(element)
35
+ this.checkPosition()
36
+ }
37
+
38
+ Affix.prototype.checkPosition = function () {
39
+ if (!this.$element.is(':visible')) return
40
+
41
+ var scrollHeight = $(document).height()
42
+ , scrollTop = this.$window.scrollTop()
43
+ , position = this.$element.offset()
44
+ , offset = this.options.offset
45
+ , offsetBottom = offset.bottom
46
+ , offsetTop = offset.top
47
+ , reset = 'affix affix-top affix-bottom'
48
+ , affix
49
+
50
+ if (typeof offset != 'object') offsetBottom = offsetTop = offset
51
+ if (typeof offsetTop == 'function') offsetTop = offset.top()
52
+ if (typeof offsetBottom == 'function') offsetBottom = offset.bottom()
53
+
54
+ affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ?
55
+ false : offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ?
56
+ 'bottom' : offsetTop != null && scrollTop <= offsetTop ?
57
+ 'top' : false
58
+
59
+ if (this.affixed === affix) return
60
+
61
+ this.affixed = affix
62
+ this.unpin = affix == 'bottom' ? position.top - scrollTop : null
63
+
64
+ this.$element.removeClass(reset).addClass('affix' + (affix ? '-' + affix : ''))
65
+ }
66
+
67
+
68
+ /* AFFIX PLUGIN DEFINITION
69
+ * ======================= */
70
+
71
+ var old = $.fn.affix
72
+
73
+ $.fn.affix = function (option) {
74
+ return this.each(function () {
75
+ var $this = $(this)
76
+ , data = $this.data('affix')
77
+ , options = typeof option == 'object' && option
78
+ if (!data) $this.data('affix', (data = new Affix(this, options)))
79
+ if (typeof option == 'string') data[option]()
80
+ })
81
+ }
82
+
83
+ $.fn.affix.Constructor = Affix
84
+
85
+ $.fn.affix.defaults = {
86
+ offset: 0
87
+ }
88
+
89
+
90
+ /* AFFIX NO CONFLICT
91
+ * ================= */
92
+
93
+ $.fn.affix.noConflict = function () {
94
+ $.fn.affix = old
95
+ return this
96
+ }
97
+
98
+
99
+ /* AFFIX DATA-API
100
+ * ============== */
101
+
102
+ $(window).on('load', function () {
103
+ $('[data-spy="affix"]').each(function () {
104
+ var $spy = $(this)
105
+ , data = $spy.data()
106
+
107
+ data.offset = data.offset || {}
108
+
109
+ data.offsetBottom && (data.offset.bottom = data.offsetBottom)
110
+ data.offsetTop && (data.offset.top = data.offsetTop)
111
+
112
+ $spy.affix(data)
113
+ })
114
+ })
115
+
116
+
117
+ }(window.jQuery);
@@ -1,5 +1,5 @@
1
1
  /* ==========================================================
2
- * bootstrap-alert.js v2.0.3
2
+ * bootstrap-alert.js v2.2.2
3
3
  * http://twitter.github.com/bootstrap/javascript.html#alerts
4
4
  * ==========================================================
5
5
  * Copyright 2012 Twitter, Inc.
@@ -68,6 +68,8 @@
68
68
  /* ALERT PLUGIN DEFINITION
69
69
  * ======================= */
70
70
 
71
+ var old = $.fn.alert
72
+
71
73
  $.fn.alert = function (option) {
72
74
  return this.each(function () {
73
75
  var $this = $(this)
@@ -80,11 +82,18 @@
80
82
  $.fn.alert.Constructor = Alert
81
83
 
82
84
 
85
+ /* ALERT NO CONFLICT
86
+ * ================= */
87
+
88
+ $.fn.alert.noConflict = function () {
89
+ $.fn.alert = old
90
+ return this
91
+ }
92
+
93
+
83
94
  /* ALERT DATA-API
84
95
  * ============== */
85
96
 
86
- $(function () {
87
- $('body').on('click.alert.data-api', dismiss, Alert.prototype.close)
88
- })
97
+ $(document).on('click.alert.data-api', dismiss, Alert.prototype.close)
89
98
 
90
99
  }(window.jQuery);
@@ -1,5 +1,6 @@
1
1
  //=require bootstrap-transition
2
2
  //=require bootstrap-alert
3
+ //-require bootstrap-affix
3
4
  //=require bootstrap-modal
4
5
  //=require bootstrap-dropdown
5
6
  //=require bootstrap-scrollspy
@@ -9,4 +10,4 @@
9
10
  //=require bootstrap-button
10
11
  //=require bootstrap-collapse
11
12
  //=require bootstrap-carousel
12
- //=require bootstrap-typeahead
13
+ //=require bootstrap-typeahead
@@ -1,5 +1,5 @@
1
1
  /* ============================================================
2
- * bootstrap-button.js v2.0.3
2
+ * bootstrap-button.js v2.2.2
3
3
  * http://twitter.github.com/bootstrap/javascript.html#buttons
4
4
  * ============================================================
5
5
  * Copyright 2012 Twitter, Inc.
@@ -51,7 +51,7 @@
51
51
  }
52
52
 
53
53
  Button.prototype.toggle = function () {
54
- var $parent = this.$element.parent('[data-toggle="buttons-radio"]')
54
+ var $parent = this.$element.closest('[data-toggle="buttons-radio"]')
55
55
 
56
56
  $parent && $parent
57
57
  .find('.active')
@@ -64,6 +64,8 @@
64
64
  /* BUTTON PLUGIN DEFINITION
65
65
  * ======================== */
66
66
 
67
+ var old = $.fn.button
68
+
67
69
  $.fn.button = function (option) {
68
70
  return this.each(function () {
69
71
  var $this = $(this)
@@ -82,15 +84,22 @@
82
84
  $.fn.button.Constructor = Button
83
85
 
84
86
 
87
+ /* BUTTON NO CONFLICT
88
+ * ================== */
89
+
90
+ $.fn.button.noConflict = function () {
91
+ $.fn.button = old
92
+ return this
93
+ }
94
+
95
+
85
96
  /* BUTTON DATA-API
86
97
  * =============== */
87
98
 
88
- $(function () {
89
- $('body').on('click.button.data-api', '[data-toggle^=button]', function ( e ) {
90
- var $btn = $(e.target)
91
- if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
92
- $btn.button('toggle')
93
- })
99
+ $(document).on('click.button.data-api', '[data-toggle^=button]', function (e) {
100
+ var $btn = $(e.target)
101
+ if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
102
+ $btn.button('toggle')
94
103
  })
95
104
 
96
105
  }(window.jQuery);
@@ -1,5 +1,5 @@
1
1
  /* ==========================================================
2
- * bootstrap-carousel.js v2.0.3
2
+ * bootstrap-carousel.js v2.2.2
3
3
  * http://twitter.github.com/bootstrap/javascript.html#carousel
4
4
  * ==========================================================
5
5
  * Copyright 2012 Twitter, Inc.
@@ -29,7 +29,6 @@
29
29
  var Carousel = function (element, options) {
30
30
  this.$element = $(element)
31
31
  this.options = options
32
- this.options.slide && this.slide(this.options.slide)
33
32
  this.options.pause == 'hover' && this.$element
34
33
  .on('mouseenter', $.proxy(this.pause, this))
35
34
  .on('mouseleave', $.proxy(this.cycle, this))
@@ -46,7 +45,7 @@
46
45
  }
47
46
 
48
47
  , to: function (pos) {
49
- var $active = this.$element.find('.active')
48
+ var $active = this.$element.find('.item.active')
50
49
  , children = $active.parent().children()
51
50
  , activePos = children.index($active)
52
51
  , that = this
@@ -68,6 +67,10 @@
68
67
 
69
68
  , pause: function (e) {
70
69
  if (!e) this.paused = true
70
+ if (this.$element.find('.next, .prev').length && $.support.transition.end) {
71
+ this.$element.trigger($.support.transition.end)
72
+ this.cycle()
73
+ }
71
74
  clearInterval(this.interval)
72
75
  this.interval = null
73
76
  return this
@@ -84,13 +87,13 @@
84
87
  }
85
88
 
86
89
  , slide: function (type, next) {
87
- var $active = this.$element.find('.active')
90
+ var $active = this.$element.find('.item.active')
88
91
  , $next = next || $active[type]()
89
92
  , isCycling = this.interval
90
93
  , direction = type == 'next' ? 'left' : 'right'
91
94
  , fallback = type == 'next' ? 'first' : 'last'
92
95
  , that = this
93
- , e = $.Event('slide')
96
+ , e
94
97
 
95
98
  this.sliding = true
96
99
 
@@ -98,6 +101,10 @@
98
101
 
99
102
  $next = $next.length ? $next : this.$element.find('.item')[fallback]()
100
103
 
104
+ e = $.Event('slide', {
105
+ relatedTarget: $next[0]
106
+ })
107
+
101
108
  if ($next.hasClass('active')) return
102
109
 
103
110
  if ($.support.transition && this.$element.hasClass('slide')) {
@@ -133,14 +140,17 @@
133
140
  /* CAROUSEL PLUGIN DEFINITION
134
141
  * ========================== */
135
142
 
143
+ var old = $.fn.carousel
144
+
136
145
  $.fn.carousel = function (option) {
137
146
  return this.each(function () {
138
147
  var $this = $(this)
139
148
  , data = $this.data('carousel')
140
149
  , options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option)
150
+ , action = typeof option == 'string' ? option : options.slide
141
151
  if (!data) $this.data('carousel', (data = new Carousel(this, options)))
142
152
  if (typeof option == 'number') data.to(option)
143
- else if (typeof option == 'string' || (option = options.slide)) data[option]()
153
+ else if (action) data[action]()
144
154
  else if (options.interval) data.cycle()
145
155
  })
146
156
  }
@@ -153,17 +163,23 @@
153
163
  $.fn.carousel.Constructor = Carousel
154
164
 
155
165
 
166
+ /* CAROUSEL NO CONFLICT
167
+ * ==================== */
168
+
169
+ $.fn.carousel.noConflict = function () {
170
+ $.fn.carousel = old
171
+ return this
172
+ }
173
+
156
174
  /* CAROUSEL DATA-API
157
175
  * ================= */
158
176
 
159
- $(function () {
160
- $('body').on('click.carousel.data-api', '[data-slide]', function ( e ) {
161
- var $this = $(this), href
162
- , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
163
- , options = !$target.data('modal') && $.extend({}, $target.data(), $this.data())
164
- $target.carousel(options)
165
- e.preventDefault()
166
- })
177
+ $(document).on('click.carousel.data-api', '[data-slide]', function (e) {
178
+ var $this = $(this), href
179
+ , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
180
+ , options = $.extend({}, $target.data(), $this.data())
181
+ $target.carousel(options)
182
+ e.preventDefault()
167
183
  })
168
184
 
169
185
  }(window.jQuery);
@@ -1,5 +1,5 @@
1
1
  /* =============================================================
2
- * bootstrap-collapse.js v2.0.3
2
+ * bootstrap-collapse.js v2.2.2
3
3
  * http://twitter.github.com/bootstrap/javascript.html#collapse
4
4
  * =============================================================
5
5
  * Copyright 2012 Twitter, Inc.
@@ -67,7 +67,7 @@
67
67
 
68
68
  this.$element[dimension](0)
69
69
  this.transition('addClass', $.Event('show'), 'shown')
70
- this.$element[dimension](this.$element[0][scroll])
70
+ $.support.transition && this.$element[dimension](this.$element[0][scroll])
71
71
  }
72
72
 
73
73
  , hide: function () {
@@ -120,8 +120,10 @@
120
120
  }
121
121
 
122
122
 
123
- /* COLLAPSIBLE PLUGIN DEFINITION
124
- * ============================== */
123
+ /* COLLAPSE PLUGIN DEFINITION
124
+ * ========================== */
125
+
126
+ var old = $.fn.collapse
125
127
 
126
128
  $.fn.collapse = function (option) {
127
129
  return this.each(function () {
@@ -140,18 +142,26 @@
140
142
  $.fn.collapse.Constructor = Collapse
141
143
 
142
144
 
143
- /* COLLAPSIBLE DATA-API
145
+ /* COLLAPSE NO CONFLICT
144
146
  * ==================== */
145
147
 
146
- $(function () {
147
- $('body').on('click.collapse.data-api', '[data-toggle=collapse]', function ( e ) {
148
- var $this = $(this), href
149
- , target = $this.attr('data-target')
150
- || e.preventDefault()
151
- || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
152
- , option = $(target).data('collapse') ? 'toggle' : $this.data()
153
- $(target).collapse(option)
154
- })
148
+ $.fn.collapse.noConflict = function () {
149
+ $.fn.collapse = old
150
+ return this
151
+ }
152
+
153
+
154
+ /* COLLAPSE DATA-API
155
+ * ================= */
156
+
157
+ $(document).on('click.collapse.data-api', '[data-toggle=collapse]', function (e) {
158
+ var $this = $(this), href
159
+ , target = $this.attr('data-target')
160
+ || e.preventDefault()
161
+ || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
162
+ , option = $(target).data('collapse') ? 'toggle' : $this.data()
163
+ $this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
164
+ $(target).collapse(option)
155
165
  })
156
166
 
157
167
  }(window.jQuery);
@@ -1,5 +1,5 @@
1
1
  /* ============================================================
2
- * bootstrap-dropdown.js v2.0.3
2
+ * bootstrap-dropdown.js v2.2.2
3
3
  * http://twitter.github.com/bootstrap/javascript.html#dropdowns
4
4
  * ============================================================
5
5
  * Copyright 2012 Twitter, Inc.
@@ -26,7 +26,7 @@
26
26
  /* DROPDOWN CLASS DEFINITION
27
27
  * ========================= */
28
28
 
29
- var toggle = '[data-toggle="dropdown"]'
29
+ var toggle = '[data-toggle=dropdown]'
30
30
  , Dropdown = function (element) {
31
31
  var $el = $(element).on('click.dropdown.data-api', this.toggle)
32
32
  $('html').on('click.dropdown.data-api', function () {
@@ -41,40 +41,92 @@
41
41
  , toggle: function (e) {
42
42
  var $this = $(this)
43
43
  , $parent
44
- , selector
45
44
  , isActive
46
45
 
47
46
  if ($this.is('.disabled, :disabled')) return
48
47
 
49
- selector = $this.attr('data-target')
48
+ $parent = getParent($this)
50
49
 
51
- if (!selector) {
52
- selector = $this.attr('href')
53
- selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
50
+ isActive = $parent.hasClass('open')
51
+
52
+ clearMenus()
53
+
54
+ if (!isActive) {
55
+ $parent.toggleClass('open')
54
56
  }
55
57
 
56
- $parent = $(selector)
57
- $parent.length || ($parent = $this.parent())
58
+ $this.focus()
59
+
60
+ return false
61
+ }
62
+
63
+ , keydown: function (e) {
64
+ var $this
65
+ , $items
66
+ , $active
67
+ , $parent
68
+ , isActive
69
+ , index
70
+
71
+ if (!/(38|40|27)/.test(e.keyCode)) return
72
+
73
+ $this = $(this)
74
+
75
+ e.preventDefault()
76
+ e.stopPropagation()
77
+
78
+ if ($this.is('.disabled, :disabled')) return
79
+
80
+ $parent = getParent($this)
58
81
 
59
82
  isActive = $parent.hasClass('open')
60
83
 
61
- clearMenus()
84
+ if (!isActive || (isActive && e.keyCode == 27)) return $this.click()
62
85
 
63
- if (!isActive) $parent.toggleClass('open')
86
+ $items = $('[role=menu] li:not(.divider):visible a', $parent)
64
87
 
65
- return false
88
+ if (!$items.length) return
89
+
90
+ index = $items.index($items.filter(':focus'))
91
+
92
+ if (e.keyCode == 38 && index > 0) index-- // up
93
+ if (e.keyCode == 40 && index < $items.length - 1) index++ // down
94
+ if (!~index) index = 0
95
+
96
+ $items
97
+ .eq(index)
98
+ .focus()
66
99
  }
67
100
 
68
101
  }
69
102
 
70
103
  function clearMenus() {
71
- $(toggle).parent().removeClass('open')
104
+ $(toggle).each(function () {
105
+ getParent($(this)).removeClass('open')
106
+ })
107
+ }
108
+
109
+ function getParent($this) {
110
+ var selector = $this.attr('data-target')
111
+ , $parent
112
+
113
+ if (!selector) {
114
+ selector = $this.attr('href')
115
+ selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
116
+ }
117
+
118
+ $parent = $(selector)
119
+ $parent.length || ($parent = $this.parent())
120
+
121
+ return $parent
72
122
  }
73
123
 
74
124
 
75
125
  /* DROPDOWN PLUGIN DEFINITION
76
126
  * ========================== */
77
127
 
128
+ var old = $.fn.dropdown
129
+
78
130
  $.fn.dropdown = function (option) {
79
131
  return this.each(function () {
80
132
  var $this = $(this)
@@ -87,14 +139,23 @@
87
139
  $.fn.dropdown.Constructor = Dropdown
88
140
 
89
141
 
142
+ /* DROPDOWN NO CONFLICT
143
+ * ==================== */
144
+
145
+ $.fn.dropdown.noConflict = function () {
146
+ $.fn.dropdown = old
147
+ return this
148
+ }
149
+
150
+
90
151
  /* APPLY TO STANDARD DROPDOWN ELEMENTS
91
152
  * =================================== */
92
153
 
93
- $(function () {
94
- $('html').on('click.dropdown.data-api', clearMenus)
95
- $('body')
96
- .on('click.dropdown', '.dropdown form', function (e) { e.stopPropagation() })
97
- .on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle)
98
- })
154
+ $(document)
155
+ .on('click.dropdown.data-api touchstart.dropdown.data-api', clearMenus)
156
+ .on('click.dropdown touchstart.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
157
+ .on('touchstart.dropdown.data-api', '.dropdown-menu', function (e) { e.stopPropagation() })
158
+ .on('click.dropdown.data-api touchstart.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
159
+ .on('keydown.dropdown.data-api touchstart.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
99
160
 
100
161
  }(window.jQuery);