twitter-bootstrap-ruby 2.1.1.0 → 2.3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /* ===================================================
2
- * bootstrap-transition.js v2.1.1
2
+ * bootstrap-transition.js v2.3.1
3
3
  * http://twitter.github.com/bootstrap/javascript.html#transitions
4
4
  * ===================================================
5
5
  * Copyright 2012 Twitter, Inc.
@@ -20,13 +20,13 @@
20
20
 
21
21
  !function ($) {
22
22
 
23
- $(function () {
23
+ "use strict"; // jshint ;_;
24
24
 
25
- "use strict"; // jshint ;_;
26
25
 
26
+ /* CSS TRANSITION SUPPORT (http://www.modernizr.com/)
27
+ * ======================================================= */
27
28
 
28
- /* CSS TRANSITION SUPPORT (http://www.modernizr.com/)
29
- * ======================================================= */
29
+ $(function () {
30
30
 
31
31
  $.support.transition = (function () {
32
32
 
@@ -1,5 +1,5 @@
1
1
  /* =============================================================
2
- * bootstrap-typeahead.js v2.1.1
2
+ * bootstrap-typeahead.js v2.3.1
3
3
  * http://twitter.github.com/bootstrap/javascript.html#typeahead
4
4
  * =============================================================
5
5
  * Copyright 2012 Twitter, Inc.
@@ -33,8 +33,8 @@
33
33
  this.sorter = this.options.sorter || this.sorter
34
34
  this.highlighter = this.options.highlighter || this.highlighter
35
35
  this.updater = this.options.updater || this.updater
36
- this.$menu = $(this.options.menu).appendTo('body')
37
36
  this.source = this.options.source
37
+ this.$menu = $(this.options.menu)
38
38
  this.shown = false
39
39
  this.listen()
40
40
  }
@@ -56,16 +56,18 @@
56
56
  }
57
57
 
58
58
  , show: function () {
59
- var pos = $.extend({}, this.$element.offset(), {
59
+ var pos = $.extend({}, this.$element.position(), {
60
60
  height: this.$element[0].offsetHeight
61
61
  })
62
62
 
63
- this.$menu.css({
64
- top: pos.top + pos.height
65
- , left: pos.left
66
- })
63
+ this.$menu
64
+ .insertAfter(this.$element)
65
+ .css({
66
+ top: pos.top + pos.height
67
+ , left: pos.left
68
+ })
69
+ .show()
67
70
 
68
- this.$menu.show()
69
71
  this.shown = true
70
72
  return this
71
73
  }
@@ -170,17 +172,28 @@
170
172
 
171
173
  , listen: function () {
172
174
  this.$element
175
+ .on('focus', $.proxy(this.focus, this))
173
176
  .on('blur', $.proxy(this.blur, this))
174
177
  .on('keypress', $.proxy(this.keypress, this))
175
178
  .on('keyup', $.proxy(this.keyup, this))
176
179
 
177
- if ($.browser.chrome || $.browser.webkit || $.browser.msie) {
180
+ if (this.eventSupported('keydown')) {
178
181
  this.$element.on('keydown', $.proxy(this.keydown, this))
179
182
  }
180
183
 
181
184
  this.$menu
182
185
  .on('click', $.proxy(this.click, this))
183
186
  .on('mouseenter', 'li', $.proxy(this.mouseenter, this))
187
+ .on('mouseleave', 'li', $.proxy(this.mouseleave, this))
188
+ }
189
+
190
+ , eventSupported: function(eventName) {
191
+ var isSupported = eventName in this.$element
192
+ if (!isSupported) {
193
+ this.$element.setAttribute(eventName, 'return;')
194
+ isSupported = typeof this.$element[eventName] === 'function'
195
+ }
196
+ return isSupported
184
197
  }
185
198
 
186
199
  , move: function (e) {
@@ -208,7 +221,7 @@
208
221
  }
209
222
 
210
223
  , keydown: function (e) {
211
- this.suppressKeyPressRepeat = !~$.inArray(e.keyCode, [40,38,9,13,27])
224
+ this.suppressKeyPressRepeat = ~$.inArray(e.keyCode, [40,38,9,13,27])
212
225
  this.move(e)
213
226
  }
214
227
 
@@ -221,6 +234,9 @@
221
234
  switch(e.keyCode) {
222
235
  case 40: // down arrow
223
236
  case 38: // up arrow
237
+ case 16: // shift
238
+ case 17: // ctrl
239
+ case 18: // alt
224
240
  break
225
241
 
226
242
  case 9: // tab
@@ -242,28 +258,41 @@
242
258
  e.preventDefault()
243
259
  }
244
260
 
261
+ , focus: function (e) {
262
+ this.focused = true
263
+ }
264
+
245
265
  , blur: function (e) {
246
- var that = this
247
- setTimeout(function () { that.hide() }, 150)
266
+ this.focused = false
267
+ if (!this.mousedover && this.shown) this.hide()
248
268
  }
249
269
 
250
270
  , click: function (e) {
251
271
  e.stopPropagation()
252
272
  e.preventDefault()
253
273
  this.select()
274
+ this.$element.focus()
254
275
  }
255
276
 
256
277
  , mouseenter: function (e) {
278
+ this.mousedover = true
257
279
  this.$menu.find('.active').removeClass('active')
258
280
  $(e.currentTarget).addClass('active')
259
281
  }
260
282
 
283
+ , mouseleave: function (e) {
284
+ this.mousedover = false
285
+ if (!this.focused && this.shown) this.hide()
286
+ }
287
+
261
288
  }
262
289
 
263
290
 
264
291
  /* TYPEAHEAD PLUGIN DEFINITION
265
292
  * =========================== */
266
293
 
294
+ var old = $.fn.typeahead
295
+
267
296
  $.fn.typeahead = function (option) {
268
297
  return this.each(function () {
269
298
  var $this = $(this)
@@ -285,16 +314,22 @@
285
314
  $.fn.typeahead.Constructor = Typeahead
286
315
 
287
316
 
288
- /* TYPEAHEAD DATA-API
317
+ /* TYPEAHEAD NO CONFLICT
318
+ * =================== */
319
+
320
+ $.fn.typeahead.noConflict = function () {
321
+ $.fn.typeahead = old
322
+ return this
323
+ }
324
+
325
+
326
+ /* TYPEAHEAD DATA-API
289
327
  * ================== */
290
328
 
291
- $(function () {
292
- $('body').on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) {
293
- var $this = $(this)
294
- if ($this.data('typeahead')) return
295
- e.preventDefault()
296
- $this.typeahead($this.data())
297
- })
329
+ $(document).on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) {
330
+ var $this = $(this)
331
+ if ($this.data('typeahead')) return
332
+ $this.typeahead($this.data())
298
333
  })
299
334
 
300
335
  }(window.jQuery);
@@ -1,5 +1,5 @@
1
1
  module Twitter
2
2
  module Bootstrap
3
- VERSION = "2.1.1.0"
3
+ VERSION = "2.3.1.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twitter-bootstrap-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1.0
4
+ version: 2.3.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,22 +9,27 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-06 00:00:00.000000000 Z
12
+ date: 2013-04-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: less
16
- requirement: &69619160 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
20
20
  - !ruby/object:Gem::Version
21
- version: 2.2.2
21
+ version: 2.3.1
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *69619160
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: 2.3.1
25
30
  - !ruby/object:Gem::Dependency
26
31
  name: therubyracer
27
- requirement: &69618900 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
28
33
  none: false
29
34
  requirements:
30
35
  - - ~>
@@ -32,7 +37,12 @@ dependencies:
32
37
  version: 0.10.2
33
38
  type: :development
34
39
  prerelease: false
35
- version_requirements: *69618900
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: 0.10.2
36
46
  description: twitter-bootstrap-ruby project integrates Bootstrap JS, and CSS toolkit
37
47
  for Espresso, and Sinatra Asset
38
48
  email:
@@ -71,17 +81,22 @@ required_ruby_version: !ruby/object:Gem::Requirement
71
81
  - - ! '>='
72
82
  - !ruby/object:Gem::Version
73
83
  version: '0'
84
+ segments:
85
+ - 0
86
+ hash: 1057839217
74
87
  required_rubygems_version: !ruby/object:Gem::Requirement
75
88
  none: false
76
89
  requirements:
77
90
  - - ! '>='
78
91
  - !ruby/object:Gem::Version
79
92
  version: '0'
93
+ segments:
94
+ - 0
95
+ hash: 1057839217
80
96
  requirements: []
81
97
  rubyforge_project: twitter-bootstrap-ruby
82
- rubygems_version: 1.8.10
98
+ rubygems_version: 1.8.25
83
99
  signing_key:
84
100
  specification_version: 3
85
101
  summary: Bootstrap CSS toolkit for Espresso, and Sinatra Asset
86
102
  test_files: []
87
- has_rdoc: