active_frontend 1.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 (96) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +14 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +97 -0
  6. data/Rakefile +1 -0
  7. data/active_frontend.gemspec +23 -0
  8. data/app/assets/fonts/gotham/gotham-bold.eot +0 -0
  9. data/app/assets/fonts/gotham/gotham-bold.svg +2066 -0
  10. data/app/assets/fonts/gotham/gotham-bold.ttf +0 -0
  11. data/app/assets/fonts/gotham/gotham-bold.woff +0 -0
  12. data/app/assets/fonts/gotham/gotham-book.eot +0 -0
  13. data/app/assets/fonts/gotham/gotham-book.svg +631 -0
  14. data/app/assets/fonts/gotham/gotham-book.ttf +0 -0
  15. data/app/assets/fonts/gotham/gotham-book.woff +0 -0
  16. data/app/assets/fonts/gotham/gotham-light.eot +0 -0
  17. data/app/assets/fonts/gotham/gotham-light.svg +635 -0
  18. data/app/assets/fonts/gotham/gotham-light.ttf +0 -0
  19. data/app/assets/fonts/gotham/gotham-light.woff +0 -0
  20. data/app/assets/fonts/gotham/gotham-medium.eot +0 -0
  21. data/app/assets/fonts/gotham/gotham-medium.svg +629 -0
  22. data/app/assets/fonts/gotham/gotham-medium.ttf +0 -0
  23. data/app/assets/fonts/gotham/gotham-medium.woff +0 -0
  24. data/app/assets/fonts/ionicons/ionicons.eot +0 -0
  25. data/app/assets/fonts/ionicons/ionicons.svg +2232 -0
  26. data/app/assets/fonts/ionicons/ionicons.ttf +0 -0
  27. data/app/assets/fonts/ionicons/ionicons.woff +0 -0
  28. data/lib/active_frontend.rb +6 -0
  29. data/lib/active_frontend/version.rb +3 -0
  30. data/vendor/assets/javascripts/.keep +0 -0
  31. data/vendor/assets/javascripts/affix.js +153 -0
  32. data/vendor/assets/javascripts/alert.js +85 -0
  33. data/vendor/assets/javascripts/animation.js +45 -0
  34. data/vendor/assets/javascripts/button.js +107 -0
  35. data/vendor/assets/javascripts/carousel.js +228 -0
  36. data/vendor/assets/javascripts/chart.js +3309 -0
  37. data/vendor/assets/javascripts/collapse.js +202 -0
  38. data/vendor/assets/javascripts/date_picker.js +1649 -0
  39. data/vendor/assets/javascripts/dropdown.js +152 -0
  40. data/vendor/assets/javascripts/file_input.js +71 -0
  41. data/vendor/assets/javascripts/hoverdown.js +109 -0
  42. data/vendor/assets/javascripts/map.js +2174 -0
  43. data/vendor/assets/javascripts/modal.js +234 -0
  44. data/vendor/assets/javascripts/popover.js +99 -0
  45. data/vendor/assets/javascripts/scrollspy.js +163 -0
  46. data/vendor/assets/javascripts/sort.js +1432 -0
  47. data/vendor/assets/javascripts/swoggle.js +415 -0
  48. data/vendor/assets/javascripts/tab.js +144 -0
  49. data/vendor/assets/javascripts/tablespy.js +1883 -0
  50. data/vendor/assets/javascripts/time_ago.js +206 -0
  51. data/vendor/assets/javascripts/time_picker.js +1087 -0
  52. data/vendor/assets/javascripts/tooltip.js +466 -0
  53. data/vendor/assets/javascripts/transition.js +50 -0
  54. data/vendor/assets/javascripts/typeahead.js +368 -0
  55. data/vendor/assets/stylesheets/.keep +0 -0
  56. data/vendor/assets/stylesheets/ad.scss +72 -0
  57. data/vendor/assets/stylesheets/affix.scss +11 -0
  58. data/vendor/assets/stylesheets/alert.scss +57 -0
  59. data/vendor/assets/stylesheets/animation.scss +2388 -0
  60. data/vendor/assets/stylesheets/aside.scss +136 -0
  61. data/vendor/assets/stylesheets/breadcrumb.scss +23 -0
  62. data/vendor/assets/stylesheets/button.scss +581 -0
  63. data/vendor/assets/stylesheets/carousel.scss +152 -0
  64. data/vendor/assets/stylesheets/chart.scss +11 -0
  65. data/vendor/assets/stylesheets/code.scss +139 -0
  66. data/vendor/assets/stylesheets/collapse.scss +15 -0
  67. data/vendor/assets/stylesheets/datepicker.scss +136 -0
  68. data/vendor/assets/stylesheets/dropdown.scss +90 -0
  69. data/vendor/assets/stylesheets/footer.scss +68 -0
  70. data/vendor/assets/stylesheets/form.scss +346 -0
  71. data/vendor/assets/stylesheets/grid.scss +287 -0
  72. data/vendor/assets/stylesheets/header.scss +205 -0
  73. data/vendor/assets/stylesheets/icon.scss +1538 -0
  74. data/vendor/assets/stylesheets/image.scss +330 -0
  75. data/vendor/assets/stylesheets/label_and_badge.scss +110 -0
  76. data/vendor/assets/stylesheets/link.scss +25 -0
  77. data/vendor/assets/stylesheets/list.scss +60 -0
  78. data/vendor/assets/stylesheets/map.scss +13 -0
  79. data/vendor/assets/stylesheets/modal.scss +137 -0
  80. data/vendor/assets/stylesheets/nav_and_tab.scss +183 -0
  81. data/vendor/assets/stylesheets/pagination.scss +41 -0
  82. data/vendor/assets/stylesheets/panel.scss +62 -0
  83. data/vendor/assets/stylesheets/placeholder.scss +44 -0
  84. data/vendor/assets/stylesheets/popover.scss +117 -0
  85. data/vendor/assets/stylesheets/progress.scss +43 -0
  86. data/vendor/assets/stylesheets/reset.scss +88 -0
  87. data/vendor/assets/stylesheets/spinner.scss +767 -0
  88. data/vendor/assets/stylesheets/swoggle.scss +126 -0
  89. data/vendor/assets/stylesheets/table.scss +149 -0
  90. data/vendor/assets/stylesheets/timepicker.scss +75 -0
  91. data/vendor/assets/stylesheets/tooltip.scss +90 -0
  92. data/vendor/assets/stylesheets/transition.scss +12 -0
  93. data/vendor/assets/stylesheets/trunk.scss +116 -0
  94. data/vendor/assets/stylesheets/typeahead.scss +8 -0
  95. data/vendor/assets/stylesheets/typography.scss +191 -0
  96. metadata +167 -0
