twitter_bootstrap 0.0.8 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. data/README.markdown +16 -1
  2. data/lib/twitter_bootstrap/version.rb +1 -1
  3. data/vendor/assets/images/twitter/bootstrap/glyphicons-halflings-white.png +0 -0
  4. data/vendor/assets/images/twitter/bootstrap/glyphicons-halflings.png +0 -0
  5. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-alert.js +91 -0
  6. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-button.js +98 -0
  7. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-carousel.js +154 -0
  8. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-collapse.js +136 -0
  9. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-dropdown.js +58 -21
  10. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-modal.js +64 -114
  11. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-popover.js +38 -33
  12. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-scrollspy.js +62 -44
  13. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-tab.js +130 -0
  14. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-tooltip.js +270 -0
  15. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-transition.js +51 -0
  16. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-typeahead.js +271 -0
  17. data/vendor/toolkit/twitter/bootstrap/accordion.less +28 -0
  18. data/vendor/toolkit/twitter/bootstrap/alerts.less +70 -0
  19. data/vendor/toolkit/twitter/bootstrap/bootstrap.less +41 -5
  20. data/vendor/toolkit/twitter/bootstrap/breadcrumbs.less +22 -0
  21. data/vendor/toolkit/twitter/bootstrap/button-groups.less +147 -0
  22. data/vendor/toolkit/twitter/bootstrap/buttons.less +165 -0
  23. data/vendor/toolkit/twitter/bootstrap/carousel.less +121 -0
  24. data/vendor/toolkit/twitter/bootstrap/close.less +18 -0
  25. data/vendor/toolkit/twitter/bootstrap/code.less +44 -0
  26. data/vendor/toolkit/twitter/bootstrap/component-animations.less +18 -0
  27. data/vendor/toolkit/twitter/bootstrap/dropdowns.less +131 -0
  28. data/vendor/toolkit/twitter/bootstrap/forms.less +335 -299
  29. data/vendor/toolkit/twitter/bootstrap/grid.less +8 -0
  30. data/vendor/toolkit/twitter/bootstrap/hero-unit.less +20 -0
  31. data/vendor/toolkit/twitter/bootstrap/labels.less +16 -0
  32. data/vendor/toolkit/twitter/bootstrap/layouts.less +17 -0
  33. data/vendor/toolkit/twitter/bootstrap/mixins.less +391 -76
  34. data/vendor/toolkit/twitter/bootstrap/modals.less +72 -0
  35. data/vendor/toolkit/twitter/bootstrap/navbar.less +292 -0
  36. data/vendor/toolkit/twitter/bootstrap/navs.less +344 -0
  37. data/vendor/toolkit/twitter/bootstrap/pager.less +30 -0
  38. data/vendor/toolkit/twitter/bootstrap/pagination.less +55 -0
  39. data/vendor/toolkit/twitter/bootstrap/popovers.less +49 -0
  40. data/vendor/toolkit/twitter/bootstrap/progress-bars.less +95 -0
  41. data/vendor/toolkit/twitter/bootstrap/reset.less +37 -52
  42. data/vendor/toolkit/twitter/bootstrap/responsive.less +323 -0
  43. data/vendor/toolkit/twitter/bootstrap/scaffolding.less +13 -123
  44. data/vendor/toolkit/twitter/bootstrap/sprites.less +156 -0
  45. data/vendor/toolkit/twitter/bootstrap/tables.less +75 -160
  46. data/vendor/toolkit/twitter/bootstrap/thumbnails.less +35 -0
  47. data/vendor/toolkit/twitter/bootstrap/tooltip.less +35 -0
  48. data/vendor/toolkit/twitter/bootstrap/type.less +100 -70
  49. data/vendor/toolkit/twitter/bootstrap/utilities.less +23 -0
  50. data/vendor/toolkit/twitter/bootstrap/variables.less +94 -55
  51. data/vendor/toolkit/twitter/bootstrap/wells.less +17 -0
  52. metadata +53 -16
