monatomic 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +11 -0
  3. data/.travis.yml +3 -0
  4. data/Gemfile +4 -0
  5. data/LICENSE.txt +21 -0
  6. data/README.md +88 -0
  7. data/Rakefile +19 -0
  8. data/bin/console +11 -0
  9. data/bin/setup +7 -0
  10. data/examples/simple.rb +23 -0
  11. data/lib/monatomic.rb +14 -0
  12. data/lib/monatomic/application.rb +52 -0
  13. data/lib/monatomic/assets/fonts/bootstrap/glyphicons-halflings-regular.eot +0 -0
  14. data/lib/monatomic/assets/fonts/bootstrap/glyphicons-halflings-regular.svg +288 -0
  15. data/lib/monatomic/assets/fonts/bootstrap/glyphicons-halflings-regular.ttf +0 -0
  16. data/lib/monatomic/assets/fonts/bootstrap/glyphicons-halflings-regular.woff +0 -0
  17. data/lib/monatomic/assets/fonts/bootstrap/glyphicons-halflings-regular.woff2 +0 -0
  18. data/lib/monatomic/assets/javascripts/application.js.coffee +20 -0
  19. data/lib/monatomic/assets/javascripts/bootstrap-datepicker.js +1782 -0
  20. data/lib/monatomic/assets/javascripts/bootstrap/affix.js +162 -0
  21. data/lib/monatomic/assets/javascripts/bootstrap/alert.js +94 -0
  22. data/lib/monatomic/assets/javascripts/bootstrap/button.js +116 -0
  23. data/lib/monatomic/assets/javascripts/bootstrap/carousel.js +237 -0
  24. data/lib/monatomic/assets/javascripts/bootstrap/collapse.js +211 -0
  25. data/lib/monatomic/assets/javascripts/bootstrap/dropdown.js +161 -0
  26. data/lib/monatomic/assets/javascripts/bootstrap/modal.js +339 -0
  27. data/lib/monatomic/assets/javascripts/bootstrap/popover.js +108 -0
  28. data/lib/monatomic/assets/javascripts/bootstrap/scrollspy.js +172 -0
  29. data/lib/monatomic/assets/javascripts/bootstrap/tab.js +153 -0
  30. data/lib/monatomic/assets/javascripts/bootstrap/tooltip.js +476 -0
  31. data/lib/monatomic/assets/javascripts/bootstrap/transition.js +59 -0
  32. data/lib/monatomic/assets/javascripts/jquery-2.1.3.min.js +4 -0
  33. data/lib/monatomic/assets/javascripts/jquery_ujs.js +477 -0
  34. data/lib/monatomic/assets/javascripts/selectize.min.js +3 -0
  35. data/lib/monatomic/assets/stylesheets/application.scss +90 -0
  36. data/lib/monatomic/assets/stylesheets/bootstrap-datepicker3.css +752 -0
  37. data/lib/monatomic/assets/stylesheets/bootstrap.scss +60 -0
  38. data/lib/monatomic/assets/stylesheets/bootstrap/_alerts.scss +73 -0
  39. data/lib/monatomic/assets/stylesheets/bootstrap/_badges.scss +68 -0
  40. data/lib/monatomic/assets/stylesheets/bootstrap/_breadcrumbs.scss +26 -0
  41. data/lib/monatomic/assets/stylesheets/bootstrap/_button-groups.scss +243 -0
  42. data/lib/monatomic/assets/stylesheets/bootstrap/_buttons.scss +160 -0
  43. data/lib/monatomic/assets/stylesheets/bootstrap/_carousel.scss +269 -0
  44. data/lib/monatomic/assets/stylesheets/bootstrap/_close.scss +36 -0
  45. data/lib/monatomic/assets/stylesheets/bootstrap/_code.scss +69 -0
  46. data/lib/monatomic/assets/stylesheets/bootstrap/_component-animations.scss +37 -0
  47. data/lib/monatomic/assets/stylesheets/bootstrap/_dropdowns.scss +214 -0
  48. data/lib/monatomic/assets/stylesheets/bootstrap/_forms.scss +578 -0
  49. data/lib/monatomic/assets/stylesheets/bootstrap/_glyphicons.scss +305 -0
  50. data/lib/monatomic/assets/stylesheets/bootstrap/_grid.scss +84 -0
  51. data/lib/monatomic/assets/stylesheets/bootstrap/_input-groups.scss +166 -0
  52. data/lib/monatomic/assets/stylesheets/bootstrap/_jumbotron.scss +50 -0
  53. data/lib/monatomic/assets/stylesheets/bootstrap/_labels.scss +66 -0
  54. data/lib/monatomic/assets/stylesheets/bootstrap/_list-group.scss +124 -0
  55. data/lib/monatomic/assets/stylesheets/bootstrap/_media.scss +61 -0
  56. data/lib/monatomic/assets/stylesheets/bootstrap/_mixins.scss +39 -0
  57. data/lib/monatomic/assets/stylesheets/bootstrap/_modals.scss +150 -0
  58. data/lib/monatomic/assets/stylesheets/bootstrap/_navbar.scss +662 -0
  59. data/lib/monatomic/assets/stylesheets/bootstrap/_navs.scss +242 -0
  60. data/lib/monatomic/assets/stylesheets/bootstrap/_normalize.scss +427 -0
  61. data/lib/monatomic/assets/stylesheets/bootstrap/_pager.scss +54 -0
  62. data/lib/monatomic/assets/stylesheets/bootstrap/_pagination.scss +88 -0
  63. data/lib/monatomic/assets/stylesheets/bootstrap/_panels.scss +265 -0
  64. data/lib/monatomic/assets/stylesheets/bootstrap/_popovers.scss +135 -0
  65. data/lib/monatomic/assets/stylesheets/bootstrap/_print.scss +107 -0
  66. data/lib/monatomic/assets/stylesheets/bootstrap/_progress-bars.scss +87 -0
  67. data/lib/monatomic/assets/stylesheets/bootstrap/_responsive-embed.scss +35 -0
  68. data/lib/monatomic/assets/stylesheets/bootstrap/_responsive-utilities.scss +177 -0
  69. data/lib/monatomic/assets/stylesheets/bootstrap/_scaffolding.scss +162 -0
  70. data/lib/monatomic/assets/stylesheets/bootstrap/_tables.scss +234 -0
  71. data/lib/monatomic/assets/stylesheets/bootstrap/_theme.scss +273 -0
  72. data/lib/monatomic/assets/stylesheets/bootstrap/_thumbnails.scss +38 -0
  73. data/lib/monatomic/assets/stylesheets/bootstrap/_tooltip.scss +102 -0
  74. data/lib/monatomic/assets/stylesheets/bootstrap/_type.scss +298 -0
  75. data/lib/monatomic/assets/stylesheets/bootstrap/_utilities.scss +55 -0
  76. data/lib/monatomic/assets/stylesheets/bootstrap/_variables.scss +866 -0
  77. data/lib/monatomic/assets/stylesheets/bootstrap/_wells.scss +29 -0
  78. data/lib/monatomic/assets/stylesheets/bootstrap/mixins/_alerts.scss +14 -0
  79. data/lib/monatomic/assets/stylesheets/bootstrap/mixins/_background-variant.scss +11 -0
  80. data/lib/monatomic/assets/stylesheets/bootstrap/mixins/_border-radius.scss +18 -0
  81. data/lib/monatomic/assets/stylesheets/bootstrap/mixins/_buttons.scss +52 -0
  82. data/lib/monatomic/assets/stylesheets/bootstrap/mixins/_center-block.scss +7 -0
  83. data/lib/monatomic/assets/stylesheets/bootstrap/mixins/_clearfix.scss +22 -0
  84. data/lib/monatomic/assets/stylesheets/bootstrap/mixins/_forms.scss +88 -0
  85. data/lib/monatomic/assets/stylesheets/bootstrap/mixins/_gradients.scss +58 -0
  86. data/lib/monatomic/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +81 -0
  87. data/lib/monatomic/assets/stylesheets/bootstrap/mixins/_grid.scss +122 -0
  88. data/lib/monatomic/assets/stylesheets/bootstrap/mixins/_hide-text.scss +21 -0
  89. data/lib/monatomic/assets/stylesheets/bootstrap/mixins/_image.scss +33 -0
  90. data/lib/monatomic/assets/stylesheets/bootstrap/mixins/_labels.scss +12 -0
  91. data/lib/monatomic/assets/stylesheets/bootstrap/mixins/_list-group.scss +31 -0
  92. data/lib/monatomic/assets/stylesheets/bootstrap/mixins/_nav-divider.scss +10 -0
  93. data/lib/monatomic/assets/stylesheets/bootstrap/mixins/_nav-vertical-align.scss +9 -0
  94. data/lib/monatomic/assets/stylesheets/bootstrap/mixins/_opacity.scss +8 -0
  95. data/lib/monatomic/assets/stylesheets/bootstrap/mixins/_pagination.scss +23 -0
  96. data/lib/monatomic/assets/stylesheets/bootstrap/mixins/_panels.scss +24 -0
  97. data/lib/monatomic/assets/stylesheets/bootstrap/mixins/_progress-bar.scss +10 -0
  98. data/lib/monatomic/assets/stylesheets/bootstrap/mixins/_reset-filter.scss +8 -0
  99. data/lib/monatomic/assets/stylesheets/bootstrap/mixins/_resize.scss +6 -0
  100. data/lib/monatomic/assets/stylesheets/bootstrap/mixins/_responsive-visibility.scss +21 -0
  101. data/lib/monatomic/assets/stylesheets/bootstrap/mixins/_size.scss +10 -0
  102. data/lib/monatomic/assets/stylesheets/bootstrap/mixins/_tab-focus.scss +9 -0
  103. data/lib/monatomic/assets/stylesheets/bootstrap/mixins/_table-row.scss +28 -0
  104. data/lib/monatomic/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +11 -0
  105. data/lib/monatomic/assets/stylesheets/bootstrap/mixins/_text-overflow.scss +8 -0
  106. data/lib/monatomic/assets/stylesheets/bootstrap/mixins/_vendor-prefixes.scss +222 -0
  107. data/lib/monatomic/assets/stylesheets/selectize.bootstrap3.css +401 -0
  108. data/lib/monatomic/controller.rb +154 -0
  109. data/lib/monatomic/helper.rb +114 -0
  110. data/lib/monatomic/locales/en.yml +21 -0
  111. data/lib/monatomic/models.rb +2 -0
  112. data/lib/monatomic/models/model.rb +248 -0
  113. data/lib/monatomic/models/user.rb +37 -0
  114. data/lib/monatomic/public/assets/application-d537e55235fbe513c876112de81f0334.js +4578 -0
  115. data/lib/monatomic/public/assets/application-d537e55235fbe513c876112de81f0334.js.gz +0 -0
  116. data/lib/monatomic/public/assets/application-e21e062fc2a24448e198c019f9c0721c.css +6865 -0
  117. data/lib/monatomic/public/assets/application-e21e062fc2a24448e198c019f9c0721c.css.gz +0 -0
  118. data/lib/monatomic/public/assets/bootstrap/glyphicons-halflings-regular-513af1c5182439377effce36c7813d33.eot +0 -0
  119. data/lib/monatomic/public/assets/bootstrap/glyphicons-halflings-regular-795f110aa27b39dffe83d4c7debd366f.ttf +0 -0
  120. data/lib/monatomic/public/assets/bootstrap/glyphicons-halflings-regular-9b034d31f97c53cfae213870811ba74d.svg +288 -0
  121. data/lib/monatomic/public/assets/bootstrap/glyphicons-halflings-regular-d2533ee9537f83620bb353cf5cddee17.woff +0 -0
  122. data/lib/monatomic/public/assets/manifest-e8294e69f9d97cc425dcce90af2fa06d.json +1 -0
  123. data/lib/monatomic/task.rb +4 -0
  124. data/lib/monatomic/types.rb +50 -0
  125. data/lib/monatomic/version.rb +3 -0
  126. data/lib/monatomic/views/edit.erb +29 -0
  127. data/lib/monatomic/views/editors/date.erb +6 -0
  128. data/lib/monatomic/views/editors/enumeration.erb +19 -0
  129. data/lib/monatomic/views/editors/integer.erb +6 -0
  130. data/lib/monatomic/views/editors/object.erb +1 -0
  131. data/lib/monatomic/views/editors/password.erb +6 -0
  132. data/lib/monatomic/views/editors/prompt.erb +19 -0
  133. data/lib/monatomic/views/editors/string.erb +6 -0
  134. data/lib/monatomic/views/editors/tags.erb +18 -0
  135. data/lib/monatomic/views/editors/text.erb +6 -0
  136. data/lib/monatomic/views/home.erb +1 -0
  137. data/lib/monatomic/views/index.erb +69 -0
  138. data/lib/monatomic/views/layout.erb +54 -0
  139. data/lib/monatomic/views/login.erb +62 -0
  140. data/lib/monatomic/views/presenters/object.erb +3 -0
  141. data/lib/monatomic/views/presenters/tags.erb +3 -0
  142. data/lib/monatomic/views/presenters/text.erb +1 -0
  143. data/lib/monatomic/views/show.erb +27 -0
  144. data/monatomic.gemspec +33 -0
  145. metadata +328 -0
