neo4j-meta_model 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (188) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.rdoc +3 -0
  4. data/Rakefile +37 -0
  5. data/app/assets/javascripts/admin/models.js.coffee +25 -0
  6. data/app/assets/javascripts/meta_model.js.coffee +217 -0
  7. data/app/assets/javascripts/router.js.coffee +5 -0
  8. data/app/assets/javascripts/store.js.coffee +12 -0
  9. data/app/assets/javascripts/templates/application.emblem +3 -0
  10. data/app/assets/javascripts/templates/components/model-list-item.emblem +6 -0
  11. data/app/assets/javascripts/templates/components/model-list.emblem +4 -0
  12. data/app/assets/javascripts/templates/has_associations/index.emblem +25 -0
  13. data/app/assets/javascripts/templates/has_associations/new.emblem +50 -0
  14. data/app/assets/javascripts/templates/index.emblem +6 -0
  15. data/app/assets/javascripts/templates/models/edit.emblem +40 -0
  16. data/app/assets/javascripts/templates/models/hierarchy.emblem +8 -0
  17. data/app/assets/stylesheets/meta_model.css.scss +113 -0
  18. data/app/controllers/meta_model/application_controller.rb +12 -0
  19. data/app/controllers/meta_model/meta/has_associations_controller.rb +44 -0
  20. data/app/controllers/meta_model/meta/models_controller.rb +80 -0
  21. data/app/controllers/meta_model/meta/properties_controller.rb +36 -0
  22. data/app/controllers/meta_model/meta_controller.rb +7 -0
  23. data/app/controllers/meta_model/models_controller.rb +69 -0
  24. data/app/helpers/meta_model/application_helper.rb +10 -0
  25. data/app/helpers/meta_model/model_helper.rb +10 -0
  26. data/app/models/concerns/meta_model/model_base.rb +43 -0
  27. data/app/models/meta_model/has_association.rb +46 -0
  28. data/app/models/meta_model/meta_model_base.rb +7 -0
  29. data/app/models/meta_model/model.rb +51 -0
  30. data/app/models/meta_model/property.rb +11 -0
  31. data/app/serializers/meta_model/has_association_serializer.rb +13 -0
  32. data/app/serializers/meta_model/model_serializer.rb +11 -0
  33. data/app/serializers/meta_model/property_serializer.rb +6 -0
  34. data/app/views/layouts/meta_model.html.slim +28 -0
  35. data/app/views/meta_model/meta/associations/index.html.slim +12 -0
  36. data/app/views/meta_model/meta/index.html.slim +2 -0
  37. data/app/views/meta_model/meta/models/edit.html.slim +39 -0
  38. data/app/views/meta_model/models/_form.html.slim +72 -0
  39. data/app/views/meta_model/models/_has_many_association.html.slim +4 -0
  40. data/app/views/meta_model/models/_record_details.html.slim +13 -0
  41. data/app/views/meta_model/models/edit.html.slim +6 -0
  42. data/app/views/meta_model/models/index.html.slim +14 -0
  43. data/app/views/meta_model/models/meta_index.html.slim +6 -0
  44. data/app/views/meta_model/models/new.html.slim +7 -0
  45. data/app/views/meta_model/models/show.html.slim +18 -0
  46. data/config/initializers/active_model_serializer.rb +6 -0
  47. data/config/routes.rb +19 -0
  48. data/lib/ext/hash.rb +7 -0
  49. data/lib/meta_model/engine.rb +23 -0
  50. data/lib/meta_model/version.rb +3 -0
  51. data/lib/meta_model.rb +4 -0
  52. data/lib/meta_models.rb +70 -0
  53. data/lib/tasks/meta_model_tasks.rake +4 -0
  54. data/test/dummy/README.rdoc +28 -0
  55. data/test/dummy/Rakefile +6 -0
  56. data/test/dummy/app/assets/javascripts/application.js +14 -0
  57. data/test/dummy/app/assets/stylesheets/meta_model.css.scss +55 -0
  58. data/test/dummy/app/controllers/meta_model/application_controller.rb +8 -0
  59. data/test/dummy/app/helpers/application_helper.rb +2 -0
  60. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  61. data/test/dummy/bin/bundle +3 -0
  62. data/test/dummy/bin/rails +4 -0
  63. data/test/dummy/bin/rake +4 -0
  64. data/test/dummy/bin/setup +29 -0
  65. data/test/dummy/config/application.rb +29 -0
  66. data/test/dummy/config/boot.rb +5 -0
  67. data/test/dummy/config/database.yml +25 -0
  68. data/test/dummy/config/environment.rb +5 -0
  69. data/test/dummy/config/environments/development.rb +41 -0
  70. data/test/dummy/config/environments/production.rb +79 -0
  71. data/test/dummy/config/environments/test.rb +42 -0
  72. data/test/dummy/config/initializers/assets.rb +11 -0
  73. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  74. data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
  75. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  76. data/test/dummy/config/initializers/inflections.rb +16 -0
  77. data/test/dummy/config/initializers/mime_types.rb +4 -0
  78. data/test/dummy/config/initializers/session_store.rb +3 -0
  79. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  80. data/test/dummy/config/locales/en.yml +23 -0
  81. data/test/dummy/config/routes.rb +21 -0
  82. data/test/dummy/config/secrets.yml +22 -0
  83. data/test/dummy/config.ru +4 -0
  84. data/test/dummy/public/404.html +67 -0
  85. data/test/dummy/public/422.html +67 -0
  86. data/test/dummy/public/500.html +66 -0
  87. data/test/dummy/public/favicon.ico +0 -0
  88. data/test/integration/navigation_test.rb +10 -0
  89. data/test/meta_model_test.rb +7 -0
  90. data/test/test_helper.rb +19 -0
  91. data/vendor/assets/fonts/bootstrap/glyphicons-halflings-regular.eot +0 -0
  92. data/vendor/assets/fonts/bootstrap/glyphicons-halflings-regular.svg +288 -0
  93. data/vendor/assets/fonts/bootstrap/glyphicons-halflings-regular.ttf +0 -0
  94. data/vendor/assets/fonts/bootstrap/glyphicons-halflings-regular.woff +0 -0
  95. data/vendor/assets/fonts/bootstrap/glyphicons-halflings-regular.woff2 +0 -0
  96. data/vendor/assets/javascripts/backbone.js +1608 -0
  97. data/vendor/assets/javascripts/bootstrap/affix.js +162 -0
  98. data/vendor/assets/javascripts/bootstrap/alert.js +94 -0
  99. data/vendor/assets/javascripts/bootstrap/button.js +116 -0
  100. data/vendor/assets/javascripts/bootstrap/carousel.js +240 -0
  101. data/vendor/assets/javascripts/bootstrap/collapse.js +211 -0
  102. data/vendor/assets/javascripts/bootstrap/dropdown.js +161 -0
  103. data/vendor/assets/javascripts/bootstrap/modal.js +324 -0
  104. data/vendor/assets/javascripts/bootstrap/popover.js +119 -0
  105. data/vendor/assets/javascripts/bootstrap/scrollspy.js +175 -0
  106. data/vendor/assets/javascripts/bootstrap/tab.js +153 -0
  107. data/vendor/assets/javascripts/bootstrap/tooltip.js +478 -0
  108. data/vendor/assets/javascripts/bootstrap/transition.js +59 -0
  109. data/vendor/assets/javascripts/bootstrap-sprockets.js +12 -0
  110. data/vendor/assets/javascripts/bootstrap.js +2304 -0
  111. data/vendor/assets/javascripts/lodash.js +6785 -0
  112. data/vendor/assets/javascripts/rivets-backbone.js +97 -0
  113. data/vendor/assets/javascripts/rivets.js +1273 -0
  114. data/vendor/assets/javascripts/sightglass.js +203 -0
  115. data/vendor/assets/stylesheets/_bootstrap-compass.scss +7 -0
  116. data/vendor/assets/stylesheets/_bootstrap-mincer.scss +17 -0
  117. data/vendor/assets/stylesheets/_bootstrap-sprockets.scss +7 -0
  118. data/vendor/assets/stylesheets/_bootstrap.scss +50 -0
  119. data/vendor/assets/stylesheets/bootstrap/_alerts.scss +68 -0
  120. data/vendor/assets/stylesheets/bootstrap/_badges.scss +63 -0
  121. data/vendor/assets/stylesheets/bootstrap/_breadcrumbs.scss +26 -0
  122. data/vendor/assets/stylesheets/bootstrap/_button-groups.scss +243 -0
  123. data/vendor/assets/stylesheets/bootstrap/_buttons.scss +160 -0
  124. data/vendor/assets/stylesheets/bootstrap/_carousel.scss +267 -0
  125. data/vendor/assets/stylesheets/bootstrap/_close.scss +35 -0
  126. data/vendor/assets/stylesheets/bootstrap/_code.scss +69 -0
  127. data/vendor/assets/stylesheets/bootstrap/_component-animations.scss +38 -0
  128. data/vendor/assets/stylesheets/bootstrap/_dropdowns.scss +213 -0
  129. data/vendor/assets/stylesheets/bootstrap/_forms.scss +548 -0
  130. data/vendor/assets/stylesheets/bootstrap/_glyphicons.scss +236 -0
  131. data/vendor/assets/stylesheets/bootstrap/_grid.scss +84 -0
  132. data/vendor/assets/stylesheets/bootstrap/_input-groups.scss +166 -0
  133. data/vendor/assets/stylesheets/bootstrap/_jumbotron.scss +49 -0
  134. data/vendor/assets/stylesheets/bootstrap/_labels.scss +66 -0
  135. data/vendor/assets/stylesheets/bootstrap/_list-group.scss +124 -0
  136. data/vendor/assets/stylesheets/bootstrap/_media.scss +47 -0
  137. data/vendor/assets/stylesheets/bootstrap/_mixins.scss +39 -0
  138. data/vendor/assets/stylesheets/bootstrap/_modals.scss +148 -0
  139. data/vendor/assets/stylesheets/bootstrap/_navbar.scss +662 -0
  140. data/vendor/assets/stylesheets/bootstrap/_navs.scss +244 -0
  141. data/vendor/assets/stylesheets/bootstrap/_normalize.scss +427 -0
  142. data/vendor/assets/stylesheets/bootstrap/_pager.scss +54 -0
  143. data/vendor/assets/stylesheets/bootstrap/_pagination.scss +88 -0
  144. data/vendor/assets/stylesheets/bootstrap/_panels.scss +261 -0
  145. data/vendor/assets/stylesheets/bootstrap/_popovers.scss +135 -0
  146. data/vendor/assets/stylesheets/bootstrap/_print.scss +107 -0
  147. data/vendor/assets/stylesheets/bootstrap/_progress-bars.scss +87 -0
  148. data/vendor/assets/stylesheets/bootstrap/_responsive-embed.scss +35 -0
  149. data/vendor/assets/stylesheets/bootstrap/_responsive-utilities.scss +174 -0
  150. data/vendor/assets/stylesheets/bootstrap/_scaffolding.scss +150 -0
  151. data/vendor/assets/stylesheets/bootstrap/_tables.scss +234 -0
  152. data/vendor/assets/stylesheets/bootstrap/_theme.scss +272 -0
  153. data/vendor/assets/stylesheets/bootstrap/_thumbnails.scss +38 -0
  154. data/vendor/assets/stylesheets/bootstrap/_tooltip.scss +103 -0
  155. data/vendor/assets/stylesheets/bootstrap/_type.scss +298 -0
  156. data/vendor/assets/stylesheets/bootstrap/_utilities.scss +56 -0
  157. data/vendor/assets/stylesheets/bootstrap/_variables.scss +864 -0
  158. data/vendor/assets/stylesheets/bootstrap/_wells.scss +29 -0
  159. data/vendor/assets/stylesheets/bootstrap/mixins/_alerts.scss +14 -0
  160. data/vendor/assets/stylesheets/bootstrap/mixins/_background-variant.scss +11 -0
  161. data/vendor/assets/stylesheets/bootstrap/mixins/_border-radius.scss +18 -0
  162. data/vendor/assets/stylesheets/bootstrap/mixins/_buttons.scss +52 -0
  163. data/vendor/assets/stylesheets/bootstrap/mixins/_center-block.scss +7 -0
  164. data/vendor/assets/stylesheets/bootstrap/mixins/_clearfix.scss +22 -0
  165. data/vendor/assets/stylesheets/bootstrap/mixins/_forms.scss +88 -0
  166. data/vendor/assets/stylesheets/bootstrap/mixins/_gradients.scss +58 -0
  167. data/vendor/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +81 -0
  168. data/vendor/assets/stylesheets/bootstrap/mixins/_grid.scss +122 -0
  169. data/vendor/assets/stylesheets/bootstrap/mixins/_hide-text.scss +21 -0
  170. data/vendor/assets/stylesheets/bootstrap/mixins/_image.scss +33 -0
  171. data/vendor/assets/stylesheets/bootstrap/mixins/_labels.scss +12 -0
  172. data/vendor/assets/stylesheets/bootstrap/mixins/_list-group.scss +31 -0
  173. data/vendor/assets/stylesheets/bootstrap/mixins/_nav-divider.scss +10 -0
  174. data/vendor/assets/stylesheets/bootstrap/mixins/_nav-vertical-align.scss +9 -0
  175. data/vendor/assets/stylesheets/bootstrap/mixins/_opacity.scss +8 -0
  176. data/vendor/assets/stylesheets/bootstrap/mixins/_pagination.scss +23 -0
  177. data/vendor/assets/stylesheets/bootstrap/mixins/_panels.scss +24 -0
  178. data/vendor/assets/stylesheets/bootstrap/mixins/_progress-bar.scss +10 -0
  179. data/vendor/assets/stylesheets/bootstrap/mixins/_reset-filter.scss +8 -0
  180. data/vendor/assets/stylesheets/bootstrap/mixins/_resize.scss +6 -0
  181. data/vendor/assets/stylesheets/bootstrap/mixins/_responsive-visibility.scss +21 -0
  182. data/vendor/assets/stylesheets/bootstrap/mixins/_size.scss +10 -0
  183. data/vendor/assets/stylesheets/bootstrap/mixins/_tab-focus.scss +9 -0
  184. data/vendor/assets/stylesheets/bootstrap/mixins/_table-row.scss +28 -0
  185. data/vendor/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +11 -0
  186. data/vendor/assets/stylesheets/bootstrap/mixins/_text-overflow.scss +8 -0
  187. data/vendor/assets/stylesheets/bootstrap/mixins/_vendor-prefixes.scss +222 -0
  188. metadata +365 -0
