anjlab-bootstrap-rails 2.3.1.2 → 3.0.0.0.alpha1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) hide show
  1. checksums.yaml +4 -4
  2. data/.gitmodules +3 -0
  3. data/Rakefile +42 -26
  4. data/lib/bootstrap-rails.rb +5 -6
  5. data/lib/bootstrap-rails/engine.rb +2 -9
  6. data/lib/bootstrap-rails/version.rb +1 -1
  7. data/test/test_helper.rb +2 -2
  8. data/vendor/assets/fonts/twitter/glyphiconshalflings-regular.eot +0 -0
  9. data/vendor/assets/fonts/twitter/glyphiconshalflings-regular.otf +0 -0
  10. data/vendor/assets/fonts/twitter/glyphiconshalflings-regular.svg +175 -0
  11. data/vendor/assets/fonts/twitter/glyphiconshalflings-regular.ttf +0 -0
  12. data/vendor/assets/fonts/twitter/glyphiconshalflings-regular.woff +0 -0
  13. data/vendor/assets/javascripts/twitter/bootstrap.js +4 -5
  14. data/vendor/assets/javascripts/twitter/bootstrap/affix.js +50 -47
  15. data/vendor/assets/javascripts/twitter/bootstrap/alert.js +32 -35
  16. data/vendor/assets/javascripts/twitter/bootstrap/button.js +37 -37
  17. data/vendor/assets/javascripts/twitter/bootstrap/carousel.js +123 -127
  18. data/vendor/assets/javascripts/twitter/bootstrap/collapse.js +81 -95
  19. data/vendor/assets/javascripts/twitter/bootstrap/dropdown.js +61 -81
  20. data/vendor/assets/javascripts/twitter/bootstrap/modal.js +146 -151
  21. data/vendor/assets/javascripts/twitter/bootstrap/popover.js +53 -58
  22. data/vendor/assets/javascripts/twitter/bootstrap/scrollspy.js +99 -105
  23. data/vendor/assets/javascripts/twitter/bootstrap/tab.js +70 -81
  24. data/vendor/assets/javascripts/twitter/bootstrap/tooltip.js +246 -254
  25. data/vendor/assets/javascripts/twitter/bootstrap/transition.js +24 -37
  26. data/vendor/assets/stylesheets/twitter/bootstrap.scss +1 -1
  27. data/vendor/{frameworks/twitter/bootstrap/accordion.scss → assets/stylesheets/twitter/bootstrap/_accordion.scss} +2 -2
  28. data/vendor/assets/stylesheets/twitter/bootstrap/_alerts.scss +92 -0
  29. data/vendor/assets/stylesheets/twitter/bootstrap/_badges.scss +58 -0
  30. data/vendor/assets/stylesheets/twitter/bootstrap/_bootstrap.scss +64 -0
  31. data/vendor/assets/stylesheets/twitter/bootstrap/_breadcrumbs.scss +28 -0
  32. data/vendor/assets/stylesheets/twitter/bootstrap/_button-groups.scss +170 -0
  33. data/vendor/assets/stylesheets/twitter/bootstrap/_buttons.scss +160 -0
  34. data/vendor/assets/stylesheets/twitter/bootstrap/_carousel.scss +191 -0
  35. data/vendor/{frameworks/twitter/bootstrap/close.scss → assets/stylesheets/twitter/bootstrap/_close.scss} +7 -6
  36. data/vendor/{frameworks/twitter/bootstrap/code.scss → assets/stylesheets/twitter/bootstrap/_code.scss} +14 -14
  37. data/vendor/{frameworks/twitter/bootstrap/component-animations.scss → assets/stylesheets/twitter/bootstrap/_component-animations.scss} +1 -0
  38. data/vendor/{frameworks/twitter/bootstrap/dropdowns.scss → assets/stylesheets/twitter/bootstrap/_dropdowns.scss} +46 -57
  39. data/vendor/assets/stylesheets/twitter/bootstrap/_forms.scss +464 -0
  40. data/vendor/assets/stylesheets/twitter/bootstrap/_glyphicons.scss +200 -0
  41. data/vendor/assets/stylesheets/twitter/bootstrap/_grid.scss +65 -0
  42. data/vendor/assets/stylesheets/twitter/bootstrap/_jumbotron.scss +32 -0
  43. data/vendor/assets/stylesheets/twitter/bootstrap/_labels.scss +70 -0
  44. data/vendor/assets/stylesheets/twitter/bootstrap/_list-group.scss +96 -0
  45. data/vendor/{frameworks/twitter/bootstrap/media.scss → assets/stylesheets/twitter/bootstrap/_media.scss} +0 -1
  46. data/vendor/assets/stylesheets/twitter/bootstrap/_mixins.scss +510 -0
  47. data/vendor/assets/stylesheets/twitter/bootstrap/_modals.scss +137 -0
  48. data/vendor/assets/stylesheets/twitter/bootstrap/_navbar.scss +356 -0
  49. data/vendor/assets/stylesheets/twitter/bootstrap/_navs.scss +249 -0
  50. data/vendor/assets/stylesheets/twitter/bootstrap/_normalize.scss +396 -0
  51. data/vendor/assets/stylesheets/twitter/bootstrap/_pager.scss +54 -0
  52. data/vendor/assets/stylesheets/twitter/bootstrap/_pagination.scss +87 -0
  53. data/vendor/assets/stylesheets/twitter/bootstrap/_panels.scss +96 -0
  54. data/vendor/{frameworks/twitter/bootstrap/popovers.scss → assets/stylesheets/twitter/bootstrap/_popovers.scss} +32 -32
  55. data/vendor/assets/stylesheets/twitter/bootstrap/_print.scss +74 -0
  56. data/vendor/{frameworks/twitter/bootstrap/progress-bars.scss → assets/stylesheets/twitter/bootstrap/_progress-bars.scss} +40 -44
  57. data/vendor/assets/stylesheets/twitter/bootstrap/_responsive-utilities.scss +77 -0
  58. data/vendor/assets/stylesheets/twitter/bootstrap/_scaffolding.scss +83 -0
  59. data/vendor/assets/stylesheets/twitter/bootstrap/_tables.scss +242 -0
  60. data/vendor/assets/stylesheets/twitter/bootstrap/_thumbnails.scss +43 -0
  61. data/vendor/{frameworks/twitter/bootstrap/tooltip.scss → assets/stylesheets/twitter/bootstrap/_tooltip.scss} +20 -19
  62. data/vendor/assets/stylesheets/twitter/bootstrap/_type.scss +253 -0
  63. data/vendor/{frameworks/twitter/bootstrap/utilities.scss → assets/stylesheets/twitter/bootstrap/_utilities.scss} +17 -5
  64. data/vendor/assets/stylesheets/twitter/bootstrap/_variables.scss +416 -0
  65. data/vendor/{frameworks/twitter/bootstrap/wells.scss → assets/stylesheets/twitter/bootstrap/_wells.scss} +5 -5
  66. metadata +49 -53
  67. data/lib/bootstrap-rails/ie_hex_str.rb +0 -16
  68. data/test/ie_hex_str_test.rb +0 -26
  69. data/vendor/assets/images/twitter/glyphicons-halflings-white.png +0 -0
  70. data/vendor/assets/images/twitter/glyphicons-halflings.png +0 -0
  71. data/vendor/assets/javascripts/twitter/bootstrap/typeahead.js +0 -335
  72. data/vendor/assets/stylesheets/twitter/bootstrap-responsive.scss +0 -1
  73. data/vendor/frameworks/twitter/bootstrap.scss +0 -1
  74. data/vendor/frameworks/twitter/bootstrap/alerts.scss +0 -79
  75. data/vendor/frameworks/twitter/bootstrap/bootstrap.scss +0 -63
  76. data/vendor/frameworks/twitter/bootstrap/breadcrumbs.scss +0 -24
  77. data/vendor/frameworks/twitter/bootstrap/button-groups.scss +0 -230
  78. data/vendor/frameworks/twitter/bootstrap/buttons.scss +0 -228
  79. data/vendor/frameworks/twitter/bootstrap/carousel.scss +0 -158
  80. data/vendor/frameworks/twitter/bootstrap/forms.scss +0 -690
  81. data/vendor/frameworks/twitter/bootstrap/grid.scss +0 -21
  82. data/vendor/frameworks/twitter/bootstrap/hero-unit.scss +0 -25
  83. data/vendor/frameworks/twitter/bootstrap/labels-badges.scss +0 -83
  84. data/vendor/frameworks/twitter/bootstrap/layouts.scss +0 -16
  85. data/vendor/frameworks/twitter/bootstrap/mixins.scss +0 -704
  86. data/vendor/frameworks/twitter/bootstrap/modals.scss +0 -95
  87. data/vendor/frameworks/twitter/bootstrap/navbar.scss +0 -496
  88. data/vendor/frameworks/twitter/bootstrap/navs.scss +0 -409
  89. data/vendor/frameworks/twitter/bootstrap/pager.scss +0 -43
  90. data/vendor/frameworks/twitter/bootstrap/pagination.scss +0 -123
  91. data/vendor/frameworks/twitter/bootstrap/reset.scss +0 -216
  92. data/vendor/frameworks/twitter/bootstrap/responsive-1200px-min.scss +0 -28
  93. data/vendor/frameworks/twitter/bootstrap/responsive-767px-max.scss +0 -189
  94. data/vendor/frameworks/twitter/bootstrap/responsive-768px-979px.scss +0 -19
  95. data/vendor/frameworks/twitter/bootstrap/responsive-navbar.scss +0 -189
  96. data/vendor/frameworks/twitter/bootstrap/responsive-utilities.scss +0 -59
  97. data/vendor/frameworks/twitter/bootstrap/responsive.scss +0 -48
  98. data/vendor/frameworks/twitter/bootstrap/scaffolding.scss +0 -53
  99. data/vendor/frameworks/twitter/bootstrap/sprites.scss +0 -197
  100. data/vendor/frameworks/twitter/bootstrap/tables.scss +0 -235
  101. data/vendor/frameworks/twitter/bootstrap/thumbnails.scss +0 -53
  102. data/vendor/frameworks/twitter/bootstrap/type.scss +0 -246
  103. data/vendor/frameworks/twitter/bootstrap/variables.scss +0 -295