@@ -0,0 +1,234 @@
1
+ +function ($) {
2
+ 'use strict';
3
+
4
+ // MODAL CLASS DEFINITION
5
+ // ======================
6
+
7
+ var Modal = function (element, options) {
8
+ this.options = options
9
+ this.$element = $(element)
10
+ this.$backdrop =
11
+ this.isShown = null
12
+
13
+ if (this.options.remote) {
14
+ this.$element
15
+ .find('.modal-content')
16
+ .load(this.options.remote, $.proxy(function () {
17
+ this.$element.trigger('loaded.bs.modal')
18
+ }, this))
19
+ }
20
+ }
21
+
22
+ Modal.DEFAULTS = {
23
+ backdrop: true,
24
+ keyboard: true,
25
+ show: true
26
+ }
27
+
28
+ Modal.prototype.toggle = function (_relatedTarget) {
29
+ return this[!this.isShown ? 'show' : 'hide'](_relatedTarget)
30
+ }
31
+
32
+ Modal.prototype.show = function (_relatedTarget) {
33
+ var that = this
34
+ var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
35
+
36
+ this.$element.trigger(e)
37
+
38
+ if (this.isShown || e.isDefaultPrevented()) return
39
+
40
+ this.isShown = true
41
+
42
+ this.escape()
43
+
44
+ this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
45
+
46
+ this.backdrop(function () {
47
+ var transition = $.support.transition && that.$element.hasClass('fade')
48
+
49
+ if (!that.$element.parent().length) {
50
+ that.$element.appendTo(document.body) // don't move modals dom position
51
+ }
52
+
53
+ that.$element
54
+ .show()
55
+ .scrollTop(0)
56
+
57
+ if (transition) {
58
+ that.$element[0].offsetWidth // force reflow
59
+ }
60
+
61
+ that.$element
62
+ .addClass('in')
63
+ .attr('aria-hidden', false)
64
+
65
+ that.enforceFocus()
66
+
67
+ var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget })
68
+
69
+ transition ?
70
+ that.$element.find('.modal-dialog') // wait for modal to slide in
71
+ .one($.support.transition.end, function () {
72
+ that.$element.focus().trigger(e)
73
+ })
74
+ .emulateTransitionEnd(300) :
75
+ that.$element.focus().trigger(e)
76
+ })
77
+ }
78
+
79
+ Modal.prototype.hide = function (e) {
80
+ if (e) e.preventDefault()
81
+
82
+ e = $.Event('hide.bs.modal')
83
+
84
+ this.$element.trigger(e)
85
+
86
+ if (!this.isShown || e.isDefaultPrevented()) return
87
+
88
+ this.isShown = false
89
+
90
+ this.escape()
91
+
92
+ $(document).off('focusin.bs.modal')
93
+
94
+ this.$element
95
+ .removeClass('in')
96
+ .attr('aria-hidden', true)
97
+ .off('click.dismiss.bs.modal')
98
+
99
+ $.support.transition && this.$element.hasClass('fade') ?
100
+ this.$element
101
+ .one($.support.transition.end, $.proxy(this.hideModal, this))
102
+ .emulateTransitionEnd(300) :
103
+ this.hideModal()
104
+ }
105
+
106
+ Modal.prototype.enforceFocus = function () {
107
+ $(document)
108
+ .off('focusin.bs.modal') // guard against infinite focus loop
109
+ .on('focusin.bs.modal', $.proxy(function (e) {
110
+ if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {
111
+ this.$element.focus()
112
+ }
113
+ }, this))
114
+ }
115
+
116
+ Modal.prototype.escape = function () {
117
+ if (this.isShown && this.options.keyboard) {
118
+ this.$element.on('keyup.dismiss.bs.modal', $.proxy(function (e) {
119
+ e.which == 27 && this.hide()
120
+ }, this))
121
+ } else if (!this.isShown) {
122
+ this.$element.off('keyup.dismiss.bs.modal')
123
+ }
124
+ }
125
+
126
+ Modal.prototype.hideModal = function () {
127
+ var that = this
128
+ this.$element.hide()
129
+ this.backdrop(function () {
130
+ that.removeBackdrop()
131
+ that.$element.trigger('hidden.bs.modal')
132
+ })
133
+ }
134
+
135
+ Modal.prototype.removeBackdrop = function () {
136
+ this.$backdrop && this.$backdrop.remove()
137
+ this.$backdrop = null
138
+ }
139
+
140
+ Modal.prototype.backdrop = function (callback) {
141
+ var animate = this.$element.hasClass('fade') ? 'fade' : ''
142
+
143
+ if (this.isShown && this.options.backdrop) {
144
+ var doAnimate = $.support.transition && animate
145
+
146
+ this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
147
+ .appendTo(document.body)
148
+
149
+ this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {
150
+ if (e.target !== e.currentTarget) return
151
+ this.options.backdrop == 'static'
152
+ ? this.$element[0].focus.call(this.$element[0])
153
+ : this.hide.call(this)
154
+ }, this))
155
+
156
+ if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
157
+
158
+ this.$backdrop.addClass('in')
159
+
160
+ if (!callback) return
161
+
162
+ doAnimate ?
163
+ this.$backdrop
164
+ .one($.support.transition.end, callback)
165
+ .emulateTransitionEnd(150) :
166
+ callback()
167
+
168
+ } else if (!this.isShown && this.$backdrop) {
169
+ this.$backdrop.removeClass('in')
170
+
171
+ $.support.transition && this.$element.hasClass('fade') ?
172
+ this.$backdrop
173
+ .one($.support.transition.end, callback)
174
+ .emulateTransitionEnd(150) :
175
+ callback()
176
+
177
+ } else if (callback) {
178
+ callback()
179
+ }
180
+ }
181
+
182
+
183
+ // MODAL PLUGIN DEFINITION
184
+ // =======================
185
+
186
+ var old = $.fn.modal
187
+
188
+ $.fn.modal = function (option, _relatedTarget) {
189
+ return this.each(function () {
190
+ var $this = $(this)
191
+ var data = $this.data('bs.modal')
192
+ var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
193
+
194
+ if (!data) $this.data('bs.modal', (data = new Modal(this, options)))
195
+ if (typeof option == 'string') data[option](_relatedTarget)
196
+ else if (options.show) data.show(_relatedTarget)
197
+ })
198
+ }
199
+
200
+ $.fn.modal.Constructor = Modal
201
+
202
+
203
+ // MODAL NO CONFLICT
204
+ // =================
205
+
206
+ $.fn.modal.noConflict = function () {
207
+ $.fn.modal = old
208
+ return this
209
+ }
210
+
211
+
212
+ // MODAL DATA-API
213
+ // ==============
214
+
215
+ $(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
216
+ var $this = $(this)
217
+ var href = $this.attr('href')
218
+ var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
219
+ var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
220
+
221
+ if ($this.is('a')) e.preventDefault()
222
+
223
+ $target
224
+ .modal(option, this)
225
+ .one('hide', function () {
226
+ $this.is(':visible') && $this.focus()
227
+ })
228
+ })
229
+
230
+ $(document)
231
+ .on('show.bs.modal', '.modal', function () { $(document.body).addClass('modal-open') })
232
+ .on('hidden.bs.modal', '.modal', function () { $(document.body).removeClass('modal-open') })
233
+
234
+ }(jQuery);
@@ -0,0 +1,99 @@
1
+ +function ($) {
2
+ 'use strict';
3
+
4
+ // POPOVER PUBLIC CLASS DEFINITION
5
+ // ===============================
6
+
7
+ var Popover = function (element, options) {
8
+ this.init('popover', element, options)
9
+ }
10
+
11
+ if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
12
+
13
+ Popover.VERSION = '3.3.2'
14
+
15
+ Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {
16
+ placement: 'right',
17
+ trigger: 'click',
18
+ content: '',
19
+ template: '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
20
+ })
21
+
22
+
23
+ // NOTE: POPOVER EXTENDS tooltip.js
24
+ // ================================
25
+
26
+ Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype)
27
+
28
+ Popover.prototype.constructor = Popover
29
+
30
+ Popover.prototype.getDefaults = function () {
31
+ return Popover.DEFAULTS
32
+ }
33
+
34
+ Popover.prototype.setContent = function () {
35
+ var $tip = this.tip()
36
+ var title = this.getTitle()
37
+ var content = this.getContent()
38
+
39
+ $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
40
+ $tip.find('.popover-content').children().detach().end()[ // we use append for html objects to maintain js events
41
+ this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text'
42
+ ](content)
43
+
44
+ $tip.removeClass('fade top bottom left right in')
45
+
46
+ // IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do
47
+ // this manually by checking the contents.
48
+ if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide()
49
+ }
50
+
51
+ Popover.prototype.hasContent = function () {
52
+ return this.getTitle() || this.getContent()
53
+ }
54
+
55
+ Popover.prototype.getContent = function () {
56
+ var $e = this.$element
57
+ var o = this.options
58
+
59
+ return $e.attr('data-content')
60
+ || (typeof o.content == 'function' ?
61
+ o.content.call($e[0]) :
62
+ o.content)
63
+ }
64
+
65
+ Popover.prototype.arrow = function () {
66
+ return (this.$arrow = this.$arrow || this.tip().find('.arrow'))
67
+ }
68
+
69
+
70
+ // POPOVER PLUGIN DEFINITION
71
+ // =========================
72
+
73
+ function Plugin(option) {
74
+ return this.each(function () {
75
+ var $this = $(this)
76
+ var data = $this.data('bs.popover')
77
+ var options = typeof option == 'object' && option
78
+
79
+ if (!data && option == 'destroy') return
80
+ if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
81
+ if (typeof option == 'string') data[option]()
82
+ })
83
+ }
84
+
85
+ var old = $.fn.popover
86
+
87
+ $.fn.popover = Plugin
88
+ $.fn.popover.Constructor = Popover
89
+
90
+
91
+ // POPOVER NO CONFLICT
92
+ // ===================
93
+
94
+ $.fn.popover.noConflict = function () {
95
+ $.fn.popover = old
96
+ return this
97
+ }
98
+
99
+ }(jQuery);
@@ -0,0 +1,163 @@
1
+ +function ($) {
2
+ 'use strict';
3
+
4
+ // SCROLLSPY CLASS DEFINITION
5
+ // ==========================
6
+
7
+ function ScrollSpy(element, options) {
8
+ this.$body = $(document.body)
9
+ this.$scrollElement = $(element).is(document.body) ? $(window) : $(element)
10
+ this.options = $.extend({}, ScrollSpy.DEFAULTS, options)
11
+ this.selector = (this.options.target || '') + ' .nav li > a'
12
+ this.offsets = []
13
+ this.targets = []
14
+ this.activeTarget = null
15
+ this.scrollHeight = 0
16
+
17
+ this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this))
18
+ this.refresh()
19
+ this.process()
20
+ }
21
+
22
+ ScrollSpy.VERSION = '3.3.2'
23
+
24
+ ScrollSpy.DEFAULTS = {
25
+ offset: 10
26
+ }
27
+
28
+ ScrollSpy.prototype.getScrollHeight = function () {
29
+ return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight)
30
+ }
31
+
32
+ ScrollSpy.prototype.refresh = function () {
33
+ var that = this
34
+ var offsetMethod = 'offset'
35
+ var offsetBase = 0
36
+
37
+ this.offsets = []
38
+ this.targets = []
39
+ this.scrollHeight = this.getScrollHeight()
40
+
41
+ if (!$.isWindow(this.$scrollElement[0])) {
42
+ offsetMethod = 'position'
43
+ offsetBase = this.$scrollElement.scrollTop()
44
+ }
45
+
46
+ this.$body
47
+ .find(this.selector)
48
+ .map(function () {
49
+ var $el = $(this)
50
+ var href = $el.data('target') || $el.attr('href')
51
+ var $href = /^#./.test(href) && $(href)
52
+
53
+ return ($href
54
+ && $href.length
55
+ && $href.is(':visible')
56
+ && [[$href[offsetMethod]().top + offsetBase, href]]) || null
57
+ })
58
+ .sort(function (a, b) { return a[0] - b[0] })
59
+ .each(function () {
60
+ that.offsets.push(this[0])
61
+ that.targets.push(this[1])
62
+ })
63
+ }
64
+
65
+ ScrollSpy.prototype.process = function () {
66
+ var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
67
+ var scrollHeight = this.getScrollHeight()
68
+ var maxScroll = this.options.offset + scrollHeight - this.$scrollElement.height()
69
+ var offsets = this.offsets
70
+ var targets = this.targets
71
+ var activeTarget = this.activeTarget
72
+ var i
73
+
74
+ if (this.scrollHeight != scrollHeight) {
75
+ this.refresh()
76
+ }
77
+
78
+ if (scrollTop >= maxScroll) {
79
+ return activeTarget != (i = targets[targets.length - 1]) && this.activate(i)
80
+ }
81
+
82
+ if (activeTarget && scrollTop < offsets[0]) {
83
+ this.activeTarget = null
84
+ return this.clear()
85
+ }
86
+
87
+ for (i = offsets.length; i--;) {
88
+ activeTarget != targets[i]
89
+ && scrollTop >= offsets[i]
90
+ && (offsets[i + 1] === undefined || scrollTop <= offsets[i + 1])
91
+ && this.activate(targets[i])
92
+ }
93
+ }
94
+
95
+ ScrollSpy.prototype.activate = function (target) {
96
+ this.activeTarget = target
97
+
98
+ this.clear()
99
+
100
+ var selector = this.selector +
101
+ '[data-target="' + target + '"],' +
102
+ this.selector + '[href="' + target + '"]'
103
+
104
+ var active = $(selector)
105
+ .parents('li')
106
+ .addClass('active')
107
+
108
+ if (active.parent('.dropdown-menu').length) {
109
+ active = active
110
+ .closest('li.dropdown')
111
+ .addClass('active')
112
+ }
113
+
114
+ active.trigger('activate.bs.scrollspy')
115
+ }
116
+
117
+ ScrollSpy.prototype.clear = function () {
118
+ $(this.selector)
119
+ .parentsUntil(this.options.target, '.active')
120
+ .removeClass('active')
121
+ }
122
+
123
+
124
+ // SCROLLSPY PLUGIN DEFINITION
125
+ // ===========================
126
+
127
+ function Plugin(option) {
128
+ return this.each(function () {
129
+ var $this = $(this)
130
+ var data = $this.data('bs.scrollspy')
131
+ var options = typeof option == 'object' && option
132
+
133
+ if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options)))
134
+ if (typeof option == 'string') data[option]()
135
+ })
136
+ }
137
+
138
+ var old = $.fn.scrollspy
139
+
140
+ $.fn.scrollspy = Plugin
141
+ $.fn.scrollspy.Constructor = ScrollSpy
142
+
143
+
144
+ // SCROLLSPY NO CONFLICT
145
+ // =====================
146
+
147
+ $.fn.scrollspy.noConflict = function () {
148
+ $.fn.scrollspy = old
149
+ return this
150
+ }
151
+
152
+
153
+ // SCROLLSPY DATA-API
154
+ // ==================
155
+
156
+ $(window).on('load.bs.scrollspy.data-api', function () {
157
+ $('[data-spy="scroll"]').each(function () {
158
+ var $spy = $(this)
159
+ Plugin.call($spy, $spy.data())
160
+ })
161
+ })
162
+
163
+ }(jQuery);