@@ -0,0 +1,2304 @@
1
+ /* ========================================================================
2
+ * Bootstrap: affix.js v3.3.1
3
+ * http://getbootstrap.com/javascript/#affix
4
+ * ========================================================================
5
+ * Copyright 2011-2014 Twitter, Inc.
6
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
7
+ * ======================================================================== */
8
+
9
+
10
+ +function ($) {
11
+ 'use strict';
12
+
13
+ // AFFIX CLASS DEFINITION
14
+ // ======================
15
+
16
+ var Affix = function (element, options) {
17
+ this.options = $.extend({}, Affix.DEFAULTS, options)
18
+
19
+ this.$target = $(this.options.target)
20
+ .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))
21
+ .on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this))
22
+
23
+ this.$element = $(element)
24
+ this.affixed =
25
+ this.unpin =
26
+ this.pinnedOffset = null
27
+
28
+ this.checkPosition()
29
+ }
30
+
31
+ Affix.VERSION = '3.3.1'
32
+
33
+ Affix.RESET = 'affix affix-top affix-bottom'
34
+
35
+ Affix.DEFAULTS = {
36
+ offset: 0,
37
+ target: window
38
+ }
39
+
40
+ Affix.prototype.getState = function (scrollHeight, height, offsetTop, offsetBottom) {
41
+ var scrollTop = this.$target.scrollTop()
42
+ var position = this.$element.offset()
43
+ var targetHeight = this.$target.height()
44
+
45
+ if (offsetTop != null && this.affixed == 'top') return scrollTop < offsetTop ? 'top' : false
46
+
47
+ if (this.affixed == 'bottom') {
48
+ if (offsetTop != null) return (scrollTop + this.unpin <= position.top) ? false : 'bottom'
49
+ return (scrollTop + targetHeight <= scrollHeight - offsetBottom) ? false : 'bottom'
50
+ }
51
+
52
+ var initializing = this.affixed == null
53
+ var colliderTop = initializing ? scrollTop : position.top
54
+ var colliderHeight = initializing ? targetHeight : height
55
+
56
+ if (offsetTop != null && colliderTop <= offsetTop) return 'top'
57
+ if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom'
58
+
59
+ return false
60
+ }
61
+
62
+ Affix.prototype.getPinnedOffset = function () {
63
+ if (this.pinnedOffset) return this.pinnedOffset
64
+ this.$element.removeClass(Affix.RESET).addClass('affix')
65
+ var scrollTop = this.$target.scrollTop()
66
+ var position = this.$element.offset()
67
+ return (this.pinnedOffset = position.top - scrollTop)
68
+ }
69
+
70
+ Affix.prototype.checkPositionWithEventLoop = function () {
71
+ setTimeout($.proxy(this.checkPosition, this), 1)
72
+ }
73
+
74
+ Affix.prototype.checkPosition = function () {
75
+ if (!this.$element.is(':visible')) return
76
+
77
+ var height = this.$element.height()
78
+ var offset = this.options.offset
79
+ var offsetTop = offset.top
80
+ var offsetBottom = offset.bottom
81
+ var scrollHeight = $('body').height()
82
+
83
+ if (typeof offset != 'object') offsetBottom = offsetTop = offset
84
+ if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element)
85
+ if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element)
86
+
87
+ var affix = this.getState(scrollHeight, height, offsetTop, offsetBottom)
88
+
89
+ if (this.affixed != affix) {
90
+ if (this.unpin != null) this.$element.css('top', '')
91
+
92
+ var affixType = 'affix' + (affix ? '-' + affix : '')
93
+ var e = $.Event(affixType + '.bs.affix')
94
+
95
+ this.$element.trigger(e)
96
+
97
+ if (e.isDefaultPrevented()) return
98
+
99
+ this.affixed = affix
100
+ this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null
101
+
102
+ this.$element
103
+ .removeClass(Affix.RESET)
104
+ .addClass(affixType)
105
+ .trigger(affixType.replace('affix', 'affixed') + '.bs.affix')
106
+ }
107
+
108
+ if (affix == 'bottom') {
109
+ this.$element.offset({
110
+ top: scrollHeight - height - offsetBottom
111
+ })
112
+ }
113
+ }
114
+
115
+
116
+ // AFFIX PLUGIN DEFINITION
117
+ // =======================
118
+
119
+ function Plugin(option) {
120
+ return this.each(function () {
121
+ var $this = $(this)
122
+ var data = $this.data('bs.affix')
123
+ var options = typeof option == 'object' && option
124
+
125
+ if (!data) $this.data('bs.affix', (data = new Affix(this, options)))
126
+ if (typeof option == 'string') data[option]()
127
+ })
128
+ }
129
+
130
+ var old = $.fn.affix
131
+
132
+ $.fn.affix = Plugin
133
+ $.fn.affix.Constructor = Affix
134
+
135
+
136
+ // AFFIX NO CONFLICT
137
+ // =================
138
+
139
+ $.fn.affix.noConflict = function () {
140
+ $.fn.affix = old
141
+ return this
142
+ }
143
+
144
+
145
+ // AFFIX DATA-API
146
+ // ==============
147
+
148
+ $(window).on('load', function () {
149
+ $('[data-spy="affix"]').each(function () {
150
+ var $spy = $(this)
151
+ var data = $spy.data()
152
+
153
+ data.offset = data.offset || {}
154
+
155
+ if (data.offsetBottom != null) data.offset.bottom = data.offsetBottom
156
+ if (data.offsetTop != null) data.offset.top = data.offsetTop
157
+
158
+ Plugin.call($spy, data)
159
+ })
160
+ })
161
+
162
+ }(jQuery);
163
+
164
+ /* ========================================================================
165
+ * Bootstrap: alert.js v3.3.1
166
+ * http://getbootstrap.com/javascript/#alerts
167
+ * ========================================================================
168
+ * Copyright 2011-2014 Twitter, Inc.
169
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
170
+ * ======================================================================== */
171
+
172
+
173
+ +function ($) {
174
+ 'use strict';
175
+
176
+ // ALERT CLASS DEFINITION
177
+ // ======================
178
+
179
+ var dismiss = '[data-dismiss="alert"]'
180
+ var Alert = function (el) {
181
+ $(el).on('click', dismiss, this.close)
182
+ }
183
+
184
+ Alert.VERSION = '3.3.1'
185
+
186
+ Alert.TRANSITION_DURATION = 150
187
+
188
+ Alert.prototype.close = function (e) {
189
+ var $this = $(this)
190
+ var selector = $this.attr('data-target')
191
+
192
+ if (!selector) {
193
+ selector = $this.attr('href')
194
+ selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
195
+ }
196
+
197
+ var $parent = $(selector)
198
+
199
+ if (e) e.preventDefault()
200
+
201
+ if (!$parent.length) {
202
+ $parent = $this.closest('.alert')
203
+ }
204
+
205
+ $parent.trigger(e = $.Event('close.bs.alert'))
206
+
207
+ if (e.isDefaultPrevented()) return
208
+
209
+ $parent.removeClass('in')
210
+
211
+ function removeElement() {
212
+ // detach from parent, fire event then clean up data
213
+ $parent.detach().trigger('closed.bs.alert').remove()
214
+ }
215
+
216
+ $.support.transition && $parent.hasClass('fade') ?
217
+ $parent
218
+ .one('bsTransitionEnd', removeElement)
219
+ .emulateTransitionEnd(Alert.TRANSITION_DURATION) :
220
+ removeElement()
221
+ }
222
+
223
+
224
+ // ALERT PLUGIN DEFINITION
225
+ // =======================
226
+
227
+ function Plugin(option) {
228
+ return this.each(function () {
229
+ var $this = $(this)
230
+ var data = $this.data('bs.alert')
231
+
232
+ if (!data) $this.data('bs.alert', (data = new Alert(this)))
233
+ if (typeof option == 'string') data[option].call($this)
234
+ })
235
+ }
236
+
237
+ var old = $.fn.alert
238
+
239
+ $.fn.alert = Plugin
240
+ $.fn.alert.Constructor = Alert
241
+
242
+
243
+ // ALERT NO CONFLICT
244
+ // =================
245
+
246
+ $.fn.alert.noConflict = function () {
247
+ $.fn.alert = old
248
+ return this
249
+ }
250
+
251
+
252
+ // ALERT DATA-API
253
+ // ==============
254
+
255
+ $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close)
256
+
257
+ }(jQuery);
258
+
259
+ /* ========================================================================
260
+ * Bootstrap: button.js v3.3.1
261
+ * http://getbootstrap.com/javascript/#buttons
262
+ * ========================================================================
263
+ * Copyright 2011-2014 Twitter, Inc.
264
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
265
+ * ======================================================================== */
266
+
267
+
268
+ +function ($) {
269
+ 'use strict';
270
+
271
+ // BUTTON PUBLIC CLASS DEFINITION
272
+ // ==============================
273
+
274
+ var Button = function (element, options) {
275
+ this.$element = $(element)
276
+ this.options = $.extend({}, Button.DEFAULTS, options)
277
+ this.isLoading = false
278
+ }
279
+
280
+ Button.VERSION = '3.3.1'
281
+
282
+ Button.DEFAULTS = {
283
+ loadingText: 'loading...'
284
+ }
285
+
286
+ Button.prototype.setState = function (state) {
287
+ var d = 'disabled'
288
+ var $el = this.$element
289
+ var val = $el.is('input') ? 'val' : 'html'
290
+ var data = $el.data()
291
+
292
+ state = state + 'Text'
293
+
294
+ if (data.resetText == null) $el.data('resetText', $el[val]())
295
+
296
+ // push to event loop to allow forms to submit
297
+ setTimeout($.proxy(function () {
298
+ $el[val](data[state] == null ? this.options[state] : data[state])
299
+
300
+ if (state == 'loadingText') {
301
+ this.isLoading = true
302
+ $el.addClass(d).attr(d, d)
303
+ } else if (this.isLoading) {
304
+ this.isLoading = false
305
+ $el.removeClass(d).removeAttr(d)
306
+ }
307
+ }, this), 0)
308
+ }
309
+
310
+ Button.prototype.toggle = function () {
311
+ var changed = true
312
+ var $parent = this.$element.closest('[data-toggle="buttons"]')
313
+
314
+ if ($parent.length) {
315
+ var $input = this.$element.find('input')
316
+ if ($input.prop('type') == 'radio') {
317
+ if ($input.prop('checked') && this.$element.hasClass('active')) changed = false
318
+ else $parent.find('.active').removeClass('active')
319
+ }
320
+ if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change')
321
+ } else {
322
+ this.$element.attr('aria-pressed', !this.$element.hasClass('active'))
323
+ }
324
+
325
+ if (changed) this.$element.toggleClass('active')
326
+ }
327
+
328
+
329
+ // BUTTON PLUGIN DEFINITION
330
+ // ========================
331
+
332
+ function Plugin(option) {
333
+ return this.each(function () {
334
+ var $this = $(this)
335
+ var data = $this.data('bs.button')
336
+ var options = typeof option == 'object' && option
337
+
338
+ if (!data) $this.data('bs.button', (data = new Button(this, options)))
339
+
340
+ if (option == 'toggle') data.toggle()
341
+ else if (option) data.setState(option)
342
+ })
343
+ }
344
+
345
+ var old = $.fn.button
346
+
347
+ $.fn.button = Plugin
348
+ $.fn.button.Constructor = Button
349
+
350
+
351
+ // BUTTON NO CONFLICT
352
+ // ==================
353
+
354
+ $.fn.button.noConflict = function () {
355
+ $.fn.button = old
356
+ return this
357
+ }
358
+
359
+
360
+ // BUTTON DATA-API
361
+ // ===============
362
+
363
+ $(document)
364
+ .on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) {
365
+ var $btn = $(e.target)
366
+ if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
367
+ Plugin.call($btn, 'toggle')
368
+ e.preventDefault()
369
+ })
370
+ .on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^="button"]', function (e) {
371
+ $(e.target).closest('.btn').toggleClass('focus', /^focus(in)?$/.test(e.type))
372
+ })
373
+
374
+ }(jQuery);
375
+
376
+ /* ========================================================================
377
+ * Bootstrap: carousel.js v3.3.1
378
+ * http://getbootstrap.com/javascript/#carousel
379
+ * ========================================================================
380
+ * Copyright 2011-2014 Twitter, Inc.
381
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
382
+ * ======================================================================== */
383
+
384
+
385
+ +function ($) {
386
+ 'use strict';
387
+
388
+ // CAROUSEL CLASS DEFINITION
389
+ // =========================
390
+
391
+ var Carousel = function (element, options) {
392
+ this.$element = $(element)
393
+ this.$indicators = this.$element.find('.carousel-indicators')
394
+ this.options = options
395
+ this.paused =
396
+ this.sliding =
397
+ this.interval =
398
+ this.$active =
399
+ this.$items = null
400
+
401
+ this.options.keyboard && this.$element.on('keydown.bs.carousel', $.proxy(this.keydown, this))
402
+
403
+ this.options.pause == 'hover' && !('ontouchstart' in document.documentElement) && this.$element
404
+ .on('mouseenter.bs.carousel', $.proxy(this.pause, this))
405
+ .on('mouseleave.bs.carousel', $.proxy(this.cycle, this))
406
+ }
407
+
408
+ Carousel.VERSION = '3.3.1'
409
+
410
+ Carousel.TRANSITION_DURATION = 600
411
+
412
+ Carousel.DEFAULTS = {
413
+ interval: 5000,
414
+ pause: 'hover',
415
+ wrap: true,
416
+ keyboard: true
417
+ }
418
+
419
+ Carousel.prototype.keydown = function (e) {
420
+ if (/input|textarea/i.test(e.target.tagName)) return
421
+ switch (e.which) {
422
+ case 37: this.prev(); break
423
+ case 39: this.next(); break
424
+ default: return
425
+ }
426
+
427
+ e.preventDefault()
428
+ }
429
+
430
+ Carousel.prototype.cycle = function (e) {
431
+ e || (this.paused = false)
432
+
433
+ this.interval && clearInterval(this.interval)
434
+
435
+ this.options.interval
436
+ && !this.paused
437
+ && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
438
+
439
+ return this
440
+ }
441
+
442
+ Carousel.prototype.getItemIndex = function (item) {
443
+ this.$items = item.parent().children('.item')
444
+ return this.$items.index(item || this.$active)
445
+ }
446
+
447
+ Carousel.prototype.getItemForDirection = function (direction, active) {
448
+ var delta = direction == 'prev' ? -1 : 1
449
+ var activeIndex = this.getItemIndex(active)
450
+ var itemIndex = (activeIndex + delta) % this.$items.length
451
+ return this.$items.eq(itemIndex)
452
+ }
453
+
454
+ Carousel.prototype.to = function (pos) {
455
+ var that = this
456
+ var activeIndex = this.getItemIndex(this.$active = this.$element.find('.item.active'))
457
+
458
+ if (pos > (this.$items.length - 1) || pos < 0) return
459
+
460
+ if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) // yes, "slid"
461
+ if (activeIndex == pos) return this.pause().cycle()
462
+
463
+ return this.slide(pos > activeIndex ? 'next' : 'prev', this.$items.eq(pos))
464
+ }
465
+
466
+ Carousel.prototype.pause = function (e) {
467
+ e || (this.paused = true)
468
+
469
+ if (this.$element.find('.next, .prev').length && $.support.transition) {
470
+ this.$element.trigger($.support.transition.end)
471
+ this.cycle(true)
472
+ }
473
+
474
+ this.interval = clearInterval(this.interval)
475
+
476
+ return this
477
+ }
478
+
479
+ Carousel.prototype.next = function () {
480
+ if (this.sliding) return
481
+ return this.slide('next')
482
+ }
483
+
484
+ Carousel.prototype.prev = function () {
485
+ if (this.sliding) return
486
+ return this.slide('prev')
487
+ }
488
+
489
+ Carousel.prototype.slide = function (type, next) {
490
+ var $active = this.$element.find('.item.active')
491
+ var $next = next || this.getItemForDirection(type, $active)
492
+ var isCycling = this.interval
493
+ var direction = type == 'next' ? 'left' : 'right'
494
+ var fallback = type == 'next' ? 'first' : 'last'
495
+ var that = this
496
+
497
+ if (!$next.length) {
498
+ if (!this.options.wrap) return
499
+ $next = this.$element.find('.item')[fallback]()
500
+ }
501
+
502
+ if ($next.hasClass('active')) return (this.sliding = false)
503
+
504
+ var relatedTarget = $next[0]
505
+ var slideEvent = $.Event('slide.bs.carousel', {
506
+ relatedTarget: relatedTarget,
507
+ direction: direction
508
+ })
509
+ this.$element.trigger(slideEvent)
510
+ if (slideEvent.isDefaultPrevented()) return
511
+
512
+ this.sliding = true
513
+
514
+ isCycling && this.pause()
515
+
516
+ if (this.$indicators.length) {
517
+ this.$indicators.find('.active').removeClass('active')
518
+ var $nextIndicator = $(this.$indicators.children()[this.getItemIndex($next)])
519
+ $nextIndicator && $nextIndicator.addClass('active')
520
+ }
521
+
522
+ var slidEvent = $.Event('slid.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) // yes, "slid"
523
+ if ($.support.transition && this.$element.hasClass('slide')) {
524
+ $next.addClass(type)
525
+ $next[0].offsetWidth // force reflow
526
+ $active.addClass(direction)
527
+ $next.addClass(direction)
528
+ $active
529
+ .one('bsTransitionEnd', function () {
530
+ $next.removeClass([type, direction].join(' ')).addClass('active')
531
+ $active.removeClass(['active', direction].join(' '))
532
+ that.sliding = false
533
+ setTimeout(function () {
534
+ that.$element.trigger(slidEvent)
535
+ }, 0)
536
+ })
537
+ .emulateTransitionEnd(Carousel.TRANSITION_DURATION)
538
+ } else {
539
+ $active.removeClass('active')
540
+ $next.addClass('active')
541
+ this.sliding = false
542
+ this.$element.trigger(slidEvent)
543
+ }
544
+
545
+ isCycling && this.cycle()
546
+
547
+ return this
548
+ }
549
+
550
+
551
+ // CAROUSEL PLUGIN DEFINITION
552
+ // ==========================
553
+
554
+ function Plugin(option) {
555
+ return this.each(function () {
556
+ var $this = $(this)
557
+ var data = $this.data('bs.carousel')
558
+ var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option)
559
+ var action = typeof option == 'string' ? option : options.slide
560
+
561
+ if (!data) $this.data('bs.carousel', (data = new Carousel(this, options)))
562
+ if (typeof option == 'number') data.to(option)
563
+ else if (action) data[action]()
564
+ else if (options.interval) data.pause().cycle()
565
+ })
566
+ }
567
+
568
+ var old = $.fn.carousel
569
+
570
+ $.fn.carousel = Plugin
571
+ $.fn.carousel.Constructor = Carousel
572
+
573
+
574
+ // CAROUSEL NO CONFLICT
575
+ // ====================
576
+
577
+ $.fn.carousel.noConflict = function () {
578
+ $.fn.carousel = old
579
+ return this
580
+ }
581
+
582
+
583
+ // CAROUSEL DATA-API
584
+ // =================
585
+
586
+ var clickHandler = function (e) {
587
+ var href
588
+ var $this = $(this)
589
+ var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7
590
+ if (!$target.hasClass('carousel')) return
591
+ var options = $.extend({}, $target.data(), $this.data())
592
+ var slideIndex = $this.attr('data-slide-to')
593
+ if (slideIndex) options.interval = false
594
+
595
+ Plugin.call($target, options)
596
+
597
+ if (slideIndex) {
598
+ $target.data('bs.carousel').to(slideIndex)
599
+ }
600
+
601
+ e.preventDefault()
602
+ }
603
+
604
+ $(document)
605
+ .on('click.bs.carousel.data-api', '[data-slide]', clickHandler)
606
+ .on('click.bs.carousel.data-api', '[data-slide-to]', clickHandler)
607
+
608
+ $(window).on('load', function () {
609
+ $('[data-ride="carousel"]').each(function () {
610
+ var $carousel = $(this)
611
+ Plugin.call($carousel, $carousel.data())
612
+ })
613
+ })
614
+
615
+ }(jQuery);
616
+
617
+ /* ========================================================================
618
+ * Bootstrap: collapse.js v3.3.1
619
+ * http://getbootstrap.com/javascript/#collapse
620
+ * ========================================================================
621
+ * Copyright 2011-2014 Twitter, Inc.
622
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
623
+ * ======================================================================== */
624
+
625
+
626
+ +function ($) {
627
+ 'use strict';
628
+
629
+ // COLLAPSE PUBLIC CLASS DEFINITION
630
+ // ================================
631
+
632
+ var Collapse = function (element, options) {
633
+ this.$element = $(element)
634
+ this.options = $.extend({}, Collapse.DEFAULTS, options)
635
+ this.$trigger = $(this.options.trigger).filter('[href="#' + element.id + '"], [data-target="#' + element.id + '"]')
636
+ this.transitioning = null
637
+
638
+ if (this.options.parent) {
639
+ this.$parent = this.getParent()
640
+ } else {
641
+ this.addAriaAndCollapsedClass(this.$element, this.$trigger)
642
+ }
643
+
644
+ if (this.options.toggle) this.toggle()
645
+ }
646
+
647
+ Collapse.VERSION = '3.3.1'
648
+
649
+ Collapse.TRANSITION_DURATION = 350
650
+
651
+ Collapse.DEFAULTS = {
652
+ toggle: true,
653
+ trigger: '[data-toggle="collapse"]'
654
+ }
655
+
656
+ Collapse.prototype.dimension = function () {
657
+ var hasWidth = this.$element.hasClass('width')
658
+ return hasWidth ? 'width' : 'height'
659
+ }
660
+
661
+ Collapse.prototype.show = function () {
662
+ if (this.transitioning || this.$element.hasClass('in')) return
663
+
664
+ var activesData
665
+ var actives = this.$parent && this.$parent.find('> .panel').children('.in, .collapsing')
666
+
667
+ if (actives && actives.length) {
668
+ activesData = actives.data('bs.collapse')
669
+ if (activesData && activesData.transitioning) return
670
+ }
671
+
672
+ var startEvent = $.Event('show.bs.collapse')
673
+ this.$element.trigger(startEvent)
674
+ if (startEvent.isDefaultPrevented()) return
675
+
676
+ if (actives && actives.length) {
677
+ Plugin.call(actives, 'hide')
678
+ activesData || actives.data('bs.collapse', null)
679
+ }
680
+
681
+ var dimension = this.dimension()
682
+
683
+ this.$element
684
+ .removeClass('collapse')
685
+ .addClass('collapsing')[dimension](0)
686
+ .attr('aria-expanded', true)
687
+
688
+ this.$trigger
689
+ .removeClass('collapsed')
690
+ .attr('aria-expanded', true)
691
+
692
+ this.transitioning = 1
693
+
694
+ var complete = function () {
695
+ this.$element
696
+ .removeClass('collapsing')
697
+ .addClass('collapse in')[dimension]('')
698
+ this.transitioning = 0
699
+ this.$element
700
+ .trigger('shown.bs.collapse')
701
+ }
702
+
703
+ if (!$.support.transition) return complete.call(this)
704
+
705
+ var scrollSize = $.camelCase(['scroll', dimension].join('-'))
706
+
707
+ this.$element
708
+ .one('bsTransitionEnd', $.proxy(complete, this))
709
+ .emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize])
710
+ }
711
+
712
+ Collapse.prototype.hide = function () {
713
+ if (this.transitioning || !this.$element.hasClass('in')) return
714
+
715
+ var startEvent = $.Event('hide.bs.collapse')
716
+ this.$element.trigger(startEvent)
717
+ if (startEvent.isDefaultPrevented()) return
718
+
719
+ var dimension = this.dimension()
720
+
721
+ this.$element[dimension](this.$element[dimension]())[0].offsetHeight
722
+
723
+ this.$element
724
+ .addClass('collapsing')
725
+ .removeClass('collapse in')
726
+ .attr('aria-expanded', false)
727
+
728
+ this.$trigger
729
+ .addClass('collapsed')
730
+ .attr('aria-expanded', false)
731
+
732
+ this.transitioning = 1
733
+
734
+ var complete = function () {
735
+ this.transitioning = 0
736
+ this.$element
737
+ .removeClass('collapsing')
738
+ .addClass('collapse')
739
+ .trigger('hidden.bs.collapse')
740
+ }
741
+
742
+ if (!$.support.transition) return complete.call(this)
743
+
744
+ this.$element
745
+ [dimension](0)
746
+ .one('bsTransitionEnd', $.proxy(complete, this))
747
+ .emulateTransitionEnd(Collapse.TRANSITION_DURATION)
748
+ }
749
+
750
+ Collapse.prototype.toggle = function () {
751
+ this[this.$element.hasClass('in') ? 'hide' : 'show']()
752
+ }
753
+
754
+ Collapse.prototype.getParent = function () {
755
+ return $(this.options.parent)
756
+ .find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]')
757
+ .each($.proxy(function (i, element) {
758
+ var $element = $(element)
759
+ this.addAriaAndCollapsedClass(getTargetFromTrigger($element), $element)
760
+ }, this))
761
+ .end()
762
+ }
763
+
764
+ Collapse.prototype.addAriaAndCollapsedClass = function ($element, $trigger) {
765
+ var isOpen = $element.hasClass('in')
766
+
767
+ $element.attr('aria-expanded', isOpen)
768
+ $trigger
769
+ .toggleClass('collapsed', !isOpen)
770
+ .attr('aria-expanded', isOpen)
771
+ }
772
+
773
+ function getTargetFromTrigger($trigger) {
774
+ var href
775
+ var target = $trigger.attr('data-target')
776
+ || (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7
777
+
778
+ return $(target)
779
+ }
780
+
781
+
782
+ // COLLAPSE PLUGIN DEFINITION
783
+ // ==========================
784
+
785
+ function Plugin(option) {
786
+ return this.each(function () {
787
+ var $this = $(this)
788
+ var data = $this.data('bs.collapse')
789
+ var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
790
+
791
+ if (!data && options.toggle && option == 'show') options.toggle = false
792
+ if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
793
+ if (typeof option == 'string') data[option]()
794
+ })
795
+ }
796
+
797
+ var old = $.fn.collapse
798
+
799
+ $.fn.collapse = Plugin
800
+ $.fn.collapse.Constructor = Collapse
801
+
802
+
803
+ // COLLAPSE NO CONFLICT
804
+ // ====================
805
+
806
+ $.fn.collapse.noConflict = function () {
807
+ $.fn.collapse = old
808
+ return this
809
+ }
810
+
811
+
812
+ // COLLAPSE DATA-API
813
+ // =================
814
+
815
+ $(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) {
816
+ var $this = $(this)
817
+
818
+ if (!$this.attr('data-target')) e.preventDefault()
819
+
820
+ var $target = getTargetFromTrigger($this)
821
+ var data = $target.data('bs.collapse')
822
+ var option = data ? 'toggle' : $.extend({}, $this.data(), { trigger: this })
823
+
824
+ Plugin.call($target, option)
825
+ })
826
+
827
+ }(jQuery);
828
+
829
+ /* ========================================================================
830
+ * Bootstrap: dropdown.js v3.3.1
831
+ * http://getbootstrap.com/javascript/#dropdowns
832
+ * ========================================================================
833
+ * Copyright 2011-2014 Twitter, Inc.
834
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
835
+ * ======================================================================== */
836
+
837
+
838
+ +function ($) {
839
+ 'use strict';
840
+
841
+ // DROPDOWN CLASS DEFINITION
842
+ // =========================
843
+
844
+ var backdrop = '.dropdown-backdrop'
845
+ var toggle = '[data-toggle="dropdown"]'
846
+ var Dropdown = function (element) {
847
+ $(element).on('click.bs.dropdown', this.toggle)
848
+ }
849
+
850
+ Dropdown.VERSION = '3.3.1'
851
+
852
+ Dropdown.prototype.toggle = function (e) {
853
+ var $this = $(this)
854
+
855
+ if ($this.is('.disabled, :disabled')) return
856
+
857
+ var $parent = getParent($this)
858
+ var isActive = $parent.hasClass('open')
859
+
860
+ clearMenus()
861
+
862
+ if (!isActive) {
863
+ if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
864
+ // if mobile we use a backdrop because click events don't delegate
865
+ $('<div class="dropdown-backdrop"/>').insertAfter($(this)).on('click', clearMenus)
866
+ }
867
+
868
+ var relatedTarget = { relatedTarget: this }
869
+ $parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))
870
+
871
+ if (e.isDefaultPrevented()) return
872
+
873
+ $this
874
+ .trigger('focus')
875
+ .attr('aria-expanded', 'true')
876
+
877
+ $parent
878
+ .toggleClass('open')
879
+ .trigger('shown.bs.dropdown', relatedTarget)
880
+ }
881
+
882
+ return false
883
+ }
884
+
885
+ Dropdown.prototype.keydown = function (e) {
886
+ if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)) return
887
+
888
+ var $this = $(this)
889
+
890
+ e.preventDefault()
891
+ e.stopPropagation()
892
+
893
+ if ($this.is('.disabled, :disabled')) return
894
+
895
+ var $parent = getParent($this)
896
+ var isActive = $parent.hasClass('open')
897
+
898
+ if ((!isActive && e.which != 27) || (isActive && e.which == 27)) {
899
+ if (e.which == 27) $parent.find(toggle).trigger('focus')
900
+ return $this.trigger('click')
901
+ }
902
+
903
+ var desc = ' li:not(.divider):visible a'
904
+ var $items = $parent.find('[role="menu"]' + desc + ', [role="listbox"]' + desc)
905
+
906
+ if (!$items.length) return
907
+
908
+ var index = $items.index(e.target)
909
+
910
+ if (e.which == 38 && index > 0) index-- // up
911
+ if (e.which == 40 && index < $items.length - 1) index++ // down
912
+ if (!~index) index = 0
913
+
914
+ $items.eq(index).trigger('focus')
915
+ }
916
+
917
+ function clearMenus(e) {
918
+ if (e && e.which === 3) return
919
+ $(backdrop).remove()
920
+ $(toggle).each(function () {
921
+ var $this = $(this)
922
+ var $parent = getParent($this)
923
+ var relatedTarget = { relatedTarget: this }
924
+
925
+ if (!$parent.hasClass('open')) return
926
+
927
+ $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
928
+
929
+ if (e.isDefaultPrevented()) return
930
+
931
+ $this.attr('aria-expanded', 'false')
932
+ $parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget)
933
+ })
934
+ }
935
+
936
+ function getParent($this) {
937
+ var selector = $this.attr('data-target')
938
+
939
+ if (!selector) {
940
+ selector = $this.attr('href')
941
+ selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
942
+ }
943
+
944
+ var $parent = selector && $(selector)
945
+
946
+ return $parent && $parent.length ? $parent : $this.parent()
947
+ }
948
+
949
+
950
+ // DROPDOWN PLUGIN DEFINITION
951
+ // ==========================
952
+
953
+ function Plugin(option) {
954
+ return this.each(function () {
955
+ var $this = $(this)
956
+ var data = $this.data('bs.dropdown')
957
+
958
+ if (!data) $this.data('bs.dropdown', (data = new Dropdown(this)))
959
+ if (typeof option == 'string') data[option].call($this)
960
+ })
961
+ }
962
+
963
+ var old = $.fn.dropdown
964
+
965
+ $.fn.dropdown = Plugin
966
+ $.fn.dropdown.Constructor = Dropdown
967
+
968
+
969
+ // DROPDOWN NO CONFLICT
970
+ // ====================
971
+
972
+ $.fn.dropdown.noConflict = function () {
973
+ $.fn.dropdown = old
974
+ return this
975
+ }
976
+
977
+
978
+ // APPLY TO STANDARD DROPDOWN ELEMENTS
979
+ // ===================================
980
+
981
+ $(document)
982
+ .on('click.bs.dropdown.data-api', clearMenus)
983
+ .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
984
+ .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)
985
+ .on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown)
986
+ .on('keydown.bs.dropdown.data-api', '[role="menu"]', Dropdown.prototype.keydown)
987
+ .on('keydown.bs.dropdown.data-api', '[role="listbox"]', Dropdown.prototype.keydown)
988
+
989
+ }(jQuery);
990
+
991
+ /* ========================================================================
992
+ * Bootstrap: tab.js v3.3.1
993
+ * http://getbootstrap.com/javascript/#tabs
994
+ * ========================================================================
995
+ * Copyright 2011-2014 Twitter, Inc.
996
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
997
+ * ======================================================================== */
998
+
999
+
1000
+ +function ($) {
1001
+ 'use strict';
1002
+
1003
+ // TAB CLASS DEFINITION
1004
+ // ====================
1005
+
1006
+ var Tab = function (element) {
1007
+ this.element = $(element)
1008
+ }
1009
+
1010
+ Tab.VERSION = '3.3.1'
1011
+
1012
+ Tab.TRANSITION_DURATION = 150
1013
+
1014
+ Tab.prototype.show = function () {
1015
+ var $this = this.element
1016
+ var $ul = $this.closest('ul:not(.dropdown-menu)')
1017
+ var selector = $this.data('target')
1018
+
1019
+ if (!selector) {
1020
+ selector = $this.attr('href')
1021
+ selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
1022
+ }
1023
+
1024
+ if ($this.parent('li').hasClass('active')) return
1025
+
1026
+ var $previous = $ul.find('.active:last a')
1027
+ var hideEvent = $.Event('hide.bs.tab', {
1028
+ relatedTarget: $this[0]
1029
+ })
1030
+ var showEvent = $.Event('show.bs.tab', {
1031
+ relatedTarget: $previous[0]
1032
+ })
1033
+
1034
+ $previous.trigger(hideEvent)
1035
+ $this.trigger(showEvent)
1036
+
1037
+ if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) return
1038
+
1039
+ var $target = $(selector)
1040
+
1041
+ this.activate($this.closest('li'), $ul)
1042
+ this.activate($target, $target.parent(), function () {
1043
+ $previous.trigger({
1044
+ type: 'hidden.bs.tab',
1045
+ relatedTarget: $this[0]
1046
+ })
1047
+ $this.trigger({
1048
+ type: 'shown.bs.tab',
1049
+ relatedTarget: $previous[0]
1050
+ })
1051
+ })
1052
+ }
1053
+
1054
+ Tab.prototype.activate = function (element, container, callback) {
1055
+ var $active = container.find('> .active')
1056
+ var transition = callback
1057
+ && $.support.transition
1058
+ && (($active.length && $active.hasClass('fade')) || !!container.find('> .fade').length)
1059
+
1060
+ function next() {
1061
+ $active
1062
+ .removeClass('active')
1063
+ .find('> .dropdown-menu > .active')
1064
+ .removeClass('active')
1065
+ .end()
1066
+ .find('[data-toggle="tab"]')
1067
+ .attr('aria-expanded', false)
1068
+
1069
+ element
1070
+ .addClass('active')
1071
+ .find('[data-toggle="tab"]')
1072
+ .attr('aria-expanded', true)
1073
+
1074
+ if (transition) {
1075
+ element[0].offsetWidth // reflow for transition
1076
+ element.addClass('in')
1077
+ } else {
1078
+ element.removeClass('fade')
1079
+ }
1080
+
1081
+ if (element.parent('.dropdown-menu')) {
1082
+ element
1083
+ .closest('li.dropdown')
1084
+ .addClass('active')
1085
+ .end()
1086
+ .find('[data-toggle="tab"]')
1087
+ .attr('aria-expanded', true)
1088
+ }
1089
+
1090
+ callback && callback()
1091
+ }
1092
+
1093
+ $active.length && transition ?
1094
+ $active
1095
+ .one('bsTransitionEnd', next)
1096
+ .emulateTransitionEnd(Tab.TRANSITION_DURATION) :
1097
+ next()
1098
+
1099
+ $active.removeClass('in')
1100
+ }
1101
+
1102
+
1103
+ // TAB PLUGIN DEFINITION
1104
+ // =====================
1105
+
1106
+ function Plugin(option) {
1107
+ return this.each(function () {
1108
+ var $this = $(this)
1109
+ var data = $this.data('bs.tab')
1110
+
1111
+ if (!data) $this.data('bs.tab', (data = new Tab(this)))
1112
+ if (typeof option == 'string') data[option]()
1113
+ })
1114
+ }
1115
+
1116
+ var old = $.fn.tab
1117
+
1118
+ $.fn.tab = Plugin
1119
+ $.fn.tab.Constructor = Tab
1120
+
1121
+
1122
+ // TAB NO CONFLICT
1123
+ // ===============
1124
+
1125
+ $.fn.tab.noConflict = function () {
1126
+ $.fn.tab = old
1127
+ return this
1128
+ }
1129
+
1130
+
1131
+ // TAB DATA-API
1132
+ // ============
1133
+
1134
+ var clickHandler = function (e) {
1135
+ e.preventDefault()
1136
+ Plugin.call($(this), 'show')
1137
+ }
1138
+
1139
+ $(document)
1140
+ .on('click.bs.tab.data-api', '[data-toggle="tab"]', clickHandler)
1141
+ .on('click.bs.tab.data-api', '[data-toggle="pill"]', clickHandler)
1142
+
1143
+ }(jQuery);
1144
+
1145
+ /* ========================================================================
1146
+ * Bootstrap: transition.js v3.3.1
1147
+ * http://getbootstrap.com/javascript/#transitions
1148
+ * ========================================================================
1149
+ * Copyright 2011-2014 Twitter, Inc.
1150
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
1151
+ * ======================================================================== */
1152
+
1153
+
1154
+ +function ($) {
1155
+ 'use strict';
1156
+
1157
+ // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
1158
+ // ============================================================
1159
+
1160
+ function transitionEnd() {
1161
+ var el = document.createElement('bootstrap')
1162
+
1163
+ var transEndEventNames = {
1164
+ WebkitTransition : 'webkitTransitionEnd',
1165
+ MozTransition : 'transitionend',
1166
+ OTransition : 'oTransitionEnd otransitionend',
1167
+ transition : 'transitionend'
1168
+ }
1169
+
1170
+ for (var name in transEndEventNames) {
1171
+ if (el.style[name] !== undefined) {
1172
+ return { end: transEndEventNames[name] }
1173
+ }
1174
+ }
1175
+
1176
+ return false // explicit for ie8 ( ._.)
1177
+ }
1178
+
1179
+ // http://blog.alexmaccaw.com/css-transitions
1180
+ $.fn.emulateTransitionEnd = function (duration) {
1181
+ var called = false
1182
+ var $el = this
1183
+ $(this).one('bsTransitionEnd', function () { called = true })
1184
+ var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
1185
+ setTimeout(callback, duration)
1186
+ return this
1187
+ }
1188
+
1189
+ $(function () {
1190
+ $.support.transition = transitionEnd()
1191
+
1192
+ if (!$.support.transition) return
1193
+
1194
+ $.event.special.bsTransitionEnd = {
1195
+ bindType: $.support.transition.end,
1196
+ delegateType: $.support.transition.end,
1197
+ handle: function (e) {
1198
+ if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments)
1199
+ }
1200
+ }
1201
+ })
1202
+
1203
+ }(jQuery);
1204
+
1205
+ /* ========================================================================
1206
+ * Bootstrap: scrollspy.js v3.3.1
1207
+ * http://getbootstrap.com/javascript/#scrollspy
1208
+ * ========================================================================
1209
+ * Copyright 2011-2014 Twitter, Inc.
1210
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
1211
+ * ======================================================================== */
1212
+
1213
+
1214
+ +function ($) {
1215
+ 'use strict';
1216
+
1217
+ // SCROLLSPY CLASS DEFINITION
1218
+ // ==========================
1219
+
1220
+ function ScrollSpy(element, options) {
1221
+ var process = $.proxy(this.process, this)
1222
+
1223
+ this.$body = $('body')
1224
+ this.$scrollElement = $(element).is('body') ? $(window) : $(element)
1225
+ this.options = $.extend({}, ScrollSpy.DEFAULTS, options)
1226
+ this.selector = (this.options.target || '') + ' .nav li > a'
1227
+ this.offsets = []
1228
+ this.targets = []
1229
+ this.activeTarget = null
1230
+ this.scrollHeight = 0
1231
+
1232
+ this.$scrollElement.on('scroll.bs.scrollspy', process)
1233
+ this.refresh()
1234
+ this.process()
1235
+ }
1236
+
1237
+ ScrollSpy.VERSION = '3.3.1'
1238
+
1239
+ ScrollSpy.DEFAULTS = {
1240
+ offset: 10
1241
+ }
1242
+
1243
+ ScrollSpy.prototype.getScrollHeight = function () {
1244
+ return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight)
1245
+ }
1246
+
1247
+ ScrollSpy.prototype.refresh = function () {
1248
+ var offsetMethod = 'offset'
1249
+ var offsetBase = 0
1250
+
1251
+ if (!$.isWindow(this.$scrollElement[0])) {
1252
+ offsetMethod = 'position'
1253
+ offsetBase = this.$scrollElement.scrollTop()
1254
+ }
1255
+
1256
+ this.offsets = []
1257
+ this.targets = []
1258
+ this.scrollHeight = this.getScrollHeight()
1259
+
1260
+ var self = this
1261
+
1262
+ this.$body
1263
+ .find(this.selector)
1264
+ .map(function () {
1265
+ var $el = $(this)
1266
+ var href = $el.data('target') || $el.attr('href')
1267
+ var $href = /^#./.test(href) && $(href)
1268
+
1269
+ return ($href
1270
+ && $href.length
1271
+ && $href.is(':visible')
1272
+ && [[$href[offsetMethod]().top + offsetBase, href]]) || null
1273
+ })
1274
+ .sort(function (a, b) { return a[0] - b[0] })
1275
+ .each(function () {
1276
+ self.offsets.push(this[0])
1277
+ self.targets.push(this[1])
1278
+ })
1279
+ }
1280
+
1281
+ ScrollSpy.prototype.process = function () {
1282
+ var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
1283
+ var scrollHeight = this.getScrollHeight()
1284
+ var maxScroll = this.options.offset + scrollHeight - this.$scrollElement.height()
1285
+ var offsets = this.offsets
1286
+ var targets = this.targets
1287
+ var activeTarget = this.activeTarget
1288
+ var i
1289
+
1290
+ if (this.scrollHeight != scrollHeight) {
1291
+ this.refresh()
1292
+ }
1293
+
1294
+ if (scrollTop >= maxScroll) {
1295
+ return activeTarget != (i = targets[targets.length - 1]) && this.activate(i)
1296
+ }
1297
+
1298
+ if (activeTarget && scrollTop < offsets[0]) {
1299
+ this.activeTarget = null
1300
+ return this.clear()
1301
+ }
1302
+
1303
+ for (i = offsets.length; i--;) {
1304
+ activeTarget != targets[i]
1305
+ && scrollTop >= offsets[i]
1306
+ && (!offsets[i + 1] || scrollTop <= offsets[i + 1])
1307
+ && this.activate(targets[i])
1308
+ }
1309
+ }
1310
+
1311
+ ScrollSpy.prototype.activate = function (target) {
1312
+ this.activeTarget = target
1313
+
1314
+ this.clear()
1315
+
1316
+ var selector = this.selector +
1317
+ '[data-target="' + target + '"],' +
1318
+ this.selector + '[href="' + target + '"]'
1319
+
1320
+ var active = $(selector)
1321
+ .parents('li')
1322
+ .addClass('active')
1323
+
1324
+ if (active.parent('.dropdown-menu').length) {
1325
+ active = active
1326
+ .closest('li.dropdown')
1327
+ .addClass('active')
1328
+ }
1329
+
1330
+ active.trigger('activate.bs.scrollspy')
1331
+ }
1332
+
1333
+ ScrollSpy.prototype.clear = function () {
1334
+ $(this.selector)
1335
+ .parentsUntil(this.options.target, '.active')
1336
+ .removeClass('active')
1337
+ }
1338
+
1339
+
1340
+ // SCROLLSPY PLUGIN DEFINITION
1341
+ // ===========================
1342
+
1343
+ function Plugin(option) {
1344
+ return this.each(function () {
1345
+ var $this = $(this)
1346
+ var data = $this.data('bs.scrollspy')
1347
+ var options = typeof option == 'object' && option
1348
+
1349
+ if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options)))
1350
+ if (typeof option == 'string') data[option]()
1351
+ })
1352
+ }
1353
+
1354
+ var old = $.fn.scrollspy
1355
+
1356
+ $.fn.scrollspy = Plugin
1357
+ $.fn.scrollspy.Constructor = ScrollSpy
1358
+
1359
+
1360
+ // SCROLLSPY NO CONFLICT
1361
+ // =====================
1362
+
1363
+ $.fn.scrollspy.noConflict = function () {
1364
+ $.fn.scrollspy = old
1365
+ return this
1366
+ }
1367
+
1368
+
1369
+ // SCROLLSPY DATA-API
1370
+ // ==================
1371
+
1372
+ $(window).on('load.bs.scrollspy.data-api', function () {
1373
+ $('[data-spy="scroll"]').each(function () {
1374
+ var $spy = $(this)
1375
+ Plugin.call($spy, $spy.data())
1376
+ })
1377
+ })
1378
+
1379
+ }(jQuery);
1380
+
1381
+ /* ========================================================================
1382
+ * Bootstrap: modal.js v3.3.1
1383
+ * http://getbootstrap.com/javascript/#modals
1384
+ * ========================================================================
1385
+ * Copyright 2011-2014 Twitter, Inc.
1386
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
1387
+ * ======================================================================== */
1388
+
1389
+
1390
+ +function ($) {
1391
+ 'use strict';
1392
+
1393
+ // MODAL CLASS DEFINITION
1394
+ // ======================
1395
+
1396
+ var Modal = function (element, options) {
1397
+ this.options = options
1398
+ this.$body = $(document.body)
1399
+ this.$element = $(element)
1400
+ this.$backdrop =
1401
+ this.isShown = null
1402
+ this.scrollbarWidth = 0
1403
+
1404
+ if (this.options.remote) {
1405
+ this.$element
1406
+ .find('.modal-content')
1407
+ .load(this.options.remote, $.proxy(function () {
1408
+ this.$element.trigger('loaded.bs.modal')
1409
+ }, this))
1410
+ }
1411
+ }
1412
+
1413
+ Modal.VERSION = '3.3.1'
1414
+
1415
+ Modal.TRANSITION_DURATION = 300
1416
+ Modal.BACKDROP_TRANSITION_DURATION = 150
1417
+
1418
+ Modal.DEFAULTS = {
1419
+ backdrop: true,
1420
+ keyboard: true,
1421
+ show: true
1422
+ }
1423
+
1424
+ Modal.prototype.toggle = function (_relatedTarget) {
1425
+ return this.isShown ? this.hide() : this.show(_relatedTarget)
1426
+ }
1427
+
1428
+ Modal.prototype.show = function (_relatedTarget) {
1429
+ var that = this
1430
+ var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
1431
+
1432
+ this.$element.trigger(e)
1433
+
1434
+ if (this.isShown || e.isDefaultPrevented()) return
1435
+
1436
+ this.isShown = true
1437
+
1438
+ this.checkScrollbar()
1439
+ this.setScrollbar()
1440
+ this.$body.addClass('modal-open')
1441
+
1442
+ this.escape()
1443
+ this.resize()
1444
+
1445
+ this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
1446
+
1447
+ this.backdrop(function () {
1448
+ var transition = $.support.transition && that.$element.hasClass('fade')
1449
+
1450
+ if (!that.$element.parent().length) {
1451
+ that.$element.appendTo(that.$body) // don't move modals dom position
1452
+ }
1453
+
1454
+ that.$element
1455
+ .show()
1456
+ .scrollTop(0)
1457
+
1458
+ if (that.options.backdrop) that.adjustBackdrop()
1459
+ that.adjustDialog()
1460
+
1461
+ if (transition) {
1462
+ that.$element[0].offsetWidth // force reflow
1463
+ }
1464
+
1465
+ that.$element
1466
+ .addClass('in')
1467
+ .attr('aria-hidden', false)
1468
+
1469
+ that.enforceFocus()
1470
+
1471
+ var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget })
1472
+
1473
+ transition ?
1474
+ that.$element.find('.modal-dialog') // wait for modal to slide in
1475
+ .one('bsTransitionEnd', function () {
1476
+ that.$element.trigger('focus').trigger(e)
1477
+ })
1478
+ .emulateTransitionEnd(Modal.TRANSITION_DURATION) :
1479
+ that.$element.trigger('focus').trigger(e)
1480
+ })
1481
+ }
1482
+
1483
+ Modal.prototype.hide = function (e) {
1484
+ if (e) e.preventDefault()
1485
+
1486
+ e = $.Event('hide.bs.modal')
1487
+
1488
+ this.$element.trigger(e)
1489
+
1490
+ if (!this.isShown || e.isDefaultPrevented()) return
1491
+
1492
+ this.isShown = false
1493
+
1494
+ this.escape()
1495
+ this.resize()
1496
+
1497
+ $(document).off('focusin.bs.modal')
1498
+
1499
+ this.$element
1500
+ .removeClass('in')
1501
+ .attr('aria-hidden', true)
1502
+ .off('click.dismiss.bs.modal')
1503
+
1504
+ $.support.transition && this.$element.hasClass('fade') ?
1505
+ this.$element
1506
+ .one('bsTransitionEnd', $.proxy(this.hideModal, this))
1507
+ .emulateTransitionEnd(Modal.TRANSITION_DURATION) :
1508
+ this.hideModal()
1509
+ }
1510
+
1511
+ Modal.prototype.enforceFocus = function () {
1512
+ $(document)
1513
+ .off('focusin.bs.modal') // guard against infinite focus loop
1514
+ .on('focusin.bs.modal', $.proxy(function (e) {
1515
+ if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {
1516
+ this.$element.trigger('focus')
1517
+ }
1518
+ }, this))
1519
+ }
1520
+
1521
+ Modal.prototype.escape = function () {
1522
+ if (this.isShown && this.options.keyboard) {
1523
+ this.$element.on('keydown.dismiss.bs.modal', $.proxy(function (e) {
1524
+ e.which == 27 && this.hide()
1525
+ }, this))
1526
+ } else if (!this.isShown) {
1527
+ this.$element.off('keydown.dismiss.bs.modal')
1528
+ }
1529
+ }
1530
+
1531
+ Modal.prototype.resize = function () {
1532
+ if (this.isShown) {
1533
+ $(window).on('resize.bs.modal', $.proxy(this.handleUpdate, this))
1534
+ } else {
1535
+ $(window).off('resize.bs.modal')
1536
+ }
1537
+ }
1538
+
1539
+ Modal.prototype.hideModal = function () {
1540
+ var that = this
1541
+ this.$element.hide()
1542
+ this.backdrop(function () {
1543
+ that.$body.removeClass('modal-open')
1544
+ that.resetAdjustments()
1545
+ that.resetScrollbar()
1546
+ that.$element.trigger('hidden.bs.modal')
1547
+ })
1548
+ }
1549
+
1550
+ Modal.prototype.removeBackdrop = function () {
1551
+ this.$backdrop && this.$backdrop.remove()
1552
+ this.$backdrop = null
1553
+ }
1554
+
1555
+ Modal.prototype.backdrop = function (callback) {
1556
+ var that = this
1557
+ var animate = this.$element.hasClass('fade') ? 'fade' : ''
1558
+
1559
+ if (this.isShown && this.options.backdrop) {
1560
+ var doAnimate = $.support.transition && animate
1561
+
1562
+ this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
1563
+ .prependTo(this.$element)
1564
+ .on('click.dismiss.bs.modal', $.proxy(function (e) {
1565
+ if (e.target !== e.currentTarget) return
1566
+ this.options.backdrop == 'static'
1567
+ ? this.$element[0].focus.call(this.$element[0])
1568
+ : this.hide.call(this)
1569
+ }, this))
1570
+
1571
+ if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
1572
+
1573
+ this.$backdrop.addClass('in')
1574
+
1575
+ if (!callback) return
1576
+
1577
+ doAnimate ?
1578
+ this.$backdrop
1579
+ .one('bsTransitionEnd', callback)
1580
+ .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
1581
+ callback()
1582
+
1583
+ } else if (!this.isShown && this.$backdrop) {
1584
+ this.$backdrop.removeClass('in')
1585
+
1586
+ var callbackRemove = function () {
1587
+ that.removeBackdrop()
1588
+ callback && callback()
1589
+ }
1590
+ $.support.transition && this.$element.hasClass('fade') ?
1591
+ this.$backdrop
1592
+ .one('bsTransitionEnd', callbackRemove)
1593
+ .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
1594
+ callbackRemove()
1595
+
1596
+ } else if (callback) {
1597
+ callback()
1598
+ }
1599
+ }
1600
+
1601
+ // these following methods are used to handle overflowing modals
1602
+
1603
+ Modal.prototype.handleUpdate = function () {
1604
+ if (this.options.backdrop) this.adjustBackdrop()
1605
+ this.adjustDialog()
1606
+ }
1607
+
1608
+ Modal.prototype.adjustBackdrop = function () {
1609
+ this.$backdrop
1610
+ .css('height', 0)
1611
+ .css('height', this.$element[0].scrollHeight)
1612
+ }
1613
+
1614
+ Modal.prototype.adjustDialog = function () {
1615
+ var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight
1616
+
1617
+ this.$element.css({
1618
+ paddingLeft: !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '',
1619
+ paddingRight: this.bodyIsOverflowing && !modalIsOverflowing ? this.scrollbarWidth : ''
1620
+ })
1621
+ }
1622
+
1623
+ Modal.prototype.resetAdjustments = function () {
1624
+ this.$element.css({
1625
+ paddingLeft: '',
1626
+ paddingRight: ''
1627
+ })
1628
+ }
1629
+
1630
+ Modal.prototype.checkScrollbar = function () {
1631
+ this.bodyIsOverflowing = document.body.scrollHeight > document.documentElement.clientHeight
1632
+ this.scrollbarWidth = this.measureScrollbar()
1633
+ }
1634
+
1635
+ Modal.prototype.setScrollbar = function () {
1636
+ var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10)
1637
+ if (this.bodyIsOverflowing) this.$body.css('padding-right', bodyPad + this.scrollbarWidth)
1638
+ }
1639
+
1640
+ Modal.prototype.resetScrollbar = function () {
1641
+ this.$body.css('padding-right', '')
1642
+ }
1643
+
1644
+ Modal.prototype.measureScrollbar = function () { // thx walsh
1645
+ var scrollDiv = document.createElement('div')
1646
+ scrollDiv.className = 'modal-scrollbar-measure'
1647
+ this.$body.append(scrollDiv)
1648
+ var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth
1649
+ this.$body[0].removeChild(scrollDiv)
1650
+ return scrollbarWidth
1651
+ }
1652
+
1653
+
1654
+ // MODAL PLUGIN DEFINITION
1655
+ // =======================
1656
+
1657
+ function Plugin(option, _relatedTarget) {
1658
+ return this.each(function () {
1659
+ var $this = $(this)
1660
+ var data = $this.data('bs.modal')
1661
+ var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
1662
+
1663
+ if (!data) $this.data('bs.modal', (data = new Modal(this, options)))
1664
+ if (typeof option == 'string') data[option](_relatedTarget)
1665
+ else if (options.show) data.show(_relatedTarget)
1666
+ })
1667
+ }
1668
+
1669
+ var old = $.fn.modal
1670
+
1671
+ $.fn.modal = Plugin
1672
+ $.fn.modal.Constructor = Modal
1673
+
1674
+
1675
+ // MODAL NO CONFLICT
1676
+ // =================
1677
+
1678
+ $.fn.modal.noConflict = function () {
1679
+ $.fn.modal = old
1680
+ return this
1681
+ }
1682
+
1683
+
1684
+ // MODAL DATA-API
1685
+ // ==============
1686
+
1687
+ $(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
1688
+ var $this = $(this)
1689
+ var href = $this.attr('href')
1690
+ var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) // strip for ie7
1691
+ var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
1692
+
1693
+ if ($this.is('a')) e.preventDefault()
1694
+
1695
+ $target.one('show.bs.modal', function (showEvent) {
1696
+ if (showEvent.isDefaultPrevented()) return // only register focus restorer if modal will actually get shown
1697
+ $target.one('hidden.bs.modal', function () {
1698
+ $this.is(':visible') && $this.trigger('focus')
1699
+ })
1700
+ })
1701
+ Plugin.call($target, option, this)
1702
+ })
1703
+
1704
+ }(jQuery);
1705
+
1706
+ /* ========================================================================
1707
+ * Bootstrap: tooltip.js v3.3.1
1708
+ * http://getbootstrap.com/javascript/#tooltip
1709
+ * Inspired by the original jQuery.tipsy by Jason Frame
1710
+ * ========================================================================
1711
+ * Copyright 2011-2014 Twitter, Inc.
1712
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
1713
+ * ======================================================================== */
1714
+
1715
+
1716
+ +function ($) {
1717
+ 'use strict';
1718
+
1719
+ // TOOLTIP PUBLIC CLASS DEFINITION
1720
+ // ===============================
1721
+
1722
+ var Tooltip = function (element, options) {
1723
+ this.type =
1724
+ this.options =
1725
+ this.enabled =
1726
+ this.timeout =
1727
+ this.hoverState =
1728
+ this.$element = null
1729
+
1730
+ this.init('tooltip', element, options)
1731
+ }
1732
+
1733
+ Tooltip.VERSION = '3.3.1'
1734
+
1735
+ Tooltip.TRANSITION_DURATION = 150
1736
+
1737
+ Tooltip.DEFAULTS = {
1738
+ animation: true,
1739
+ placement: 'top',
1740
+ selector: false,
1741
+ template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
1742
+ trigger: 'hover focus',
1743
+ title: '',
1744
+ delay: 0,
1745
+ html: false,
1746
+ container: false,
1747
+ viewport: {
1748
+ selector: 'body',
1749
+ padding: 0
1750
+ }
1751
+ }
1752
+
1753
+ Tooltip.prototype.init = function (type, element, options) {
1754
+ this.enabled = true
1755
+ this.type = type
1756
+ this.$element = $(element)
1757
+ this.options = this.getOptions(options)
1758
+ this.$viewport = this.options.viewport && $(this.options.viewport.selector || this.options.viewport)
1759
+
1760
+ var triggers = this.options.trigger.split(' ')
1761
+
1762
+ for (var i = triggers.length; i--;) {
1763
+ var trigger = triggers[i]
1764
+
1765
+ if (trigger == 'click') {
1766
+ this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
1767
+ } else if (trigger != 'manual') {
1768
+ var eventIn = trigger == 'hover' ? 'mouseenter' : 'focusin'
1769
+ var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout'
1770
+
1771
+ this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
1772
+ this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
1773
+ }
1774
+ }
1775
+
1776
+ this.options.selector ?
1777
+ (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
1778
+ this.fixTitle()
1779
+ }
1780
+
1781
+ Tooltip.prototype.getDefaults = function () {
1782
+ return Tooltip.DEFAULTS
1783
+ }
1784
+
1785
+ Tooltip.prototype.getOptions = function (options) {
1786
+ options = $.extend({}, this.getDefaults(), this.$element.data(), options)
1787
+
1788
+ if (options.delay && typeof options.delay == 'number') {
1789
+ options.delay = {
1790
+ show: options.delay,
1791
+ hide: options.delay
1792
+ }
1793
+ }
1794
+
1795
+ return options
1796
+ }
1797
+
1798
+ Tooltip.prototype.getDelegateOptions = function () {
1799
+ var options = {}
1800
+ var defaults = this.getDefaults()
1801
+
1802
+ this._options && $.each(this._options, function (key, value) {
1803
+ if (defaults[key] != value) options[key] = value
1804
+ })
1805
+
1806
+ return options
1807
+ }
1808
+
1809
+ Tooltip.prototype.enter = function (obj) {
1810
+ var self = obj instanceof this.constructor ?
1811
+ obj : $(obj.currentTarget).data('bs.' + this.type)
1812
+
1813
+ if (self && self.$tip && self.$tip.is(':visible')) {
1814
+ self.hoverState = 'in'
1815
+ return
1816
+ }
1817
+
1818
+ if (!self) {
1819
+ self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
1820
+ $(obj.currentTarget).data('bs.' + this.type, self)
1821
+ }
1822
+
1823
+ clearTimeout(self.timeout)
1824
+
1825
+ self.hoverState = 'in'
1826
+
1827
+ if (!self.options.delay || !self.options.delay.show) return self.show()
1828
+
1829
+ self.timeout = setTimeout(function () {
1830
+ if (self.hoverState == 'in') self.show()
1831
+ }, self.options.delay.show)
1832
+ }
1833
+
1834
+ Tooltip.prototype.leave = function (obj) {
1835
+ var self = obj instanceof this.constructor ?
1836
+ obj : $(obj.currentTarget).data('bs.' + this.type)
1837
+
1838
+ if (!self) {
1839
+ self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
1840
+ $(obj.currentTarget).data('bs.' + this.type, self)
1841
+ }
1842
+
1843
+ clearTimeout(self.timeout)
1844
+
1845
+ self.hoverState = 'out'
1846
+
1847
+ if (!self.options.delay || !self.options.delay.hide) return self.hide()
1848
+
1849
+ self.timeout = setTimeout(function () {
1850
+ if (self.hoverState == 'out') self.hide()
1851
+ }, self.options.delay.hide)
1852
+ }
1853
+
1854
+ Tooltip.prototype.show = function () {
1855
+ var e = $.Event('show.bs.' + this.type)
1856
+
1857
+ if (this.hasContent() && this.enabled) {
1858
+ this.$element.trigger(e)
1859
+
1860
+ var inDom = $.contains(this.$element[0].ownerDocument.documentElement, this.$element[0])
1861
+ if (e.isDefaultPrevented() || !inDom) return
1862
+ var that = this
1863
+
1864
+ var $tip = this.tip()
1865
+
1866
+ var tipId = this.getUID(this.type)
1867
+
1868
+ this.setContent()
1869
+ $tip.attr('id', tipId)
1870
+ this.$element.attr('aria-describedby', tipId)
1871
+
1872
+ if (this.options.animation) $tip.addClass('fade')
1873
+
1874
+ var placement = typeof this.options.placement == 'function' ?
1875
+ this.options.placement.call(this, $tip[0], this.$element[0]) :
1876
+ this.options.placement
1877
+
1878
+ var autoToken = /\s?auto?\s?/i
1879
+ var autoPlace = autoToken.test(placement)
1880
+ if (autoPlace) placement = placement.replace(autoToken, '') || 'top'
1881
+
1882
+ $tip
1883
+ .detach()
1884
+ .css({ top: 0, left: 0, display: 'block' })
1885
+ .addClass(placement)
1886
+ .data('bs.' + this.type, this)
1887
+
1888
+ this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
1889
+
1890
+ var pos = this.getPosition()
1891
+ var actualWidth = $tip[0].offsetWidth
1892
+ var actualHeight = $tip[0].offsetHeight
1893
+
1894
+ if (autoPlace) {
1895
+ var orgPlacement = placement
1896
+ var $container = this.options.container ? $(this.options.container) : this.$element.parent()
1897
+ var containerDim = this.getPosition($container)
1898
+
1899
+ placement = placement == 'bottom' && pos.bottom + actualHeight > containerDim.bottom ? 'top' :
1900
+ placement == 'top' && pos.top - actualHeight < containerDim.top ? 'bottom' :
1901
+ placement == 'right' && pos.right + actualWidth > containerDim.width ? 'left' :
1902
+ placement == 'left' && pos.left - actualWidth < containerDim.left ? 'right' :
1903
+ placement
1904
+
1905
+ $tip
1906
+ .removeClass(orgPlacement)
1907
+ .addClass(placement)
1908
+ }
1909
+
1910
+ var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight)
1911
+
1912
+ this.applyPlacement(calculatedOffset, placement)
1913
+
1914
+ var complete = function () {
1915
+ var prevHoverState = that.hoverState
1916
+ that.$element.trigger('shown.bs.' + that.type)
1917
+ that.hoverState = null
1918
+
1919
+ if (prevHoverState == 'out') that.leave(that)
1920
+ }
1921
+
1922
+ $.support.transition && this.$tip.hasClass('fade') ?
1923
+ $tip
1924
+ .one('bsTransitionEnd', complete)
1925
+ .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
1926
+ complete()
1927
+ }
1928
+ }
1929
+
1930
+ Tooltip.prototype.applyPlacement = function (offset, placement) {
1931
+ var $tip = this.tip()
1932
+ var width = $tip[0].offsetWidth
1933
+ var height = $tip[0].offsetHeight
1934
+
1935
+ // manually read margins because getBoundingClientRect includes difference
1936
+ var marginTop = parseInt($tip.css('margin-top'), 10)
1937
+ var marginLeft = parseInt($tip.css('margin-left'), 10)
1938
+
1939
+ // we must check for NaN for ie 8/9
1940
+ if (isNaN(marginTop)) marginTop = 0
1941
+ if (isNaN(marginLeft)) marginLeft = 0
1942
+
1943
+ offset.top = offset.top + marginTop
1944
+ offset.left = offset.left + marginLeft
1945
+
1946
+ // $.fn.offset doesn't round pixel values
1947
+ // so we use setOffset directly with our own function B-0
1948
+ $.offset.setOffset($tip[0], $.extend({
1949
+ using: function (props) {
1950
+ $tip.css({
1951
+ top: Math.round(props.top),
1952
+ left: Math.round(props.left)
1953
+ })
1954
+ }
1955
+ }, offset), 0)
1956
+
1957
+ $tip.addClass('in')
1958
+
1959
+ // check to see if placing tip in new offset caused the tip to resize itself
1960
+ var actualWidth = $tip[0].offsetWidth
1961
+ var actualHeight = $tip[0].offsetHeight
1962
+
1963
+ if (placement == 'top' && actualHeight != height) {
1964
+ offset.top = offset.top + height - actualHeight
1965
+ }
1966
+
1967
+ var delta = this.getViewportAdjustedDelta(placement, offset, actualWidth, actualHeight)
1968
+
1969
+ if (delta.left) offset.left += delta.left
1970
+ else offset.top += delta.top
1971
+
1972
+ var isVertical = /top|bottom/.test(placement)
1973
+ var arrowDelta = isVertical ? delta.left * 2 - width + actualWidth : delta.top * 2 - height + actualHeight
1974
+ var arrowOffsetPosition = isVertical ? 'offsetWidth' : 'offsetHeight'
1975
+
1976
+ $tip.offset(offset)
1977
+ this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], isVertical)
1978
+ }
1979
+
1980
+ Tooltip.prototype.replaceArrow = function (delta, dimension, isHorizontal) {
1981
+ this.arrow()
1982
+ .css(isHorizontal ? 'left' : 'top', 50 * (1 - delta / dimension) + '%')
1983
+ .css(isHorizontal ? 'top' : 'left', '')
1984
+ }
1985
+
1986
+ Tooltip.prototype.setContent = function () {
1987
+ var $tip = this.tip()
1988
+ var title = this.getTitle()
1989
+
1990
+ $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
1991
+ $tip.removeClass('fade in top bottom left right')
1992
+ }
1993
+
1994
+ Tooltip.prototype.hide = function (callback) {
1995
+ var that = this
1996
+ var $tip = this.tip()
1997
+ var e = $.Event('hide.bs.' + this.type)
1998
+
1999
+ function complete() {
2000
+ if (that.hoverState != 'in') $tip.detach()
2001
+ that.$element
2002
+ .removeAttr('aria-describedby')
2003
+ .trigger('hidden.bs.' + that.type)
2004
+ callback && callback()
2005
+ }
2006
+
2007
+ this.$element.trigger(e)
2008
+
2009
+ if (e.isDefaultPrevented()) return
2010
+
2011
+ $tip.removeClass('in')
2012
+
2013
+ $.support.transition && this.$tip.hasClass('fade') ?
2014
+ $tip
2015
+ .one('bsTransitionEnd', complete)
2016
+ .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
2017
+ complete()
2018
+
2019
+ this.hoverState = null
2020
+
2021
+ return this
2022
+ }
2023
+
2024
+ Tooltip.prototype.fixTitle = function () {
2025
+ var $e = this.$element
2026
+ if ($e.attr('title') || typeof ($e.attr('data-original-title')) != 'string') {
2027
+ $e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
2028
+ }
2029
+ }
2030
+
2031
+ Tooltip.prototype.hasContent = function () {
2032
+ return this.getTitle()
2033
+ }
2034
+
2035
+ Tooltip.prototype.getPosition = function ($element) {
2036
+ $element = $element || this.$element
2037
+
2038
+ var el = $element[0]
2039
+ var isBody = el.tagName == 'BODY'
2040
+
2041
+ var elRect = el.getBoundingClientRect()
2042
+ if (elRect.width == null) {
2043
+ // width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093
2044
+ elRect = $.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top })
2045
+ }
2046
+ var elOffset = isBody ? { top: 0, left: 0 } : $element.offset()
2047
+ var scroll = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() }
2048
+ var outerDims = isBody ? { width: $(window).width(), height: $(window).height() } : null
2049
+
2050
+ return $.extend({}, elRect, scroll, outerDims, elOffset)
2051
+ }
2052
+
2053
+ Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {
2054
+ return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } :
2055
+ placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } :
2056
+ placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } :
2057
+ /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width }
2058
+
2059
+ }
2060
+
2061
+ Tooltip.prototype.getViewportAdjustedDelta = function (placement, pos, actualWidth, actualHeight) {
2062
+ var delta = { top: 0, left: 0 }
2063
+ if (!this.$viewport) return delta
2064
+
2065
+ var viewportPadding = this.options.viewport && this.options.viewport.padding || 0
2066
+ var viewportDimensions = this.getPosition(this.$viewport)
2067
+
2068
+ if (/right|left/.test(placement)) {
2069
+ var topEdgeOffset = pos.top - viewportPadding - viewportDimensions.scroll
2070
+ var bottomEdgeOffset = pos.top + viewportPadding - viewportDimensions.scroll + actualHeight
2071
+ if (topEdgeOffset < viewportDimensions.top) { // top overflow
2072
+ delta.top = viewportDimensions.top - topEdgeOffset
2073
+ } else if (bottomEdgeOffset > viewportDimensions.top + viewportDimensions.height) { // bottom overflow
2074
+ delta.top = viewportDimensions.top + viewportDimensions.height - bottomEdgeOffset
2075
+ }
2076
+ } else {
2077
+ var leftEdgeOffset = pos.left - viewportPadding
2078
+ var rightEdgeOffset = pos.left + viewportPadding + actualWidth
2079
+ if (leftEdgeOffset < viewportDimensions.left) { // left overflow
2080
+ delta.left = viewportDimensions.left - leftEdgeOffset
2081
+ } else if (rightEdgeOffset > viewportDimensions.width) { // right overflow
2082
+ delta.left = viewportDimensions.left + viewportDimensions.width - rightEdgeOffset
2083
+ }
2084
+ }
2085
+
2086
+ return delta
2087
+ }
2088
+
2089
+ Tooltip.prototype.getTitle = function () {
2090
+ var title
2091
+ var $e = this.$element
2092
+ var o = this.options
2093
+
2094
+ title = $e.attr('data-original-title')
2095
+ || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
2096
+
2097
+ return title
2098
+ }
2099
+
2100
+ Tooltip.prototype.getUID = function (prefix) {
2101
+ do prefix += ~~(Math.random() * 1000000)
2102
+ while (document.getElementById(prefix))
2103
+ return prefix
2104
+ }
2105
+
2106
+ Tooltip.prototype.tip = function () {
2107
+ return (this.$tip = this.$tip || $(this.options.template))
2108
+ }
2109
+
2110
+ Tooltip.prototype.arrow = function () {
2111
+ return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow'))
2112
+ }
2113
+
2114
+ Tooltip.prototype.enable = function () {
2115
+ this.enabled = true
2116
+ }
2117
+
2118
+ Tooltip.prototype.disable = function () {
2119
+ this.enabled = false
2120
+ }
2121
+
2122
+ Tooltip.prototype.toggleEnabled = function () {
2123
+ this.enabled = !this.enabled
2124
+ }
2125
+
2126
+ Tooltip.prototype.toggle = function (e) {
2127
+ var self = this
2128
+ if (e) {
2129
+ self = $(e.currentTarget).data('bs.' + this.type)
2130
+ if (!self) {
2131
+ self = new this.constructor(e.currentTarget, this.getDelegateOptions())
2132
+ $(e.currentTarget).data('bs.' + this.type, self)
2133
+ }
2134
+ }
2135
+
2136
+ self.tip().hasClass('in') ? self.leave(self) : self.enter(self)
2137
+ }
2138
+
2139
+ Tooltip.prototype.destroy = function () {
2140
+ var that = this
2141
+ clearTimeout(this.timeout)
2142
+ this.hide(function () {
2143
+ that.$element.off('.' + that.type).removeData('bs.' + that.type)
2144
+ })
2145
+ }
2146
+
2147
+
2148
+ // TOOLTIP PLUGIN DEFINITION
2149
+ // =========================
2150
+
2151
+ function Plugin(option) {
2152
+ return this.each(function () {
2153
+ var $this = $(this)
2154
+ var data = $this.data('bs.tooltip')
2155
+ var options = typeof option == 'object' && option
2156
+ var selector = options && options.selector
2157
+
2158
+ if (!data && option == 'destroy') return
2159
+ if (selector) {
2160
+ if (!data) $this.data('bs.tooltip', (data = {}))
2161
+ if (!data[selector]) data[selector] = new Tooltip(this, options)
2162
+ } else {
2163
+ if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
2164
+ }
2165
+ if (typeof option == 'string') data[option]()
2166
+ })
2167
+ }
2168
+
2169
+ var old = $.fn.tooltip
2170
+
2171
+ $.fn.tooltip = Plugin
2172
+ $.fn.tooltip.Constructor = Tooltip
2173
+
2174
+
2175
+ // TOOLTIP NO CONFLICT
2176
+ // ===================
2177
+
2178
+ $.fn.tooltip.noConflict = function () {
2179
+ $.fn.tooltip = old
2180
+ return this
2181
+ }
2182
+
2183
+ }(jQuery);
2184
+
2185
+ /* ========================================================================
2186
+ * Bootstrap: popover.js v3.3.1
2187
+ * http://getbootstrap.com/javascript/#popovers
2188
+ * ========================================================================
2189
+ * Copyright 2011-2014 Twitter, Inc.
2190
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
2191
+ * ======================================================================== */
2192
+
2193
+
2194
+ +function ($) {
2195
+ 'use strict';
2196
+
2197
+ // POPOVER PUBLIC CLASS DEFINITION
2198
+ // ===============================
2199
+
2200
+ var Popover = function (element, options) {
2201
+ this.init('popover', element, options)
2202
+ }
2203
+
2204
+ if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
2205
+
2206
+ Popover.VERSION = '3.3.1'
2207
+
2208
+ Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {
2209
+ placement: 'right',
2210
+ trigger: 'click',
2211
+ content: '',
2212
+ template: '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
2213
+ })
2214
+
2215
+
2216
+ // NOTE: POPOVER EXTENDS tooltip.js
2217
+ // ================================
2218
+
2219
+ Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype)
2220
+
2221
+ Popover.prototype.constructor = Popover
2222
+
2223
+ Popover.prototype.getDefaults = function () {
2224
+ return Popover.DEFAULTS
2225
+ }
2226
+
2227
+ Popover.prototype.setContent = function () {
2228
+ var $tip = this.tip()
2229
+ var title = this.getTitle()
2230
+ var content = this.getContent()
2231
+
2232
+ $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
2233
+ $tip.find('.popover-content').children().detach().end()[ // we use append for html objects to maintain js events
2234
+ this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text'
2235
+ ](content)
2236
+
2237
+ $tip.removeClass('fade top bottom left right in')
2238
+
2239
+ // IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do
2240
+ // this manually by checking the contents.
2241
+ if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide()
2242
+ }
2243
+
2244
+ Popover.prototype.hasContent = function () {
2245
+ return this.getTitle() || this.getContent()
2246
+ }
2247
+
2248
+ Popover.prototype.getContent = function () {
2249
+ var $e = this.$element
2250
+ var o = this.options
2251
+
2252
+ return $e.attr('data-content')
2253
+ || (typeof o.content == 'function' ?
2254
+ o.content.call($e[0]) :
2255
+ o.content)
2256
+ }
2257
+
2258
+ Popover.prototype.arrow = function () {
2259
+ return (this.$arrow = this.$arrow || this.tip().find('.arrow'))
2260
+ }
2261
+
2262
+ Popover.prototype.tip = function () {
2263
+ if (!this.$tip) this.$tip = $(this.options.template)
2264
+ return this.$tip
2265
+ }
2266
+
2267
+
2268
+ // POPOVER PLUGIN DEFINITION
2269
+ // =========================
2270
+
2271
+ function Plugin(option) {
2272
+ return this.each(function () {
2273
+ var $this = $(this)
2274
+ var data = $this.data('bs.popover')
2275
+ var options = typeof option == 'object' && option
2276
+ var selector = options && options.selector
2277
+
2278
+ if (!data && option == 'destroy') return
2279
+ if (selector) {
2280
+ if (!data) $this.data('bs.popover', (data = {}))
2281
+ if (!data[selector]) data[selector] = new Popover(this, options)
2282
+ } else {
2283
+ if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
2284
+ }
2285
+ if (typeof option == 'string') data[option]()
2286
+ })
2287
+ }
2288
+
2289
+ var old = $.fn.popover
2290
+
2291
+ $.fn.popover = Plugin
2292
+ $.fn.popover.Constructor = Popover
2293
+
2294
+
2295
+ // POPOVER NO CONFLICT
2296
+ // ===================
2297
+
2298
+ $.fn.popover.noConflict = function () {
2299
+ $.fn.popover = old
2300
+ return this
2301
+ }
2302
+
2303
+ }(jQuery);
2304
+