@@ -0,0 +1,108 @@
1
+ /* ========================================================================
2
+ * Bootstrap: popover.js v3.3.4
3
+ * http://getbootstrap.com/javascript/#popovers
4
+ * ========================================================================
5
+ * Copyright 2011-2015 Twitter, Inc.
6
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
7
+ * ======================================================================== */
8
+
9
+
10
+ +function ($) {
11
+ 'use strict';
12
+
13
+ // POPOVER PUBLIC CLASS DEFINITION
14
+ // ===============================
15
+
16
+ var Popover = function (element, options) {
17
+ this.init('popover', element, options)
18
+ }
19
+
20
+ if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
21
+
22
+ Popover.VERSION = '3.3.4'
23
+
24
+ Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {
25
+ placement: 'right',
26
+ trigger: 'click',
27
+ content: '',
28
+ template: '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
29
+ })
30
+
31
+
32
+ // NOTE: POPOVER EXTENDS tooltip.js
33
+ // ================================
34
+
35
+ Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype)
36
+
37
+ Popover.prototype.constructor = Popover
38
+
39
+ Popover.prototype.getDefaults = function () {
40
+ return Popover.DEFAULTS
41
+ }
42
+
43
+ Popover.prototype.setContent = function () {
44
+ var $tip = this.tip()
45
+ var title = this.getTitle()
46
+ var content = this.getContent()
47
+
48
+ $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
49
+ $tip.find('.popover-content').children().detach().end()[ // we use append for html objects to maintain js events
50
+ this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text'
51
+ ](content)
52
+
53
+ $tip.removeClass('fade top bottom left right in')
54
+
55
+ // IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do
56
+ // this manually by checking the contents.
57
+ if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide()
58
+ }
59
+
60
+ Popover.prototype.hasContent = function () {
61
+ return this.getTitle() || this.getContent()
62
+ }
63
+
64
+ Popover.prototype.getContent = function () {
65
+ var $e = this.$element
66
+ var o = this.options
67
+
68
+ return $e.attr('data-content')
69
+ || (typeof o.content == 'function' ?
70
+ o.content.call($e[0]) :
71
+ o.content)
72
+ }
73
+
74
+ Popover.prototype.arrow = function () {
75
+ return (this.$arrow = this.$arrow || this.tip().find('.arrow'))
76
+ }
77
+
78
+
79
+ // POPOVER PLUGIN DEFINITION
80
+ // =========================
81
+
82
+ function Plugin(option) {
83
+ return this.each(function () {
84
+ var $this = $(this)
85
+ var data = $this.data('bs.popover')
86
+ var options = typeof option == 'object' && option
87
+
88
+ if (!data && /destroy|hide/.test(option)) return
89
+ if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
90
+ if (typeof option == 'string') data[option]()
91
+ })
92
+ }
93
+
94
+ var old = $.fn.popover
95
+
96
+ $.fn.popover = Plugin
97
+ $.fn.popover.Constructor = Popover
98
+
99
+
100
+ // POPOVER NO CONFLICT
101
+ // ===================
102
+
103
+ $.fn.popover.noConflict = function () {
104
+ $.fn.popover = old
105
+ return this
106
+ }
107
+
108
+ }(jQuery);
@@ -0,0 +1,172 @@
1
+ /* ========================================================================
2
+ * Bootstrap: scrollspy.js v3.3.4
3
+ * http://getbootstrap.com/javascript/#scrollspy
4
+ * ========================================================================
5
+ * Copyright 2011-2015 Twitter, Inc.
6
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
7
+ * ======================================================================== */
8
+
9
+
10
+ +function ($) {
11
+ 'use strict';
12
+
13
+ // SCROLLSPY CLASS DEFINITION
14
+ // ==========================
15
+
16
+ function ScrollSpy(element, options) {
17
+ this.$body = $(document.body)
18
+ this.$scrollElement = $(element).is(document.body) ? $(window) : $(element)
19
+ this.options = $.extend({}, ScrollSpy.DEFAULTS, options)
20
+ this.selector = (this.options.target || '') + ' .nav li > a'
21
+ this.offsets = []
22
+ this.targets = []
23
+ this.activeTarget = null
24
+ this.scrollHeight = 0
25
+
26
+ this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this))
27
+ this.refresh()
28
+ this.process()
29
+ }
30
+
31
+ ScrollSpy.VERSION = '3.3.4'
32
+
33
+ ScrollSpy.DEFAULTS = {
34
+ offset: 10
35
+ }
36
+
37
+ ScrollSpy.prototype.getScrollHeight = function () {
38
+ return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight)
39
+ }
40
+
41
+ ScrollSpy.prototype.refresh = function () {
42
+ var that = this
43
+ var offsetMethod = 'offset'
44
+ var offsetBase = 0
45
+
46
+ this.offsets = []
47
+ this.targets = []
48
+ this.scrollHeight = this.getScrollHeight()
49
+
50
+ if (!$.isWindow(this.$scrollElement[0])) {
51
+ offsetMethod = 'position'
52
+ offsetBase = this.$scrollElement.scrollTop()
53
+ }
54
+
55
+ this.$body
56
+ .find(this.selector)
57
+ .map(function () {
58
+ var $el = $(this)
59
+ var href = $el.data('target') || $el.attr('href')
60
+ var $href = /^#./.test(href) && $(href)
61
+
62
+ return ($href
63
+ && $href.length
64
+ && $href.is(':visible')
65
+ && [[$href[offsetMethod]().top + offsetBase, href]]) || null
66
+ })
67
+ .sort(function (a, b) { return a[0] - b[0] })
68
+ .each(function () {
69
+ that.offsets.push(this[0])
70
+ that.targets.push(this[1])
71
+ })
72
+ }
73
+
74
+ ScrollSpy.prototype.process = function () {
75
+ var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
76
+ var scrollHeight = this.getScrollHeight()
77
+ var maxScroll = this.options.offset + scrollHeight - this.$scrollElement.height()
78
+ var offsets = this.offsets
79
+ var targets = this.targets
80
+ var activeTarget = this.activeTarget
81
+ var i
82
+
83
+ if (this.scrollHeight != scrollHeight) {
84
+ this.refresh()
85
+ }
86
+
87
+ if (scrollTop >= maxScroll) {
88
+ return activeTarget != (i = targets[targets.length - 1]) && this.activate(i)
89
+ }
90
+
91
+ if (activeTarget && scrollTop < offsets[0]) {
92
+ this.activeTarget = null
93
+ return this.clear()
94
+ }
95
+
96
+ for (i = offsets.length; i--;) {
97
+ activeTarget != targets[i]
98
+ && scrollTop >= offsets[i]
99
+ && (offsets[i + 1] === undefined || scrollTop < offsets[i + 1])
100
+ && this.activate(targets[i])
101
+ }
102
+ }
103
+
104
+ ScrollSpy.prototype.activate = function (target) {
105
+ this.activeTarget = target
106
+
107
+ this.clear()
108
+
109
+ var selector = this.selector +
110
+ '[data-target="' + target + '"],' +
111
+ this.selector + '[href="' + target + '"]'
112
+
113
+ var active = $(selector)
114
+ .parents('li')
115
+ .addClass('active')
116
+
117
+ if (active.parent('.dropdown-menu').length) {
118
+ active = active
119
+ .closest('li.dropdown')
120
+ .addClass('active')
121
+ }
122
+
123
+ active.trigger('activate.bs.scrollspy')
124
+ }
125
+
126
+ ScrollSpy.prototype.clear = function () {
127
+ $(this.selector)
128
+ .parentsUntil(this.options.target, '.active')
129
+ .removeClass('active')
130
+ }
131
+
132
+
133
+ // SCROLLSPY PLUGIN DEFINITION
134
+ // ===========================
135
+
136
+ function Plugin(option) {
137
+ return this.each(function () {
138
+ var $this = $(this)
139
+ var data = $this.data('bs.scrollspy')
140
+ var options = typeof option == 'object' && option
141
+
142
+ if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options)))
143
+ if (typeof option == 'string') data[option]()
144
+ })
145
+ }
146
+
147
+ var old = $.fn.scrollspy
148
+
149
+ $.fn.scrollspy = Plugin
150
+ $.fn.scrollspy.Constructor = ScrollSpy
151
+
152
+
153
+ // SCROLLSPY NO CONFLICT
154
+ // =====================
155
+
156
+ $.fn.scrollspy.noConflict = function () {
157
+ $.fn.scrollspy = old
158
+ return this
159
+ }
160
+
161
+
162
+ // SCROLLSPY DATA-API
163
+ // ==================
164
+
165
+ $(window).on('load.bs.scrollspy.data-api', function () {
166
+ $('[data-spy="scroll"]').each(function () {
167
+ var $spy = $(this)
168
+ Plugin.call($spy, $spy.data())
169
+ })
170
+ })
171
+
172
+ }(jQuery);
@@ -0,0 +1,153 @@
1
+ /* ========================================================================
2
+ * Bootstrap: tab.js v3.3.4
3
+ * http://getbootstrap.com/javascript/#tabs
4
+ * ========================================================================
5
+ * Copyright 2011-2015 Twitter, Inc.
6
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
7
+ * ======================================================================== */
8
+
9
+
10
+ +function ($) {
11
+ 'use strict';
12
+
13
+ // TAB CLASS DEFINITION
14
+ // ====================
15
+
16
+ var Tab = function (element) {
17
+ this.element = $(element)
18
+ }
19
+
20
+ Tab.VERSION = '3.3.4'
21
+
22
+ Tab.TRANSITION_DURATION = 150
23
+
24
+ Tab.prototype.show = function () {
25
+ var $this = this.element
26
+ var $ul = $this.closest('ul:not(.dropdown-menu)')
27
+ var selector = $this.data('target')
28
+
29
+ if (!selector) {
30
+ selector = $this.attr('href')
31
+ selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
32
+ }
33
+
34
+ if ($this.parent('li').hasClass('active')) return
35
+
36
+ var $previous = $ul.find('.active:last a')
37
+ var hideEvent = $.Event('hide.bs.tab', {
38
+ relatedTarget: $this[0]
39
+ })
40
+ var showEvent = $.Event('show.bs.tab', {
41
+ relatedTarget: $previous[0]
42
+ })
43
+
44
+ $previous.trigger(hideEvent)
45
+ $this.trigger(showEvent)
46
+
47
+ if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) return
48
+
49
+ var $target = $(selector)
50
+
51
+ this.activate($this.closest('li'), $ul)
52
+ this.activate($target, $target.parent(), function () {
53
+ $previous.trigger({
54
+ type: 'hidden.bs.tab',
55
+ relatedTarget: $this[0]
56
+ })
57
+ $this.trigger({
58
+ type: 'shown.bs.tab',
59
+ relatedTarget: $previous[0]
60
+ })
61
+ })
62
+ }
63
+
64
+ Tab.prototype.activate = function (element, container, callback) {
65
+ var $active = container.find('> .active')
66
+ var transition = callback
67
+ && $.support.transition
68
+ && (($active.length && $active.hasClass('fade')) || !!container.find('> .fade').length)
69
+
70
+ function next() {
71
+ $active
72
+ .removeClass('active')
73
+ .find('> .dropdown-menu > .active')
74
+ .removeClass('active')
75
+ .end()
76
+ .find('[data-toggle="tab"]')
77
+ .attr('aria-expanded', false)
78
+
79
+ element
80
+ .addClass('active')
81
+ .find('[data-toggle="tab"]')
82
+ .attr('aria-expanded', true)
83
+
84
+ if (transition) {
85
+ element[0].offsetWidth // reflow for transition
86
+ element.addClass('in')
87
+ } else {
88
+ element.removeClass('fade')
89
+ }
90
+
91
+ if (element.parent('.dropdown-menu').length) {
92
+ element
93
+ .closest('li.dropdown')
94
+ .addClass('active')
95
+ .end()
96
+ .find('[data-toggle="tab"]')
97
+ .attr('aria-expanded', true)
98
+ }
99
+
100
+ callback && callback()
101
+ }
102
+
103
+ $active.length && transition ?
104
+ $active
105
+ .one('bsTransitionEnd', next)
106
+ .emulateTransitionEnd(Tab.TRANSITION_DURATION) :
107
+ next()
108
+
109
+ $active.removeClass('in')
110
+ }
111
+
112
+
113
+ // TAB PLUGIN DEFINITION
114
+ // =====================
115
+
116
+ function Plugin(option) {
117
+ return this.each(function () {
118
+ var $this = $(this)
119
+ var data = $this.data('bs.tab')
120
+
121
+ if (!data) $this.data('bs.tab', (data = new Tab(this)))
122
+ if (typeof option == 'string') data[option]()
123
+ })
124
+ }
125
+
126
+ var old = $.fn.tab
127
+
128
+ $.fn.tab = Plugin
129
+ $.fn.tab.Constructor = Tab
130
+
131
+
132
+ // TAB NO CONFLICT
133
+ // ===============
134
+
135
+ $.fn.tab.noConflict = function () {
136
+ $.fn.tab = old
137
+ return this
138
+ }
139
+
140
+
141
+ // TAB DATA-API
142
+ // ============
143
+
144
+ var clickHandler = function (e) {
145
+ e.preventDefault()
146
+ Plugin.call($(this), 'show')
147
+ }
148
+
149
+ $(document)
150
+ .on('click.bs.tab.data-api', '[data-toggle="tab"]', clickHandler)
151
+ .on('click.bs.tab.data-api', '[data-toggle="pill"]', clickHandler)
152
+
153
+ }(jQuery);
@@ -0,0 +1,476 @@
1
+ /* ========================================================================
2
+ * Bootstrap: tooltip.js v3.3.4
3
+ * http://getbootstrap.com/javascript/#tooltip
4
+ * Inspired by the original jQuery.tipsy by Jason Frame
5
+ * ========================================================================
6
+ * Copyright 2011-2015 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 = null
19
+ this.options = null
20
+ this.enabled = null
21
+ this.timeout = null
22
+ this.hoverState = null
23
+ this.$element = null
24
+
25
+ this.init('tooltip', element, options)
26
+ }
27
+
28
+ Tooltip.VERSION = '3.3.4'
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
+ if (this.$element[0] instanceof document.constructor && !this.options.selector) {
56
+ throw new Error('`selector` option must be specified when initializing ' + this.type + ' on the window.document object!')
57
+ }
58
+
59
+ var triggers = this.options.trigger.split(' ')
60
+
61
+ for (var i = triggers.length; i--;) {
62
+ var trigger = triggers[i]
63
+
64
+ if (trigger == 'click') {
65
+ this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
66
+ } else if (trigger != 'manual') {
67
+ var eventIn = trigger == 'hover' ? 'mouseenter' : 'focusin'
68
+ var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout'
69
+
70
+ this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
71
+ this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
72
+ }
73
+ }
74
+
75
+ this.options.selector ?
76
+ (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
77
+ this.fixTitle()
78
+ }
79
+
80
+ Tooltip.prototype.getDefaults = function () {
81
+ return Tooltip.DEFAULTS
82
+ }
83
+
84
+ Tooltip.prototype.getOptions = function (options) {
85
+ options = $.extend({}, this.getDefaults(), this.$element.data(), options)
86
+
87
+ if (options.delay && typeof options.delay == 'number') {
88
+ options.delay = {
89
+ show: options.delay,
90
+ hide: options.delay
91
+ }
92
+ }
93
+
94
+ return options
95
+ }
96
+
97
+ Tooltip.prototype.getDelegateOptions = function () {
98
+ var options = {}
99
+ var defaults = this.getDefaults()
100
+
101
+ this._options && $.each(this._options, function (key, value) {
102
+ if (defaults[key] != value) options[key] = value
103
+ })
104
+
105
+ return options
106
+ }
107
+
108
+ Tooltip.prototype.enter = function (obj) {
109
+ var self = obj instanceof this.constructor ?
110
+ obj : $(obj.currentTarget).data('bs.' + this.type)
111
+
112
+ if (self && self.$tip && self.$tip.is(':visible')) {
113
+ self.hoverState = 'in'
114
+ return
115
+ }
116
+
117
+ if (!self) {
118
+ self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
119
+ $(obj.currentTarget).data('bs.' + this.type, self)
120
+ }
121
+
122
+ clearTimeout(self.timeout)
123
+
124
+ self.hoverState = 'in'
125
+
126
+ if (!self.options.delay || !self.options.delay.show) return self.show()
127
+
128
+ self.timeout = setTimeout(function () {
129
+ if (self.hoverState == 'in') self.show()
130
+ }, self.options.delay.show)
131
+ }
132
+
133
+ Tooltip.prototype.leave = function (obj) {
134
+ var self = obj instanceof this.constructor ?
135
+ obj : $(obj.currentTarget).data('bs.' + this.type)
136
+
137
+ if (!self) {
138
+ self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
139
+ $(obj.currentTarget).data('bs.' + this.type, self)
140
+ }
141
+
142
+ clearTimeout(self.timeout)
143
+
144
+ self.hoverState = 'out'
145
+
146
+ if (!self.options.delay || !self.options.delay.hide) return self.hide()
147
+
148
+ self.timeout = setTimeout(function () {
149
+ if (self.hoverState == 'out') self.hide()
150
+ }, self.options.delay.hide)
151
+ }
152
+
153
+ Tooltip.prototype.show = function () {
154
+ var e = $.Event('show.bs.' + this.type)
155
+
156
+ if (this.hasContent() && this.enabled) {
157
+ this.$element.trigger(e)
158
+
159
+ var inDom = $.contains(this.$element[0].ownerDocument.documentElement, this.$element[0])
160
+ if (e.isDefaultPrevented() || !inDom) return
161
+ var that = this
162
+
163
+ var $tip = this.tip()
164
+
165
+ var tipId = this.getUID(this.type)
166
+
167
+ this.setContent()
168
+ $tip.attr('id', tipId)
169
+ this.$element.attr('aria-describedby', tipId)
170
+
171
+ if (this.options.animation) $tip.addClass('fade')
172
+
173
+ var placement = typeof this.options.placement == 'function' ?
174
+ this.options.placement.call(this, $tip[0], this.$element[0]) :
175
+ this.options.placement
176
+
177
+ var autoToken = /\s?auto?\s?/i
178
+ var autoPlace = autoToken.test(placement)
179
+ if (autoPlace) placement = placement.replace(autoToken, '') || 'top'
180
+
181
+ $tip
182
+ .detach()
183
+ .css({ top: 0, left: 0, display: 'block' })
184
+ .addClass(placement)
185
+ .data('bs.' + this.type, this)
186
+
187
+ this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
188
+
189
+ var pos = this.getPosition()
190
+ var actualWidth = $tip[0].offsetWidth
191
+ var actualHeight = $tip[0].offsetHeight
192
+
193
+ if (autoPlace) {
194
+ var orgPlacement = placement
195
+ var $container = this.options.container ? $(this.options.container) : this.$element.parent()
196
+ var containerDim = this.getPosition($container)
197
+
198
+ placement = placement == 'bottom' && pos.bottom + actualHeight > containerDim.bottom ? 'top' :
199
+ placement == 'top' && pos.top - actualHeight < containerDim.top ? 'bottom' :
200
+ placement == 'right' && pos.right + actualWidth > containerDim.width ? 'left' :
201
+ placement == 'left' && pos.left - actualWidth < containerDim.left ? 'right' :
202
+ placement
203
+
204
+ $tip
205
+ .removeClass(orgPlacement)
206
+ .addClass(placement)
207
+ }
208
+
209
+ var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight)
210
+
211
+ this.applyPlacement(calculatedOffset, placement)
212
+
213
+ var complete = function () {
214
+ var prevHoverState = that.hoverState
215
+ that.$element.trigger('shown.bs.' + that.type)
216
+ that.hoverState = null
217
+
218
+ if (prevHoverState == 'out') that.leave(that)
219
+ }
220
+
221
+ $.support.transition && this.$tip.hasClass('fade') ?
222
+ $tip
223
+ .one('bsTransitionEnd', complete)
224
+ .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
225
+ complete()
226
+ }
227
+ }
228
+
229
+ Tooltip.prototype.applyPlacement = function (offset, placement) {
230
+ var $tip = this.tip()
231
+ var width = $tip[0].offsetWidth
232
+ var height = $tip[0].offsetHeight
233
+
234
+ // manually read margins because getBoundingClientRect includes difference
235
+ var marginTop = parseInt($tip.css('margin-top'), 10)
236
+ var marginLeft = parseInt($tip.css('margin-left'), 10)
237
+
238
+ // we must check for NaN for ie 8/9
239
+ if (isNaN(marginTop)) marginTop = 0
240
+ if (isNaN(marginLeft)) marginLeft = 0
241
+
242
+ offset.top = offset.top + marginTop
243
+ offset.left = offset.left + marginLeft
244
+
245
+ // $.fn.offset doesn't round pixel values
246
+ // so we use setOffset directly with our own function B-0
247
+ $.offset.setOffset($tip[0], $.extend({
248
+ using: function (props) {
249
+ $tip.css({
250
+ top: Math.round(props.top),
251
+ left: Math.round(props.left)
252
+ })
253
+ }
254
+ }, offset), 0)
255
+
256
+ $tip.addClass('in')
257
+
258
+ // check to see if placing tip in new offset caused the tip to resize itself
259
+ var actualWidth = $tip[0].offsetWidth
260
+ var actualHeight = $tip[0].offsetHeight
261
+
262
+ if (placement == 'top' && actualHeight != height) {
263
+ offset.top = offset.top + height - actualHeight
264
+ }
265
+
266
+ var delta = this.getViewportAdjustedDelta(placement, offset, actualWidth, actualHeight)
267
+
268
+ if (delta.left) offset.left += delta.left
269
+ else offset.top += delta.top
270
+
271
+ var isVertical = /top|bottom/.test(placement)
272
+ var arrowDelta = isVertical ? delta.left * 2 - width + actualWidth : delta.top * 2 - height + actualHeight
273
+ var arrowOffsetPosition = isVertical ? 'offsetWidth' : 'offsetHeight'
274
+
275
+ $tip.offset(offset)
276
+ this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], isVertical)
277
+ }
278
+
279
+ Tooltip.prototype.replaceArrow = function (delta, dimension, isVertical) {
280
+ this.arrow()
281
+ .css(isVertical ? 'left' : 'top', 50 * (1 - delta / dimension) + '%')
282
+ .css(isVertical ? 'top' : 'left', '')
283
+ }
284
+
285
+ Tooltip.prototype.setContent = function () {
286
+ var $tip = this.tip()
287
+ var title = this.getTitle()
288
+
289
+ $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
290
+ $tip.removeClass('fade in top bottom left right')
291
+ }
292
+
293
+ Tooltip.prototype.hide = function (callback) {
294
+ var that = this
295
+ var $tip = $(this.$tip)
296
+ var e = $.Event('hide.bs.' + this.type)
297
+
298
+ function complete() {
299
+ if (that.hoverState != 'in') $tip.detach()
300
+ that.$element
301
+ .removeAttr('aria-describedby')
302
+ .trigger('hidden.bs.' + that.type)
303
+ callback && callback()
304
+ }
305
+
306
+ this.$element.trigger(e)
307
+
308
+ if (e.isDefaultPrevented()) return
309
+
310
+ $tip.removeClass('in')
311
+
312
+ $.support.transition && $tip.hasClass('fade') ?
313
+ $tip
314
+ .one('bsTransitionEnd', complete)
315
+ .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
316
+ complete()
317
+
318
+ this.hoverState = null
319
+
320
+ return this
321
+ }
322
+
323
+ Tooltip.prototype.fixTitle = function () {
324
+ var $e = this.$element
325
+ if ($e.attr('title') || typeof ($e.attr('data-original-title')) != 'string') {
326
+ $e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
327
+ }
328
+ }
329
+
330
+ Tooltip.prototype.hasContent = function () {
331
+ return this.getTitle()
332
+ }
333
+
334
+ Tooltip.prototype.getPosition = function ($element) {
335
+ $element = $element || this.$element
336
+
337
+ var el = $element[0]
338
+ var isBody = el.tagName == 'BODY'
339
+
340
+ var elRect = el.getBoundingClientRect()
341
+ if (elRect.width == null) {
342
+ // width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093
343
+ elRect = $.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top })
344
+ }
345
+ var elOffset = isBody ? { top: 0, left: 0 } : $element.offset()
346
+ var scroll = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() }
347
+ var outerDims = isBody ? { width: $(window).width(), height: $(window).height() } : null
348
+
349
+ return $.extend({}, elRect, scroll, outerDims, elOffset)
350
+ }
351
+
352
+ Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {
353
+ return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } :
354
+ placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } :
355
+ placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } :
356
+ /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width }
357
+
358
+ }
359
+
360
+ Tooltip.prototype.getViewportAdjustedDelta = function (placement, pos, actualWidth, actualHeight) {
361
+ var delta = { top: 0, left: 0 }
362
+ if (!this.$viewport) return delta
363
+
364
+ var viewportPadding = this.options.viewport && this.options.viewport.padding || 0
365
+ var viewportDimensions = this.getPosition(this.$viewport)
366
+
367
+ if (/right|left/.test(placement)) {
368
+ var topEdgeOffset = pos.top - viewportPadding - viewportDimensions.scroll
369
+ var bottomEdgeOffset = pos.top + viewportPadding - viewportDimensions.scroll + actualHeight
370
+ if (topEdgeOffset < viewportDimensions.top) { // top overflow
371
+ delta.top = viewportDimensions.top - topEdgeOffset
372
+ } else if (bottomEdgeOffset > viewportDimensions.top + viewportDimensions.height) { // bottom overflow
373
+ delta.top = viewportDimensions.top + viewportDimensions.height - bottomEdgeOffset
374
+ }
375
+ } else {
376
+ var leftEdgeOffset = pos.left - viewportPadding
377
+ var rightEdgeOffset = pos.left + viewportPadding + actualWidth
378
+ if (leftEdgeOffset < viewportDimensions.left) { // left overflow
379
+ delta.left = viewportDimensions.left - leftEdgeOffset
380
+ } else if (rightEdgeOffset > viewportDimensions.width) { // right overflow
381
+ delta.left = viewportDimensions.left + viewportDimensions.width - rightEdgeOffset
382
+ }
383
+ }
384
+
385
+ return delta
386
+ }
387
+
388
+ Tooltip.prototype.getTitle = function () {
389
+ var title
390
+ var $e = this.$element
391
+ var o = this.options
392
+
393
+ title = $e.attr('data-original-title')
394
+ || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
395
+
396
+ return title
397
+ }
398
+
399
+ Tooltip.prototype.getUID = function (prefix) {
400
+ do prefix += ~~(Math.random() * 1000000)
401
+ while (document.getElementById(prefix))
402
+ return prefix
403
+ }
404
+
405
+ Tooltip.prototype.tip = function () {
406
+ return (this.$tip = this.$tip || $(this.options.template))
407
+ }
408
+
409
+ Tooltip.prototype.arrow = function () {
410
+ return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow'))
411
+ }
412
+
413
+ Tooltip.prototype.enable = function () {
414
+ this.enabled = true
415
+ }
416
+
417
+ Tooltip.prototype.disable = function () {
418
+ this.enabled = false
419
+ }
420
+
421
+ Tooltip.prototype.toggleEnabled = function () {
422
+ this.enabled = !this.enabled
423
+ }
424
+
425
+ Tooltip.prototype.toggle = function (e) {
426
+ var self = this
427
+ if (e) {
428
+ self = $(e.currentTarget).data('bs.' + this.type)
429
+ if (!self) {
430
+ self = new this.constructor(e.currentTarget, this.getDelegateOptions())
431
+ $(e.currentTarget).data('bs.' + this.type, self)
432
+ }
433
+ }
434
+
435
+ self.tip().hasClass('in') ? self.leave(self) : self.enter(self)
436
+ }
437
+
438
+ Tooltip.prototype.destroy = function () {
439
+ var that = this
440
+ clearTimeout(this.timeout)
441
+ this.hide(function () {
442
+ that.$element.off('.' + that.type).removeData('bs.' + that.type)
443
+ })
444
+ }
445
+
446
+
447
+ // TOOLTIP PLUGIN DEFINITION
448
+ // =========================
449
+
450
+ function Plugin(option) {
451
+ return this.each(function () {
452
+ var $this = $(this)
453
+ var data = $this.data('bs.tooltip')
454
+ var options = typeof option == 'object' && option
455
+
456
+ if (!data && /destroy|hide/.test(option)) return
457
+ if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
458
+ if (typeof option == 'string') data[option]()
459
+ })
460
+ }
461
+
462
+ var old = $.fn.tooltip
463
+
464
+ $.fn.tooltip = Plugin
465
+ $.fn.tooltip.Constructor = Tooltip
466
+
467
+
468
+ // TOOLTIP NO CONFLICT
469
+ // ===================
470
+
471
+ $.fn.tooltip.noConflict = function () {
472
+ $.fn.tooltip = old
473
+ return this
474
+ }
475
+
476
+ }(jQuery);