@@ -1,7 +1,7 @@
1
- /* =========================================================
2
- * bootstrap-modal.js v2.3.1
1
+ /* ========================================================================
2
+ * Bootstrap: modal.js v3.0.0
3
3
  * http://twitter.github.com/bootstrap/javascript.html#modals
4
- * =========================================================
4
+ * ========================================================================
5
5
  * Copyright 2012 Twitter, Inc.
6
6
  *
7
7
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,210 +15,201 @@
15
15
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
16
  * See the License for the specific language governing permissions and
17
17
  * limitations under the License.
18
- * ========================================================= */
18
+ * ======================================================================== */
19
19
 
20
20
 
21
- !function ($) {
21
+ +function ($) { "use strict";
22
22
 
23
- "use strict"; // jshint ;_;
24
-
25
-
26
- /* MODAL CLASS DEFINITION
27
- * ====================== */
23
+ // MODAL CLASS DEFINITION
24
+ // ======================
28
25
 
29
26
  var Modal = function (element, options) {
30
- this.options = options
31
- this.$element = $(element)
32
- .delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
33
- this.options.remote && this.$element.find('.modal-body').load(this.options.remote)
34
- }
27
+ this.options = options
28
+ this.$element = $(element).delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
29
+ this.$backdrop =
30
+ this.isShown = null
35
31
 
36
- Modal.prototype = {
32
+ if (this.options.remote) this.$element.find('.modal-body').load(this.options.remote)
33
+ }
37
34
 
38
- constructor: Modal
35
+ Modal.DEFAULTS = {
36
+ backdrop: true
37
+ , keyboard: true
38
+ , show: true
39
+ }
39
40
 
40
- , toggle: function () {
41
- return this[!this.isShown ? 'show' : 'hide']()
42
- }
41
+ Modal.prototype.toggle = function () {
42
+ return this[!this.isShown ? 'show' : 'hide']()
43
+ }
43
44
 
44
- , show: function () {
45
- var that = this
46
- , e = $.Event('show')
45
+ Modal.prototype.show = function () {
46
+ var that = this
47
+ var e = $.Event('show.bs.modal')
47
48
 
48
- this.$element.trigger(e)
49
+ this.$element.trigger(e)
49
50
 
50
- if (this.isShown || e.isDefaultPrevented()) return
51
+ if (this.isShown || e.isDefaultPrevented()) return
51
52
 
52
- this.isShown = true
53
+ this.isShown = true
53
54
 
54
- this.escape()
55
+ this.escape()
55
56
 
56
- this.backdrop(function () {
57
- var transition = $.support.transition && that.$element.hasClass('fade')
57
+ this.backdrop(function () {
58
+ var transition = $.support.transition && that.$element.hasClass('fade')
58
59
 
59
- if (!that.$element.parent().length) {
60
- that.$element.appendTo(document.body) //don't move modals dom position
61
- }
60
+ if (!that.$element.parent().length) {
61
+ that.$element.appendTo(document.body) //don't move modals dom position
62
+ }
62
63
 
63
- that.$element.show()
64
+ that.$element.show()
64
65
 
65
- if (transition) {
66
- that.$element[0].offsetWidth // force reflow
67
- }
66
+ if (transition) {
67
+ that.$element[0].offsetWidth // force reflow
68
+ }
68
69
 
69
- that.$element
70
- .addClass('in')
71
- .attr('aria-hidden', false)
70
+ that.$element
71
+ .addClass('in')
72
+ .attr('aria-hidden', false)
72
73
 
73
- that.enforceFocus()
74
+ that.enforceFocus()
74
75
 
75
- transition ?
76
- that.$element.one($.support.transition.end, function () { that.$element.focus().trigger('shown') }) :
77
- that.$element.focus().trigger('shown')
76
+ transition ?
77
+ that.$element.one($.support.transition.end, function () { that.$element.focus().trigger('shown.bs.modal') }) :
78
+ that.$element.focus().trigger('shown.bs.modal')
78
79
 
79
- })
80
- }
80
+ })
81
+ }
81
82
 
82
- , hide: function (e) {
83
- e && e.preventDefault()
83
+ Modal.prototype.hide = function (e) {
84
+ if (e) e.preventDefault()
84
85
 
85
- var that = this
86
+ e = $.Event('hide.bs.modal')
86
87
 
87
- e = $.Event('hide')
88
+ this.$element.trigger(e)
88
89
 
89
- this.$element.trigger(e)
90
+ if (!this.isShown || e.isDefaultPrevented()) return
90
91
 
91
- if (!this.isShown || e.isDefaultPrevented()) return
92
+ this.isShown = false
92
93
 
93
- this.isShown = false
94
+ this.escape()
94
95
 
95
- this.escape()
96
+ $(document).off('focusin.bs.modal')
96
97
 
97
- $(document).off('focusin.modal')
98
+ this.$element
99
+ .removeClass('in')
100
+ .attr('aria-hidden', true)
98
101
 
99
- this.$element
100
- .removeClass('in')
101
- .attr('aria-hidden', true)
102
+ $.support.transition && this.$element.hasClass('fade') ?
103
+ this.hideWithTransition() :
104
+ this.hideModal()
105
+ }
102
106
 
103
- $.support.transition && this.$element.hasClass('fade') ?
104
- this.hideWithTransition() :
105
- this.hideModal()
107
+ Modal.prototype.enforceFocus = function () {
108
+ $(document).on('focusin.bs.modal', function (e) {
109
+ if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {
110
+ this.$element.focus()
106
111
  }
112
+ }, this)
113
+ }
107
114
 
108
- , enforceFocus: function () {
109
- var that = this
110
- $(document).on('focusin.modal', function (e) {
111
- if (that.$element[0] !== e.target && !that.$element.has(e.target).length) {
112
- that.$element.focus()
113
- }
114
- })
115
- }
115
+ Modal.prototype.escape = function () {
116
+ if (this.isShown && this.options.keyboard) {
117
+ this.$element.on('keyup.dismiss.bs.modal', function ( e ) {
118
+ e.which == 27 && this.hide()
119
+ }, this)
120
+ } else if (!this.isShown) {
121
+ this.$element.off('keyup.dismiss.bs.modal')
122
+ }
123
+ }
116
124
 
117
- , escape: function () {
118
- var that = this
119
- if (this.isShown && this.options.keyboard) {
120
- this.$element.on('keyup.dismiss.modal', function ( e ) {
121
- e.which == 27 && that.hide()
122
- })
123
- } else if (!this.isShown) {
124
- this.$element.off('keyup.dismiss.modal')
125
- }
126
- }
125
+ Modal.prototype.hideWithTransition = function () {
126
+ var that = this
127
+ var timeout = setTimeout(function () {
128
+ that.$element.off($.support.transition.end)
129
+ that.hideModal()
130
+ }, 500)
127
131
 
128
- , hideWithTransition: function () {
129
- var that = this
130
- , timeout = setTimeout(function () {
131
- that.$element.off($.support.transition.end)
132
- that.hideModal()
133
- }, 500)
134
-
135
- this.$element.one($.support.transition.end, function () {
136
- clearTimeout(timeout)
137
- that.hideModal()
138
- })
139
- }
132
+ this.$element.one($.support.transition.end, function () {
133
+ clearTimeout(timeout)
134
+ that.hideModal()
135
+ })
136
+ }
140
137
 
141
- , hideModal: function () {
142
- var that = this
143
- this.$element.hide()
144
- this.backdrop(function () {
145
- that.removeBackdrop()
146
- that.$element.trigger('hidden')
147
- })
148
- }
138
+ Modal.prototype.hideModal = function () {
139
+ var that = this
140
+ this.$element.hide()
141
+ this.backdrop(function () {
142
+ that.removeBackdrop()
143
+ that.$element.trigger('hidden.bs.modal')
144
+ })
145
+ }
149
146
 
150
- , removeBackdrop: function () {
151
- this.$backdrop && this.$backdrop.remove()
152
- this.$backdrop = null
153
- }
147
+ Modal.prototype.removeBackdrop = function () {
148
+ this.$backdrop && this.$backdrop.remove()
149
+ this.$backdrop = null
150
+ }
154
151
 
155
- , backdrop: function (callback) {
156
- var that = this
157
- , animate = this.$element.hasClass('fade') ? 'fade' : ''
152
+ Modal.prototype.backdrop = function (callback) {
153
+ var that = this
154
+ var animate = this.$element.hasClass('fade') ? 'fade' : ''
158
155
 
159
- if (this.isShown && this.options.backdrop) {
160
- var doAnimate = $.support.transition && animate
156
+ if (this.isShown && this.options.backdrop) {
157
+ var doAnimate = $.support.transition && animate
161
158
 
162
- this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
163
- .appendTo(document.body)
159
+ this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
160
+ .appendTo(document.body)
164
161
 
165
- this.$backdrop.click(
166
- this.options.backdrop == 'static' ?
167
- $.proxy(this.$element[0].focus, this.$element[0])
168
- : $.proxy(this.hide, this)
169
- )
162
+ this.$backdrop.click(
163
+ this.options.backdrop == 'static' ?
164
+ $.proxy(this.$element[0].focus, this.$element[0])
165
+ : $.proxy(this.hide, this)
166
+ )
170
167
 
171
- if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
168
+ if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
172
169
 
173
- this.$backdrop.addClass('in')
170
+ this.$backdrop.addClass('in')
174
171
 
175
- if (!callback) return
172
+ if (!callback) return
176
173
 
177
- doAnimate ?
178
- this.$backdrop.one($.support.transition.end, callback) :
179
- callback()
174
+ doAnimate ?
175
+ this.$backdrop.one($.support.transition.end, callback) :
176
+ callback()
180
177
 
181
- } else if (!this.isShown && this.$backdrop) {
182
- this.$backdrop.removeClass('in')
178
+ } else if (!this.isShown && this.$backdrop) {
179
+ this.$backdrop.removeClass('in')
183
180
 
184
- $.support.transition && this.$element.hasClass('fade')?
185
- this.$backdrop.one($.support.transition.end, callback) :
186
- callback()
181
+ $.support.transition && this.$element.hasClass('fade')?
182
+ this.$backdrop.one($.support.transition.end, callback) :
183
+ callback()
187
184
 
188
- } else if (callback) {
189
- callback()
190
- }
191
- }
185
+ } else if (callback) {
186
+ callback()
187
+ }
192
188
  }
193
189
 
194
190
 
195
- /* MODAL PLUGIN DEFINITION
196
- * ======================= */
191
+ // MODAL PLUGIN DEFINITION
192
+ // =======================
197
193
 
198
194
  var old = $.fn.modal
199
195
 
200
196
  $.fn.modal = function (option) {
201
197
  return this.each(function () {
202
- var $this = $(this)
203
- , data = $this.data('modal')
204
- , options = $.extend({}, $.fn.modal.defaults, $this.data(), typeof option == 'object' && option)
205
- if (!data) $this.data('modal', (data = new Modal(this, options)))
198
+ var $this = $(this)
199
+ var data = $this.data('bs.modal')
200
+ var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
201
+
202
+ if (!data) $this.data('bs.modal', (data = new Modal(this, options)))
206
203
  if (typeof option == 'string') data[option]()
207
204
  else if (options.show) data.show()
208
205
  })
209
206
  }
210
207
 
211
- $.fn.modal.defaults = {
212
- backdrop: true
213
- , keyboard: true
214
- , show: true
215
- }
216
-
217
208
  $.fn.modal.Constructor = Modal
218
209
 
219
210
 
220
- /* MODAL NO CONFLICT
221
- * ================= */
211
+ // MODAL NO CONFLICT
212
+ // =================
222
213
 
223
214
  $.fn.modal.noConflict = function () {
224
215
  $.fn.modal = old
@@ -226,14 +217,14 @@
226
217
  }
227
218
 
228
219
 
229
- /* MODAL DATA-API
230
- * ============== */
220
+ // MODAL DATA-API
221
+ // ==============
231
222
 
232
- $(document).on('click.modal.data-api', '[data-toggle="modal"]', function (e) {
233
- var $this = $(this)
234
- , href = $this.attr('href')
235
- , $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
236
- , option = $target.data('modal') ? 'toggle' : $.extend({ remote:!/#/.test(href) && href }, $target.data(), $this.data())
223
+ $(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
224
+ var $this = $(this)
225
+ var href = $this.attr('href')
226
+ var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
227
+ var option = $target.data('modal') ? 'toggle' : $.extend({ remote:!/#/.test(href) && href }, $target.data(), $this.data())
237
228
 
238
229
  e.preventDefault()
239
230
 
@@ -242,6 +233,10 @@
242
233
  .one('hide', function () {
243
234
  $this.focus()
244
235
  })
245
- })
236
+ })
237
+
238
+ var $body = $(document.body)
239
+ .on('bs.modal.shown', '.modal', function () { $body.addClass('modal-open') })
240
+ .on('bs.modal.hidden', '.modal', function () { $body.removeClass('modal-open') })
246
241
 
247
242
  }(window.jQuery);
@@ -1,7 +1,7 @@
1
- /* ===========================================================
2
- * bootstrap-popover.js v2.3.1
1
+ /* ========================================================================
2
+ * Bootstrap: popover.js v3.0.0
3
3
  * http://twitter.github.com/bootstrap/javascript.html#popovers
4
- * ===========================================================
4
+ * ========================================================================
5
5
  * Copyright 2012 Twitter, Inc.
6
6
  *
7
7
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,96 +15,91 @@
15
15
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
16
  * See the License for the specific language governing permissions and
17
17
  * limitations under the License.
18
- * =========================================================== */
18
+ * ======================================================================== */
19
19
 
20
20
 
21
- !function ($) {
21
+ +function ($) { "use strict";
22
22
 
23
- "use strict"; // jshint ;_;
24
-
25
-
26
- /* POPOVER PUBLIC CLASS DEFINITION
27
- * =============================== */
23
+ // POPOVER PUBLIC CLASS DEFINITION
24
+ // ===============================
28
25
 
29
26
  var Popover = function (element, options) {
30
27
  this.init('popover', element, options)
31
28
  }
32
29
 
30
+ Popover.DEFAULTS = $.extend({} , $.fn.tooltip.Constructor.DEFAULTS, {
31
+ placement: 'right'
32
+ , trigger: 'click'
33
+ , content: ''
34
+ , template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
35
+ })
33
36
 
34
- /* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js
35
- ========================================== */
36
37
 
37
- Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype, {
38
+ // NOTE: POPOVER EXTENDS tooltip.js
39
+ // ================================
38
40
 
39
- constructor: Popover
41
+ Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype)
40
42
 
41
- , setContent: function () {
42
- var $tip = this.tip()
43
- , title = this.getTitle()
44
- , content = this.getContent()
43
+ Popover.prototype.constructor = Popover
45
44
 
46
- $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
47
- $tip.find('.popover-content')[this.options.html ? 'html' : 'text'](content)
45
+ Popover.prototype.getDefaults = function () {
46
+ return Popover.DEFAULTS
47
+ }
48
48
 
49
- $tip.removeClass('fade top bottom left right in')
50
- }
49
+ Popover.prototype.setContent = function () {
50
+ var $tip = this.tip()
51
+ var title = this.getTitle()
52
+ var content = this.getContent()
51
53
 
52
- , hasContent: function () {
53
- return this.getTitle() || this.getContent()
54
- }
54
+ $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
55
+ $tip.find('.popover-content')[this.options.html ? 'html' : 'text'](content)
55
56
 
56
- , getContent: function () {
57
- var content
58
- , $e = this.$element
59
- , o = this.options
57
+ $tip.removeClass('fade top bottom left right in')
58
+ }
60
59
 
61
- content = (typeof o.content == 'function' ? o.content.call($e[0]) : o.content)
62
- || $e.attr('data-content')
60
+ Popover.prototype.hasContent = function () {
61
+ return this.getTitle() || this.getContent()
62
+ }
63
63
 
64
- return content
65
- }
64
+ Popover.prototype.getContent = function () {
65
+ var content = typeof this.options.content == 'function' ?
66
+ this.options.content.call(this.$element[0]) :
67
+ this.options.content
66
68
 
67
- , tip: function () {
68
- if (!this.$tip) {
69
- this.$tip = $(this.options.template)
70
- }
71
- return this.$tip
72
- }
69
+ return content || this.$element.attr('data-content')
70
+ }
73
71
 
74
- , destroy: function () {
75
- this.hide().$element.off('.' + this.type).removeData(this.type)
76
- }
72
+ Popover.prototype.tip = function () {
73
+ if (!this.$tip) this.$tip = $(this.options.template)
74
+ return this.$tip
75
+ }
77
76
 
78
- })
77
+ Popover.prototype.destroy = function () {
78
+ this.hide().$element.off('.' + this.type).removeData(this.type)
79
+ }
79
80
 
80
81
 
81
- /* POPOVER PLUGIN DEFINITION
82
- * ======================= */
82
+ // POPOVER PLUGIN DEFINITION
83
+ // =========================
83
84
 
84
85
  var old = $.fn.popover
85
86
 
86
87
  $.fn.popover = function (option) {
87
88
  return this.each(function () {
88
- var $this = $(this)
89
- , data = $this.data('popover')
90
- , options = typeof option == 'object' && option
91
- if (!data) $this.data('popover', (data = new Popover(this, options)))
89
+ var $this = $(this)
90
+ var data = $this.data('bs.popover')
91
+ var options = typeof option == 'object' && option
92
+
93
+ if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
92
94
  if (typeof option == 'string') data[option]()
93
95
  })
94
96
  }
95
97
 
96
98
  $.fn.popover.Constructor = Popover
97
99
 
98
- $.fn.popover.defaults = $.extend({} , $.fn.tooltip.defaults, {
99
- placement: 'right'
100
- , trigger: 'click'
101
- , content: ''
102
- , template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
103
- })
104
-
105
100
 
106
- /* POPOVER NO CONFLICT
107
- * =================== */
101
+ // POPOVER NO CONFLICT
102
+ // ===================
108
103
 
109
104
  $.fn.popover.noConflict = function () {
110
105
  $.fn.popover = old