bootstrap-sass-rails 1.4.0.3 → 2.0.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. data/lib/bootstrap/sass/rails/version.rb +1 -1
  2. data/vendor/assets/images/twitter/bootstrap/glyphicons-halflings-white.png +0 -0
  3. data/vendor/assets/images/twitter/bootstrap/glyphicons-halflings.png +0 -0
  4. data/vendor/assets/javascripts/twitter/bootstrap.js +12 -8
  5. data/vendor/assets/javascripts/twitter/bootstrap/alert.js +91 -0
  6. data/vendor/assets/javascripts/twitter/bootstrap/button.js +98 -0
  7. data/vendor/assets/javascripts/twitter/bootstrap/carousel.js +154 -0
  8. data/vendor/assets/javascripts/twitter/bootstrap/collapse.js +136 -0
  9. data/vendor/assets/javascripts/twitter/bootstrap/dropdown.js +58 -21
  10. data/vendor/assets/javascripts/twitter/bootstrap/modal.js +63 -114
  11. data/vendor/assets/javascripts/twitter/bootstrap/popover.js +38 -33
  12. data/vendor/assets/javascripts/twitter/bootstrap/scrollspy.js +62 -44
  13. data/vendor/assets/javascripts/twitter/bootstrap/tab.js +130 -0
  14. data/vendor/assets/javascripts/twitter/bootstrap/tooltip.js +270 -0
  15. data/vendor/assets/javascripts/twitter/bootstrap/transition.js +51 -0
  16. data/vendor/assets/javascripts/twitter/bootstrap/typeahead.js +271 -0
  17. data/vendor/assets/stylesheets/twitter/bootstrap.css.scss +50 -14
  18. data/vendor/assets/stylesheets/twitter/bootstrap/_accordion.scss +28 -0
  19. data/vendor/assets/stylesheets/twitter/bootstrap/_alerts.scss +70 -0
  20. data/vendor/assets/stylesheets/twitter/bootstrap/_breadcrumbs.scss +22 -0
  21. data/vendor/assets/stylesheets/twitter/bootstrap/_button-groups.scss +147 -0
  22. data/vendor/assets/stylesheets/twitter/bootstrap/_buttons.scss +165 -0
  23. data/vendor/assets/stylesheets/twitter/bootstrap/_carousel.scss +121 -0
  24. data/vendor/assets/stylesheets/twitter/bootstrap/_close.scss +18 -0
  25. data/vendor/assets/stylesheets/twitter/bootstrap/_code.scss +44 -0
  26. data/vendor/assets/stylesheets/twitter/bootstrap/_component-animations.scss +18 -0
  27. data/vendor/assets/stylesheets/twitter/bootstrap/_dropdowns.scss +131 -0
  28. data/vendor/assets/stylesheets/twitter/bootstrap/_forms.scss +335 -299
  29. data/vendor/assets/stylesheets/twitter/bootstrap/_grid.scss +8 -0
  30. data/vendor/assets/stylesheets/twitter/bootstrap/_hero-unit.scss +20 -0
  31. data/vendor/assets/stylesheets/twitter/bootstrap/_labels.scss +16 -0
  32. data/vendor/assets/stylesheets/twitter/bootstrap/_layouts.scss +17 -0
  33. data/vendor/assets/stylesheets/twitter/bootstrap/_mixins.scss +429 -124
  34. data/vendor/assets/stylesheets/twitter/bootstrap/_modals.scss +72 -0
  35. data/vendor/assets/stylesheets/twitter/bootstrap/_navbar.scss +292 -0
  36. data/vendor/assets/stylesheets/twitter/bootstrap/_navs.scss +343 -0
  37. data/vendor/assets/stylesheets/twitter/bootstrap/_pager.scss +30 -0
  38. data/vendor/assets/stylesheets/twitter/bootstrap/_pagination.scss +55 -0
  39. data/vendor/assets/stylesheets/twitter/bootstrap/_patterns.scss +5 -1051
  40. data/vendor/assets/stylesheets/twitter/bootstrap/_popovers.scss +49 -0
  41. data/vendor/assets/stylesheets/twitter/bootstrap/_print.scss +18 -0
  42. data/vendor/assets/stylesheets/twitter/bootstrap/_progress-bars.scss +95 -0
  43. data/vendor/assets/stylesheets/twitter/bootstrap/_reset.scss +36 -51
  44. data/vendor/assets/stylesheets/twitter/bootstrap/_responsive.scss +323 -0
  45. data/vendor/assets/stylesheets/twitter/bootstrap/_scaffolding.scss +13 -123
  46. data/vendor/assets/stylesheets/twitter/bootstrap/_sprites.scss +156 -0
  47. data/vendor/assets/stylesheets/twitter/bootstrap/_tables.scss +75 -160
  48. data/vendor/assets/stylesheets/twitter/bootstrap/_thumbnails.scss +35 -0
  49. data/vendor/assets/stylesheets/twitter/bootstrap/_tooltip.scss +35 -0
  50. data/vendor/assets/stylesheets/twitter/bootstrap/_type.scss +100 -70
  51. data/vendor/assets/stylesheets/twitter/bootstrap/_utilities.scss +23 -0
  52. data/vendor/assets/stylesheets/twitter/bootstrap/_variables.scss +94 -55
  53. data/vendor/assets/stylesheets/twitter/bootstrap/_wells.scss +17 -0
  54. metadata +51 -75
  55. data/test/dummy/log/test.log +0 -462
  56. data/test/dummy/tmp/cache/assets/C29/E80/sprockets%2F8f076727207424919c7170c7157bbe37 +0 -1102
  57. data/test/dummy/tmp/cache/assets/D3F/FA0/sprockets%2F22c8366fdbaaa2872b202dfe7376629f +0 -0
  58. data/test/dummy/tmp/cache/assets/E5F/300/sprockets%2F243a2fff0dbb8aeec3dd579b4ff7c81b +0 -1048
  59. data/test/dummy/tmp/cache/sass/367107abe8cc7204b7df467455e0644864892d9f/_forms.scssc +0 -0
  60. data/test/dummy/tmp/cache/sass/367107abe8cc7204b7df467455e0644864892d9f/_mixins.scssc +0 -0
  61. data/test/dummy/tmp/cache/sass/367107abe8cc7204b7df467455e0644864892d9f/_patterns.scssc +0 -0
  62. data/test/dummy/tmp/cache/sass/367107abe8cc7204b7df467455e0644864892d9f/_reset.scssc +0 -0
  63. data/test/dummy/tmp/cache/sass/367107abe8cc7204b7df467455e0644864892d9f/_scaffolding.scssc +0 -0
  64. data/test/dummy/tmp/cache/sass/367107abe8cc7204b7df467455e0644864892d9f/_tables.scssc +0 -0
  65. data/test/dummy/tmp/cache/sass/367107abe8cc7204b7df467455e0644864892d9f/_type.scssc +0 -0
  66. data/test/dummy/tmp/cache/sass/367107abe8cc7204b7df467455e0644864892d9f/_variables.scssc +0 -0
  67. data/test/dummy/tmp/cache/sass/766526f7d87ffdf0401dde0ec8d49f976470392d/_bootstrap.scssc +0 -0
  68. data/test/dummy/tmp/cache/sass/766526f7d87ffdf0401dde0ec8d49f976470392d/bootstrap.css.scssc +0 -0
  69. data/test/dummy/tmp/cache/sass/766526f7d87ffdf0401dde0ec8d49f976470392d/bootstrap.cssc +0 -0
  70. data/test/dummy/tmp/cache/sass/8f44dddc3cc4868f43c2a4153ce3876663527256/_bootstrap.scssc +0 -0
  71. data/test/dummy/tmp/cache/sass/8f44dddc3cc4868f43c2a4153ce3876663527256/bootstrap.css.scssc +0 -0
  72. data/test/dummy/tmp/cache/sass/95eca8acb76bbb914a4c6988012b73e61e9bcc23/application.css.scssc +0 -0
  73. data/test/dummy/tmp/cache/sass/95eca8acb76bbb914a4c6988012b73e61e9bcc23/individual.css.scssc +0 -0
  74. data/test/dummy/tmp/cache/sass/cd2e949d41af4ab87fc8c5c6e94e4e802032bd18/_forms.scssc +0 -0
  75. data/test/dummy/tmp/cache/sass/cd2e949d41af4ab87fc8c5c6e94e4e802032bd18/_mixins.scssc +0 -0
  76. data/test/dummy/tmp/cache/sass/cd2e949d41af4ab87fc8c5c6e94e4e802032bd18/_patterns.scssc +0 -0
  77. data/test/dummy/tmp/cache/sass/cd2e949d41af4ab87fc8c5c6e94e4e802032bd18/_reset.scssc +0 -0
  78. data/test/dummy/tmp/cache/sass/cd2e949d41af4ab87fc8c5c6e94e4e802032bd18/_scaffolding.scssc +0 -0
  79. data/test/dummy/tmp/cache/sass/cd2e949d41af4ab87fc8c5c6e94e4e802032bd18/_tables.scssc +0 -0
  80. data/test/dummy/tmp/cache/sass/cd2e949d41af4ab87fc8c5c6e94e4e802032bd18/_type.scssc +0 -0
  81. data/test/dummy/tmp/cache/sass/cd2e949d41af4ab87fc8c5c6e94e4e802032bd18/_variables.scssc +0 -0
  82. data/test/dummy/tmp/cache/sass/cd2e949d41af4ab87fc8c5c6e94e4e802032bd18/mixins.scssc +0 -0
  83. data/test/dummy/tmp/cache/sass/cd2e949d41af4ab87fc8c5c6e94e4e802032bd18/variables.css.scssc +0 -0
  84. data/vendor/assets/javascripts/twitter/bootstrap/alerts.js +0 -124
  85. data/vendor/assets/javascripts/twitter/bootstrap/buttons.js +0 -64
  86. data/vendor/assets/javascripts/twitter/bootstrap/tabs.js +0 -80
  87. data/vendor/assets/javascripts/twitter/bootstrap/twipsy.js +0 -321
@@ -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 = $.extend({}, $.fn.modal.defaults, 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,37 @@
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 = typeof option == 'object' && option
181
+ if (!data) $this.data('modal', (data = new Modal(this, options)))
182
+ if (typeof option == 'string') data[option]()
183
+ else 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
246
190
  }
247
191
 
192
+ $.fn.modal.Constructor = Modal
193
+
194
+
195
+ /* MODAL DATA-API
196
+ * ============== */
248
197
 
249
- /* MODAL DATA- IMPLEMENTATION
250
- * ========================== */
198
+ $(function () {
199
+ $('body').on('click.modal.data-api', '[data-toggle="modal"]', function ( e ) {
200
+ var $this = $(this), href
201
+ , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
202
+ , option = $target.data('modal') ? 'toggle' : $.extend({}, $target.data(), $this.data())
251
203
 
252
- $(document).ready(function () {
253
- $('body').delegate('[data-controls-modal]', 'click', function (e) {
254
204
  e.preventDefault()
255
- var $this = $(this).data('show', true)
256
- $('#' + $this.attr('data-controls-modal')).modal( $this.data() )
205
+ $target.modal(option)
257
206
  })
258
207
  })
259
208
 
260
- }( window.jQuery || window.ender );
209
+ }( 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 )