@@ -1,8 +1,8 @@
1
1
  /* ============================================================
2
- * bootstrap-dropdown.js v1.4.0
3
- * http://twitter.github.com/bootstrap/javascript.html#dropdown
2
+ * bootstrap-dropdown.js v2.0.0
3
+ * http://twitter.github.com/bootstrap/javascript.html#dropdowns
4
4
  * ============================================================
5
- * Copyright 2011 Twitter, Inc.
5
+ * Copyright 2012 Twitter, Inc.
6
6
  *
7
7
  * Licensed under the Apache License, Version 2.0 (the "License");
8
8
  * you may not use this file except in compliance with the License.
@@ -22,34 +22,71 @@
22
22
 
23
23
  "use strict"
24
24
 
25
+ /* DROPDOWN CLASS DEFINITION
26
+ * ========================= */
27
+
28
+ var toggle = '[data-toggle="dropdown"]'
29
+ , Dropdown = function ( element ) {
30
+ var $el = $(element).on('click.dropdown.data-api', this.toggle)
31
+ $('html').on('click.dropdown.data-api', function () {
32
+ $el.parent().removeClass('open')
33
+ })
34
+ }
35
+
36
+ Dropdown.prototype = {
37
+
38
+ constructor: Dropdown
39
+
40
+ , toggle: function ( e ) {
41
+ var $this = $(this)
42
+ , selector = $this.attr('data-target')
43
+ , $parent
44
+ , isActive
45
+
46
+ if (!selector) {
47
+ selector = $this.attr('href')
48
+ selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
49
+ }
50
+
51
+ $parent = $(selector)
52
+ $parent.length || ($parent = $this.parent())
53
+
54
+ isActive = $parent.hasClass('open')
55
+
56
+ clearMenus()
57
+ !isActive && $parent.toggleClass('open')
58
+
59
+ return false
60
+ }
61
+
62
+ }
63
+
64
+ function clearMenus() {
65
+ $(toggle).parent().removeClass('open')
66
+ }
67
+
68
+
25
69
  /* DROPDOWN PLUGIN DEFINITION
26
70
  * ========================== */
27
71
 
28
- $.fn.dropdown = function ( selector ) {
72
+ $.fn.dropdown = function ( option ) {
29
73
  return this.each(function () {
30
- $(this).delegate(selector || d, 'click', function (e) {
31
- var li = $(this).parent('li')
32
- , isActive = li.hasClass('open')
33
-
34
- clearMenus()
35
- !isActive && li.toggleClass('open')
36
- return false
37
- })
74
+ var $this = $(this)
75
+ , data = $this.data('dropdown')
76
+ if (!data) $this.data('dropdown', (data = new Dropdown(this)))
77
+ if (typeof option == 'string') data[option].call($this)
38
78
  })
39
79
  }
40
80
 
41
- /* APPLY TO STANDARD DROPDOWN ELEMENTS
42
- * =================================== */
81
+ $.fn.dropdown.Constructor = Dropdown
43
82
 
44
- var d = 'a.menu, .dropdown-toggle'
45
83
 
46
- function clearMenus() {
47
- $(d).parent('li').removeClass('open')
48
- }
84
+ /* APPLY TO STANDARD DROPDOWN ELEMENTS
85
+ * =================================== */
49
86
 
50
87
  $(function () {
51
- $('html').bind("click", clearMenus)
52
- $('body').dropdown( '[data-dropdown] a.menu, [data-dropdown] .dropdown-toggle' )
88
+ $('html').on('click.dropdown.data-api', clearMenus)
89
+ $('body').on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle)
53
90
  })
54
91
 
55
- }( window.jQuery || window.ender );
92
+ }( window.jQuery )
@@ -1,8 +1,8 @@
1
1
  /* =========================================================
2
- * bootstrap-modal.js v1.4.0
3
- * http://twitter.github.com/bootstrap/javascript.html#modal
2
+ * bootstrap-modal.js v2.0.0
3
+ * http://twitter.github.com/bootstrap/javascript.html#modals
4
4
  * =========================================================
5
- * Copyright 2011 Twitter, Inc.
5
+ * Copyright 2012 Twitter, Inc.
6
6
  *
7
7
  * Licensed under the Apache License, Version 2.0 (the "License");
8
8
  * you may not use this file except in compliance with the License.
@@ -22,58 +22,30 @@
22
22
 
23
23
  "use strict"
24
24
 
25
- /* CSS TRANSITION SUPPORT (https://gist.github.com/373874)
26
- * ======================================================= */
27
-
28
- var transitionEnd
29
-
30
- $(document).ready(function () {
31
-
32
- $.support.transition = (function () {
33
- var thisBody = document.body || document.documentElement
34
- , thisStyle = thisBody.style
35
- , support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined
36
- return support
37
- })()
38
-
39
- // set CSS transition event type
40
- if ( $.support.transition ) {
41
- transitionEnd = "TransitionEnd"
42
- if ( $.browser.webkit ) {
43
- transitionEnd = "webkitTransitionEnd"
44
- } else if ( $.browser.mozilla ) {
45
- transitionEnd = "transitionend"
46
- } else if ( $.browser.opera ) {
47
- transitionEnd = "oTransitionEnd"
48
- }
49
- }
50
-
51
- })
52
-
53
-
54
- /* MODAL PUBLIC CLASS DEFINITION
55
- * ============================= */
25
+ /* MODAL CLASS DEFINITION
26
+ * ====================== */
56
27
 
57
28
  var Modal = function ( content, options ) {
58
- this.settings = $.extend({}, $.fn.modal.defaults, options)
29
+ this.options = options
59
30
  this.$element = $(content)
60
- .delegate('.close', 'click.modal', $.proxy(this.hide, this))
61
-
62
- if ( this.settings.show ) {
63
- this.show()
64
- }
65
-
66
- return this
31
+ .delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
67
32
  }
68
33
 
69
34
  Modal.prototype = {
70
35
 
71
- toggle: function () {
36
+ constructor: Modal
37
+
38
+ , toggle: function () {
72
39
  return this[!this.isShown ? 'show' : 'hide']()
73
40
  }
74
41
 
75
42
  , show: function () {
76
43
  var that = this
44
+
45
+ if (this.isShown) return
46
+
47
+ $('body').addClass('modal-open')
48
+
77
49
  this.isShown = true
78
50
  this.$element.trigger('show')
79
51
 
@@ -81,8 +53,9 @@
81
53
  backdrop.call(this, function () {
82
54
  var transition = $.support.transition && that.$element.hasClass('fade')
83
55
 
56
+ !that.$element.parent().length && that.$element.appendTo(document.body) //don't move modals dom position
57
+
84
58
  that.$element
85
- .appendTo(document.body)
86
59
  .show()
87
60
 
88
61
  if (transition) {
@@ -92,24 +65,22 @@
92
65
  that.$element.addClass('in')
93
66
 
94
67
  transition ?
95
- that.$element.one(transitionEnd, function () { that.$element.trigger('shown') }) :
68
+ that.$element.one($.support.transition.end, function () { that.$element.trigger('shown') }) :
96
69
  that.$element.trigger('shown')
97
70
 
98
71
  })
99
-
100
- return this
101
72
  }
102
73
 
103
- , hide: function (e) {
74
+ , hide: function ( e ) {
104
75
  e && e.preventDefault()
105
76
 
106
- if ( !this.isShown ) {
107
- return this
108
- }
77
+ if (!this.isShown) return
109
78
 
110
79
  var that = this
111
80
  this.isShown = false
112
81
 
82
+ $('body').removeClass('modal-open')
83
+
113
84
  escape.call(this)
114
85
 
115
86
  this.$element
@@ -119,8 +90,6 @@
119
90
  $.support.transition && this.$element.hasClass('fade') ?
120
91
  hideWithTransition.call(this) :
121
92
  hideModal.call(this)
122
-
123
- return this
124
93
  }
125
94
 
126
95
  }
@@ -130,20 +99,19 @@
130
99
  * ===================== */
131
100
 
132
101
  function hideWithTransition() {
133
- // firefox drops transitionEnd events :{o
134
102
  var that = this
135
103
  , timeout = setTimeout(function () {
136
- that.$element.unbind(transitionEnd)
104
+ that.$element.off($.support.transition.end)
137
105
  hideModal.call(that)
138
106
  }, 500)
139
107
 
140
- this.$element.one(transitionEnd, function () {
108
+ this.$element.one($.support.transition.end, function () {
141
109
  clearTimeout(timeout)
142
110
  hideModal.call(that)
143
111
  })
144
112
  }
145
113
 
146
- function hideModal (that) {
114
+ function hideModal( that ) {
147
115
  this.$element
148
116
  .hide()
149
117
  .trigger('hidden')
@@ -151,38 +119,37 @@
151
119
  backdrop.call(this)
152
120
  }
153
121
 
154
- function backdrop ( callback ) {
122
+ function backdrop( callback ) {
155
123
  var that = this
156
124
  , animate = this.$element.hasClass('fade') ? 'fade' : ''
157
- if ( this.isShown && this.settings.backdrop ) {
125
+
126
+ if (this.isShown && this.options.backdrop) {
158
127
  var doAnimate = $.support.transition && animate
159
128
 
160
129
  this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
161
130
  .appendTo(document.body)
162
131
 
163
- if ( this.settings.backdrop != 'static' ) {
132
+ if (this.options.backdrop != 'static') {
164
133
  this.$backdrop.click($.proxy(this.hide, this))
165
134
  }
166
135
 
167
- if ( doAnimate ) {
168
- this.$backdrop[0].offsetWidth // force reflow
169
- }
136
+ if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
170
137
 
171
138
  this.$backdrop.addClass('in')
172
139
 
173
140
  doAnimate ?
174
- this.$backdrop.one(transitionEnd, callback) :
141
+ this.$backdrop.one($.support.transition.end, callback) :
175
142
  callback()
176
143
 
177
- } else if ( !this.isShown && this.$backdrop ) {
144
+ } else if (!this.isShown && this.$backdrop) {
178
145
  this.$backdrop.removeClass('in')
179
146
 
180
147
  $.support.transition && this.$element.hasClass('fade')?
181
- this.$backdrop.one(transitionEnd, $.proxy(removeBackdrop, this)) :
148
+ this.$backdrop.one($.support.transition.end, $.proxy(removeBackdrop, this)) :
182
149
  removeBackdrop.call(this)
183
150
 
184
- } else if ( callback ) {
185
- callback()
151
+ } else if (callback) {
152
+ callback()
186
153
  }
187
154
  }
188
155
 
@@ -193,14 +160,12 @@
193
160
 
194
161
  function escape() {
195
162
  var that = this
196
- if ( this.isShown && this.settings.keyboard ) {
197
- $(document).bind('keyup.modal', function ( e ) {
198
- if ( e.which == 27 ) {
199
- that.hide()
200
- }
163
+ if (this.isShown && this.options.keyboard) {
164
+ $(document).on('keyup.dismiss.modal', function ( e ) {
165
+ e.which == 27 && that.hide()
201
166
  })
202
- } else if ( !this.isShown ) {
203
- $(document).unbind('keyup.modal')
167
+ } else if (!this.isShown) {
168
+ $(document).off('keyup.dismiss.modal')
204
169
  }
205
170
  }
206
171
 
@@ -208,53 +173,38 @@
208
173
  /* MODAL PLUGIN DEFINITION
209
174
  * ======================= */
210
175
 
211
- $.fn.modal = function ( options ) {
212
- var modal = this.data('modal')
213
-
214
- if (!modal) {
215
-
216
- if (typeof options == 'string') {
217
- options = {
218
- show: /show|toggle/.test(options)
219
- }
220
- }
221
-
222
- return this.each(function () {
223
- $(this).data('modal', new Modal(this, options))
224
- })
225
- }
226
-
227
- if ( options === true ) {
228
- return modal
229
- }
230
-
231
- if ( typeof options == 'string' ) {
232
- modal[options]()
233
- } else if ( modal ) {
234
- modal.toggle()
235
- }
236
-
237
- return this
176
+ $.fn.modal = function ( option ) {
177
+ return this.each(function () {
178
+ var $this = $(this)
179
+ , data = $this.data('modal')
180
+ , options = $.extend({}, $.fn.modal.defaults, typeof option == 'object' && option)
181
+ if (!data) $this.data('modal', (data = new Modal(this, options)))
182
+ if (typeof option == 'string') data[option]()
183
+ else if (options.show) data.show()
184
+ })
238
185
  }
239
186
 
240
- $.fn.modal.Modal = Modal
241
-
242
187
  $.fn.modal.defaults = {
243
- backdrop: false
244
- , keyboard: false
245
- , show: false
188
+ backdrop: true
189
+ , keyboard: true
190
+ , show: true
246
191
  }
247
192
 
193
+ $.fn.modal.Constructor = Modal
194
+
195
+
196
+ /* MODAL DATA-API
197
+ * ============== */
248
198
 
249
- /* MODAL DATA- IMPLEMENTATION
250
- * ========================== */
199
+ $(function () {
200
+ $('body').on('click.modal.data-api', '[data-toggle="modal"]', function ( e ) {
201
+ var $this = $(this), href
202
+ , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
203
+ , option = $target.data('modal') ? 'toggle' : $.extend({}, $target.data(), $this.data())
251
204
 
252
- $(document).ready(function () {
253
- $('body').delegate('[data-controls-modal]', 'click', function (e) {
254
205
  e.preventDefault()
255
- var $this = $(this).data('show', true)
256
- $('#' + $this.attr('data-controls-modal')).modal( $this.data() )
206
+ $target.modal(option)
257
207
  })
258
208
  })
259
209
 
260
- }( window.jQuery || window.ender );
210
+ }( window.jQuery )
@@ -1,8 +1,8 @@
1
1
  /* ===========================================================
2
- * bootstrap-popover.js v1.4.0
3
- * http://twitter.github.com/bootstrap/javascript.html#popover
2
+ * bootstrap-popover.js v2.0.0
3
+ * http://twitter.github.com/bootstrap/javascript.html#popovers
4
4
  * ===========================================================
5
- * Copyright 2011 Twitter, Inc.
5
+ * Copyright 2012 Twitter, Inc.
6
6
  *
7
7
  * Licensed under the Apache License, Version 2.0 (the "License");
8
8
  * you may not use this file except in compliance with the License.
@@ -23,22 +23,25 @@
23
23
  "use strict"
24
24
 
25
25
  var Popover = function ( element, options ) {
26
- this.$element = $(element)
27
- this.options = options
28
- this.enabled = true
29
- this.fixTitle()
26
+ this.init('popover', element, options)
30
27
  }
31
28
 
32
- /* NOTE: POPOVER EXTENDS BOOTSTRAP-TWIPSY.js
33
- ========================================= */
29
+ /* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js
30
+ ========================================== */
34
31
 
35
- Popover.prototype = $.extend({}, $.fn.twipsy.Twipsy.prototype, {
32
+ Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype, {
36
33
 
37
- setContent: function () {
34
+ constructor: Popover
35
+
36
+ , setContent: function () {
38
37
  var $tip = this.tip()
39
- $tip.find('.title')[this.options.html ? 'html' : 'text'](this.getTitle())
40
- $tip.find('.content > *')[this.options.html ? 'html' : 'text'](this.getContent())
41
- $tip[0].className = 'popover'
38
+ , title = this.getTitle()
39
+ , content = this.getContent()
40
+
41
+ $tip.find('.popover-title')[ $.type(title) == 'object' ? 'append' : 'html' ](title)
42
+ $tip.find('.popover-content > *')[ $.type(content) == 'object' ? 'append' : 'html' ](content)
43
+
44
+ $tip.removeClass('fade top bottom left right in')
42
45
  }
43
46
 
44
47
  , hasContent: function () {
@@ -47,22 +50,20 @@
47
50
 
48
51
  , getContent: function () {
49
52
  var content
50
- , $e = this.$element
51
- , o = this.options
53
+ , $e = this.$element
54
+ , o = this.options
52
55
 
53
- if (typeof this.options.content == 'string') {
54
- content = $e.attr(this.options.content)
55
- } else if (typeof this.options.content == 'function') {
56
- content = this.options.content.call(this.$element[0])
57
- }
56
+ content = $e.attr('data-content')
57
+ || (typeof o.content == 'function' ? o.content.call($e[0]) : o.content)
58
+
59
+ content = content.toString().replace(/(^\s*|\s*$)/, "")
58
60
 
59
61
  return content
60
62
  }
61
63
 
62
64
  , tip: function() {
63
65
  if (!this.$tip) {
64
- this.$tip = $('<div class="popover" />')
65
- .html(this.options.template)
66
+ this.$tip = $(this.options.template)
66
67
  }
67
68
  return this.$tip
68
69
  }
@@ -73,18 +74,22 @@
73
74
  /* POPOVER PLUGIN DEFINITION
74
75
  * ======================= */
75
76
 
76
- $.fn.popover = function (options) {
77
- if (typeof options == 'object') options = $.extend({}, $.fn.popover.defaults, options)
78
- $.fn.twipsy.initWith.call(this, options, Popover, 'popover')
79
- return this
77
+ $.fn.popover = function ( option ) {
78
+ return this.each(function () {
79
+ var $this = $(this)
80
+ , data = $this.data('popover')
81
+ , options = typeof option == 'object' && option
82
+ if (!data) $this.data('popover', (data = new Popover(this, options)))
83
+ if (typeof option == 'string') data[option]()
84
+ })
80
85
  }
81
86
 
82
- $.fn.popover.defaults = $.extend({} , $.fn.twipsy.defaults, {
87
+ $.fn.popover.Constructor = Popover
88
+
89
+ $.fn.popover.defaults = $.extend({} , $.fn.tooltip.defaults, {
83
90
  placement: 'right'
84
- , content: 'data-content'
85
- , template: '<div class="arrow"></div><div class="inner"><h3 class="title"></h3><div class="content"><p></p></div></div>'
91
+ , content: ''
92
+ , template: '<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><p></p></div></div></div>'
86
93
  })
87
94
 
88
- $.fn.twipsy.rejectAttrOptions.push( 'content' )
89
-
90
- }( window.jQuery || window.ender );
95
+ }( window.jQuery )