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,478 @@
1
+ /* ========================================================================
2
+ * Bootstrap: tooltip.js v3.3.1
3
+ * http://getbootstrap.com/javascript/#tooltip
4
+ * Inspired by the original jQuery.tipsy by Jason Frame
5
+ * ========================================================================
6
+ * Copyright 2011-2014 Twitter, Inc.
7
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
8
+ * ======================================================================== */
9
+
10
+
11
+ +function ($) {
12
+ 'use strict';
13
+
14
+ // TOOLTIP PUBLIC CLASS DEFINITION
15
+ // ===============================
16
+
17
+ var Tooltip = function (element, options) {
18
+ this.type =
19
+ this.options =
20
+ this.enabled =
21
+ this.timeout =
22
+ this.hoverState =
23
+ this.$element = null
24
+
25
+ this.init('tooltip', element, options)
26
+ }
27
+
28
+ Tooltip.VERSION = '3.3.1'
29
+
30
+ Tooltip.TRANSITION_DURATION = 150
31
+
32
+ Tooltip.DEFAULTS = {
33
+ animation: true,
34
+ placement: 'top',
35
+ selector: false,
36
+ template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
37
+ trigger: 'hover focus',
38
+ title: '',
39
+ delay: 0,
40
+ html: false,
41
+ container: false,
42
+ viewport: {
43
+ selector: 'body',
44
+ padding: 0
45
+ }
46
+ }
47
+
48
+ Tooltip.prototype.init = function (type, element, options) {
49
+ this.enabled = true
50
+ this.type = type
51
+ this.$element = $(element)
52
+ this.options = this.getOptions(options)
53
+ this.$viewport = this.options.viewport && $(this.options.viewport.selector || this.options.viewport)
54
+
55
+ var triggers = this.options.trigger.split(' ')
56
+
57
+ for (var i = triggers.length; i--;) {
58
+ var trigger = triggers[i]
59
+
60
+ if (trigger == 'click') {
61
+ this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
62
+ } else if (trigger != 'manual') {
63
+ var eventIn = trigger == 'hover' ? 'mouseenter' : 'focusin'
64
+ var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout'
65
+
66
+ this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
67
+ this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
68
+ }
69
+ }
70
+
71
+ this.options.selector ?
72
+ (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
73
+ this.fixTitle()
74
+ }
75
+
76
+ Tooltip.prototype.getDefaults = function () {
77
+ return Tooltip.DEFAULTS
78
+ }
79
+
80
+ Tooltip.prototype.getOptions = function (options) {
81
+ options = $.extend({}, this.getDefaults(), this.$element.data(), options)
82
+
83
+ if (options.delay && typeof options.delay == 'number') {
84
+ options.delay = {
85
+ show: options.delay,
86
+ hide: options.delay
87
+ }
88
+ }
89
+
90
+ return options
91
+ }
92
+
93
+ Tooltip.prototype.getDelegateOptions = function () {
94
+ var options = {}
95
+ var defaults = this.getDefaults()
96
+
97
+ this._options && $.each(this._options, function (key, value) {
98
+ if (defaults[key] != value) options[key] = value
99
+ })
100
+
101
+ return options
102
+ }
103
+
104
+ Tooltip.prototype.enter = function (obj) {
105
+ var self = obj instanceof this.constructor ?
106
+ obj : $(obj.currentTarget).data('bs.' + this.type)
107
+
108
+ if (self && self.$tip && self.$tip.is(':visible')) {
109
+ self.hoverState = 'in'
110
+ return
111
+ }
112
+
113
+ if (!self) {
114
+ self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
115
+ $(obj.currentTarget).data('bs.' + this.type, self)
116
+ }
117
+
118
+ clearTimeout(self.timeout)
119
+
120
+ self.hoverState = 'in'
121
+
122
+ if (!self.options.delay || !self.options.delay.show) return self.show()
123
+
124
+ self.timeout = setTimeout(function () {
125
+ if (self.hoverState == 'in') self.show()
126
+ }, self.options.delay.show)
127
+ }
128
+
129
+ Tooltip.prototype.leave = function (obj) {
130
+ var self = obj instanceof this.constructor ?
131
+ obj : $(obj.currentTarget).data('bs.' + this.type)
132
+
133
+ if (!self) {
134
+ self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
135
+ $(obj.currentTarget).data('bs.' + this.type, self)
136
+ }
137
+
138
+ clearTimeout(self.timeout)
139
+
140
+ self.hoverState = 'out'
141
+
142
+ if (!self.options.delay || !self.options.delay.hide) return self.hide()
143
+
144
+ self.timeout = setTimeout(function () {
145
+ if (self.hoverState == 'out') self.hide()
146
+ }, self.options.delay.hide)
147
+ }
148
+
149
+ Tooltip.prototype.show = function () {
150
+ var e = $.Event('show.bs.' + this.type)
151
+
152
+ if (this.hasContent() && this.enabled) {
153
+ this.$element.trigger(e)
154
+
155
+ var inDom = $.contains(this.$element[0].ownerDocument.documentElement, this.$element[0])
156
+ if (e.isDefaultPrevented() || !inDom) return
157
+ var that = this
158
+
159
+ var $tip = this.tip()
160
+
161
+ var tipId = this.getUID(this.type)
162
+
163
+ this.setContent()
164
+ $tip.attr('id', tipId)
165
+ this.$element.attr('aria-describedby', tipId)
166
+
167
+ if (this.options.animation) $tip.addClass('fade')
168
+
169
+ var placement = typeof this.options.placement == 'function' ?
170
+ this.options.placement.call(this, $tip[0], this.$element[0]) :
171
+ this.options.placement
172
+
173
+ var autoToken = /\s?auto?\s?/i
174
+ var autoPlace = autoToken.test(placement)
175
+ if (autoPlace) placement = placement.replace(autoToken, '') || 'top'
176
+
177
+ $tip
178
+ .detach()
179
+ .css({ top: 0, left: 0, display: 'block' })
180
+ .addClass(placement)
181
+ .data('bs.' + this.type, this)
182
+
183
+ this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
184
+
185
+ var pos = this.getPosition()
186
+ var actualWidth = $tip[0].offsetWidth
187
+ var actualHeight = $tip[0].offsetHeight
188
+
189
+ if (autoPlace) {
190
+ var orgPlacement = placement
191
+ var $container = this.options.container ? $(this.options.container) : this.$element.parent()
192
+ var containerDim = this.getPosition($container)
193
+
194
+ placement = placement == 'bottom' && pos.bottom + actualHeight > containerDim.bottom ? 'top' :
195
+ placement == 'top' && pos.top - actualHeight < containerDim.top ? 'bottom' :
196
+ placement == 'right' && pos.right + actualWidth > containerDim.width ? 'left' :
197
+ placement == 'left' && pos.left - actualWidth < containerDim.left ? 'right' :
198
+ placement
199
+
200
+ $tip
201
+ .removeClass(orgPlacement)
202
+ .addClass(placement)
203
+ }
204
+
205
+ var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight)
206
+
207
+ this.applyPlacement(calculatedOffset, placement)
208
+
209
+ var complete = function () {
210
+ var prevHoverState = that.hoverState
211
+ that.$element.trigger('shown.bs.' + that.type)
212
+ that.hoverState = null
213
+
214
+ if (prevHoverState == 'out') that.leave(that)
215
+ }
216
+
217
+ $.support.transition && this.$tip.hasClass('fade') ?
218
+ $tip
219
+ .one('bsTransitionEnd', complete)
220
+ .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
221
+ complete()
222
+ }
223
+ }
224
+
225
+ Tooltip.prototype.applyPlacement = function (offset, placement) {
226
+ var $tip = this.tip()
227
+ var width = $tip[0].offsetWidth
228
+ var height = $tip[0].offsetHeight
229
+
230
+ // manually read margins because getBoundingClientRect includes difference
231
+ var marginTop = parseInt($tip.css('margin-top'), 10)
232
+ var marginLeft = parseInt($tip.css('margin-left'), 10)
233
+
234
+ // we must check for NaN for ie 8/9
235
+ if (isNaN(marginTop)) marginTop = 0
236
+ if (isNaN(marginLeft)) marginLeft = 0
237
+
238
+ offset.top = offset.top + marginTop
239
+ offset.left = offset.left + marginLeft
240
+
241
+ // $.fn.offset doesn't round pixel values
242
+ // so we use setOffset directly with our own function B-0
243
+ $.offset.setOffset($tip[0], $.extend({
244
+ using: function (props) {
245
+ $tip.css({
246
+ top: Math.round(props.top),
247
+ left: Math.round(props.left)
248
+ })
249
+ }
250
+ }, offset), 0)
251
+
252
+ $tip.addClass('in')
253
+
254
+ // check to see if placing tip in new offset caused the tip to resize itself
255
+ var actualWidth = $tip[0].offsetWidth
256
+ var actualHeight = $tip[0].offsetHeight
257
+
258
+ if (placement == 'top' && actualHeight != height) {
259
+ offset.top = offset.top + height - actualHeight
260
+ }
261
+
262
+ var delta = this.getViewportAdjustedDelta(placement, offset, actualWidth, actualHeight)
263
+
264
+ if (delta.left) offset.left += delta.left
265
+ else offset.top += delta.top
266
+
267
+ var isVertical = /top|bottom/.test(placement)
268
+ var arrowDelta = isVertical ? delta.left * 2 - width + actualWidth : delta.top * 2 - height + actualHeight
269
+ var arrowOffsetPosition = isVertical ? 'offsetWidth' : 'offsetHeight'
270
+
271
+ $tip.offset(offset)
272
+ this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], isVertical)
273
+ }
274
+
275
+ Tooltip.prototype.replaceArrow = function (delta, dimension, isHorizontal) {
276
+ this.arrow()
277
+ .css(isHorizontal ? 'left' : 'top', 50 * (1 - delta / dimension) + '%')
278
+ .css(isHorizontal ? 'top' : 'left', '')
279
+ }
280
+
281
+ Tooltip.prototype.setContent = function () {
282
+ var $tip = this.tip()
283
+ var title = this.getTitle()
284
+
285
+ $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
286
+ $tip.removeClass('fade in top bottom left right')
287
+ }
288
+
289
+ Tooltip.prototype.hide = function (callback) {
290
+ var that = this
291
+ var $tip = this.tip()
292
+ var e = $.Event('hide.bs.' + this.type)
293
+
294
+ function complete() {
295
+ if (that.hoverState != 'in') $tip.detach()
296
+ that.$element
297
+ .removeAttr('aria-describedby')
298
+ .trigger('hidden.bs.' + that.type)
299
+ callback && callback()
300
+ }
301
+
302
+ this.$element.trigger(e)
303
+
304
+ if (e.isDefaultPrevented()) return
305
+
306
+ $tip.removeClass('in')
307
+
308
+ $.support.transition && this.$tip.hasClass('fade') ?
309
+ $tip
310
+ .one('bsTransitionEnd', complete)
311
+ .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
312
+ complete()
313
+
314
+ this.hoverState = null
315
+
316
+ return this
317
+ }
318
+
319
+ Tooltip.prototype.fixTitle = function () {
320
+ var $e = this.$element
321
+ if ($e.attr('title') || typeof ($e.attr('data-original-title')) != 'string') {
322
+ $e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
323
+ }
324
+ }
325
+
326
+ Tooltip.prototype.hasContent = function () {
327
+ return this.getTitle()
328
+ }
329
+
330
+ Tooltip.prototype.getPosition = function ($element) {
331
+ $element = $element || this.$element
332
+
333
+ var el = $element[0]
334
+ var isBody = el.tagName == 'BODY'
335
+
336
+ var elRect = el.getBoundingClientRect()
337
+ if (elRect.width == null) {
338
+ // width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093
339
+ elRect = $.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top })
340
+ }
341
+ var elOffset = isBody ? { top: 0, left: 0 } : $element.offset()
342
+ var scroll = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() }
343
+ var outerDims = isBody ? { width: $(window).width(), height: $(window).height() } : null
344
+
345
+ return $.extend({}, elRect, scroll, outerDims, elOffset)
346
+ }
347
+
348
+ Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {
349
+ return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } :
350
+ placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } :
351
+ placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } :
352
+ /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width }
353
+
354
+ }
355
+
356
+ Tooltip.prototype.getViewportAdjustedDelta = function (placement, pos, actualWidth, actualHeight) {
357
+ var delta = { top: 0, left: 0 }
358
+ if (!this.$viewport) return delta
359
+
360
+ var viewportPadding = this.options.viewport && this.options.viewport.padding || 0
361
+ var viewportDimensions = this.getPosition(this.$viewport)
362
+
363
+ if (/right|left/.test(placement)) {
364
+ var topEdgeOffset = pos.top - viewportPadding - viewportDimensions.scroll
365
+ var bottomEdgeOffset = pos.top + viewportPadding - viewportDimensions.scroll + actualHeight
366
+ if (topEdgeOffset < viewportDimensions.top) { // top overflow
367
+ delta.top = viewportDimensions.top - topEdgeOffset
368
+ } else if (bottomEdgeOffset > viewportDimensions.top + viewportDimensions.height) { // bottom overflow
369
+ delta.top = viewportDimensions.top + viewportDimensions.height - bottomEdgeOffset
370
+ }
371
+ } else {
372
+ var leftEdgeOffset = pos.left - viewportPadding
373
+ var rightEdgeOffset = pos.left + viewportPadding + actualWidth
374
+ if (leftEdgeOffset < viewportDimensions.left) { // left overflow
375
+ delta.left = viewportDimensions.left - leftEdgeOffset
376
+ } else if (rightEdgeOffset > viewportDimensions.width) { // right overflow
377
+ delta.left = viewportDimensions.left + viewportDimensions.width - rightEdgeOffset
378
+ }
379
+ }
380
+
381
+ return delta
382
+ }
383
+
384
+ Tooltip.prototype.getTitle = function () {
385
+ var title
386
+ var $e = this.$element
387
+ var o = this.options
388
+
389
+ title = $e.attr('data-original-title')
390
+ || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
391
+
392
+ return title
393
+ }
394
+
395
+ Tooltip.prototype.getUID = function (prefix) {
396
+ do prefix += ~~(Math.random() * 1000000)
397
+ while (document.getElementById(prefix))
398
+ return prefix
399
+ }
400
+
401
+ Tooltip.prototype.tip = function () {
402
+ return (this.$tip = this.$tip || $(this.options.template))
403
+ }
404
+
405
+ Tooltip.prototype.arrow = function () {
406
+ return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow'))
407
+ }
408
+
409
+ Tooltip.prototype.enable = function () {
410
+ this.enabled = true
411
+ }
412
+
413
+ Tooltip.prototype.disable = function () {
414
+ this.enabled = false
415
+ }
416
+
417
+ Tooltip.prototype.toggleEnabled = function () {
418
+ this.enabled = !this.enabled
419
+ }
420
+
421
+ Tooltip.prototype.toggle = function (e) {
422
+ var self = this
423
+ if (e) {
424
+ self = $(e.currentTarget).data('bs.' + this.type)
425
+ if (!self) {
426
+ self = new this.constructor(e.currentTarget, this.getDelegateOptions())
427
+ $(e.currentTarget).data('bs.' + this.type, self)
428
+ }
429
+ }
430
+
431
+ self.tip().hasClass('in') ? self.leave(self) : self.enter(self)
432
+ }
433
+
434
+ Tooltip.prototype.destroy = function () {
435
+ var that = this
436
+ clearTimeout(this.timeout)
437
+ this.hide(function () {
438
+ that.$element.off('.' + that.type).removeData('bs.' + that.type)
439
+ })
440
+ }
441
+
442
+
443
+ // TOOLTIP PLUGIN DEFINITION
444
+ // =========================
445
+
446
+ function Plugin(option) {
447
+ return this.each(function () {
448
+ var $this = $(this)
449
+ var data = $this.data('bs.tooltip')
450
+ var options = typeof option == 'object' && option
451
+ var selector = options && options.selector
452
+
453
+ if (!data && option == 'destroy') return
454
+ if (selector) {
455
+ if (!data) $this.data('bs.tooltip', (data = {}))
456
+ if (!data[selector]) data[selector] = new Tooltip(this, options)
457
+ } else {
458
+ if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
459
+ }
460
+ if (typeof option == 'string') data[option]()
461
+ })
462
+ }
463
+
464
+ var old = $.fn.tooltip
465
+
466
+ $.fn.tooltip = Plugin
467
+ $.fn.tooltip.Constructor = Tooltip
468
+
469
+
470
+ // TOOLTIP NO CONFLICT
471
+ // ===================
472
+
473
+ $.fn.tooltip.noConflict = function () {
474
+ $.fn.tooltip = old
475
+ return this
476
+ }
477
+
478
+ }(jQuery);
@@ -0,0 +1,59 @@
1
+ /* ========================================================================
2
+ * Bootstrap: transition.js v3.3.1
3
+ * http://getbootstrap.com/javascript/#transitions
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
+ // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
14
+ // ============================================================
15
+
16
+ function transitionEnd() {
17
+ var el = document.createElement('bootstrap')
18
+
19
+ var transEndEventNames = {
20
+ WebkitTransition : 'webkitTransitionEnd',
21
+ MozTransition : 'transitionend',
22
+ OTransition : 'oTransitionEnd otransitionend',
23
+ transition : 'transitionend'
24
+ }
25
+
26
+ for (var name in transEndEventNames) {
27
+ if (el.style[name] !== undefined) {
28
+ return { end: transEndEventNames[name] }
29
+ }
30
+ }
31
+
32
+ return false // explicit for ie8 ( ._.)
33
+ }
34
+
35
+ // http://blog.alexmaccaw.com/css-transitions
36
+ $.fn.emulateTransitionEnd = function (duration) {
37
+ var called = false
38
+ var $el = this
39
+ $(this).one('bsTransitionEnd', function () { called = true })
40
+ var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
41
+ setTimeout(callback, duration)
42
+ return this
43
+ }
44
+
45
+ $(function () {
46
+ $.support.transition = transitionEnd()
47
+
48
+ if (!$.support.transition) return
49
+
50
+ $.event.special.bsTransitionEnd = {
51
+ bindType: $.support.transition.end,
52
+ delegateType: $.support.transition.end,
53
+ handle: function (e) {
54
+ if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments)
55
+ }
56
+ }
57
+ })
58
+
59
+ }(jQuery);
@@ -0,0 +1,12 @@
1
+ //= require ./bootstrap/affix
2
+ //= require ./bootstrap/alert
3
+ //= require ./bootstrap/button
4
+ //= require ./bootstrap/carousel
5
+ //= require ./bootstrap/collapse
6
+ //= require ./bootstrap/dropdown
7
+ //= require ./bootstrap/tab
8
+ //= require ./bootstrap/transition
9
+ //= require ./bootstrap/scrollspy
10
+ //= require ./bootstrap/modal
11
+ //= require ./bootstrap/tooltip
12
+ //= require ./bootstrap/popover