flashgrid 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +4 -0
  3. data/Gemfile.lock +17 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +78 -0
  6. data/Rakefile +1 -0
  7. data/app/assets/fonts/gotham/gotham-bold.eot +0 -0
  8. data/app/assets/fonts/gotham/gotham-bold.svg +2066 -0
  9. data/app/assets/fonts/gotham/gotham-bold.ttf +0 -0
  10. data/app/assets/fonts/gotham/gotham-bold.woff +0 -0
  11. data/app/assets/fonts/gotham/gotham-book.eot +0 -0
  12. data/app/assets/fonts/gotham/gotham-book.svg +631 -0
  13. data/app/assets/fonts/gotham/gotham-book.ttf +0 -0
  14. data/app/assets/fonts/gotham/gotham-book.woff +0 -0
  15. data/app/assets/fonts/gotham/gotham-light.eot +0 -0
  16. data/app/assets/fonts/gotham/gotham-light.svg +635 -0
  17. data/app/assets/fonts/gotham/gotham-light.ttf +0 -0
  18. data/app/assets/fonts/gotham/gotham-light.woff +0 -0
  19. data/app/assets/fonts/gotham/gotham-medium.eot +0 -0
  20. data/app/assets/fonts/gotham/gotham-medium.svg +629 -0
  21. data/app/assets/fonts/gotham/gotham-medium.ttf +0 -0
  22. data/app/assets/fonts/gotham/gotham-medium.woff +0 -0
  23. data/app/assets/fonts/ionicons/ionicons.eot +0 -0
  24. data/app/assets/fonts/ionicons/ionicons.svg +1623 -0
  25. data/app/assets/fonts/ionicons/ionicons.ttf +0 -0
  26. data/app/assets/fonts/ionicons/ionicons.woff +0 -0
  27. data/flashgrid.gemspec +23 -0
  28. data/lib/flashgrid.rb +6 -0
  29. data/lib/flashgrid/version.rb +3 -0
  30. data/vendor/assets/javascripts/affix.js +127 -0
  31. data/vendor/assets/javascripts/alert.js +78 -0
  32. data/vendor/assets/javascripts/collapse.js +159 -0
  33. data/vendor/assets/javascripts/date_picker.js +1645 -0
  34. data/vendor/assets/javascripts/dropdown.js +134 -0
  35. data/vendor/assets/javascripts/file_input.js +94 -0
  36. data/vendor/assets/javascripts/map.js +2065 -0
  37. data/vendor/assets/javascripts/modal.js +226 -0
  38. data/vendor/assets/javascripts/popover.js +97 -0
  39. data/vendor/assets/javascripts/switch.js +346 -0
  40. data/vendor/assets/javascripts/tab.js +115 -0
  41. data/vendor/assets/javascripts/time_picker.js +1087 -0
  42. data/vendor/assets/javascripts/tooltip.js +365 -0
  43. data/vendor/assets/javascripts/transition.js +36 -0
  44. data/vendor/assets/stylesheets/ad.css.scss +72 -0
  45. data/vendor/assets/stylesheets/affix.css.scss +7 -0
  46. data/vendor/assets/stylesheets/alert.css.scss +72 -0
  47. data/vendor/assets/stylesheets/breadcrumb.css.scss +26 -0
  48. data/vendor/assets/stylesheets/button.css.scss +227 -0
  49. data/vendor/assets/stylesheets/code.css.scss +49 -0
  50. data/vendor/assets/stylesheets/collapse.css.scss +15 -0
  51. data/vendor/assets/stylesheets/datepicker.css.scss +122 -0
  52. data/vendor/assets/stylesheets/dropdown.css.scss +83 -0
  53. data/vendor/assets/stylesheets/footer.css.scss +33 -0
  54. data/vendor/assets/stylesheets/form.css.scss +213 -0
  55. data/vendor/assets/stylesheets/grid.css.scss +291 -0
  56. data/vendor/assets/stylesheets/header.css.scss +134 -0
  57. data/vendor/assets/stylesheets/icon.css.scss +1130 -0
  58. data/vendor/assets/stylesheets/image.css.scss +108 -0
  59. data/vendor/assets/stylesheets/label_and_badge.css.scss +53 -0
  60. data/vendor/assets/stylesheets/link.css.scss +21 -0
  61. data/vendor/assets/stylesheets/list.css.scss +38 -0
  62. data/vendor/assets/stylesheets/map.css.scss +13 -0
  63. data/vendor/assets/stylesheets/modal.css.scss +117 -0
  64. data/vendor/assets/stylesheets/pagination.css.scss +37 -0
  65. data/vendor/assets/stylesheets/placeholder.css.scss +27 -0
  66. data/vendor/assets/stylesheets/popover.css.scss +107 -0
  67. data/vendor/assets/stylesheets/progress.css.scss +25 -0
  68. data/vendor/assets/stylesheets/reset.css.scss +56 -0
  69. data/vendor/assets/stylesheets/switch.css.scss +73 -0
  70. data/vendor/assets/stylesheets/tab.css.scss +179 -0
  71. data/vendor/assets/stylesheets/table.css.scss +73 -0
  72. data/vendor/assets/stylesheets/timepicker.css.scss +81 -0
  73. data/vendor/assets/stylesheets/tooltip.css.scss +81 -0
  74. data/vendor/assets/stylesheets/transition.css.scss +12 -0
  75. data/vendor/assets/stylesheets/trunk.css.scss +69 -0
  76. data/vendor/assets/stylesheets/typography.css.scss +160 -0
  77. metadata +148 -0
@@ -0,0 +1,365 @@
1
+ +function ($) { "use strict";
2
+
3
+ // TOOLTIP PUBLIC CLASS DEFINITION
4
+ // ===============================
5
+
6
+ var Tooltip = function (element, options) {
7
+ this.type =
8
+ this.options =
9
+ this.enabled =
10
+ this.timeout =
11
+ this.hoverState =
12
+ this.$element = null
13
+
14
+ this.init('tooltip', element, options)
15
+ }
16
+
17
+ Tooltip.DEFAULTS = {
18
+ animation: true
19
+ , placement: 'top'
20
+ , selector: false
21
+ , template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
22
+ , trigger: 'hover focus'
23
+ , title: ''
24
+ , delay: 0
25
+ , html: false
26
+ , container: false
27
+ }
28
+
29
+ Tooltip.prototype.init = function (type, element, options) {
30
+ this.enabled = true
31
+ this.type = type
32
+ this.$element = $(element)
33
+ this.options = this.getOptions(options)
34
+
35
+ var triggers = this.options.trigger.split(' ')
36
+
37
+ for (var i = triggers.length; i--;) {
38
+ var trigger = triggers[i]
39
+
40
+ if (trigger == 'click') {
41
+ this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
42
+ } else if (trigger != 'manual') {
43
+ var eventIn = trigger == 'hover' ? 'mouseenter' : 'focus'
44
+ var eventOut = trigger == 'hover' ? 'mouseleave' : 'blur'
45
+
46
+ this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
47
+ this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
48
+ }
49
+ }
50
+
51
+ this.options.selector ?
52
+ (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
53
+ this.fixTitle()
54
+ }
55
+
56
+ Tooltip.prototype.getDefaults = function () {
57
+ return Tooltip.DEFAULTS
58
+ }
59
+
60
+ Tooltip.prototype.getOptions = function (options) {
61
+ options = $.extend({}, this.getDefaults(), this.$element.data(), options)
62
+
63
+ if (options.delay && typeof options.delay == 'number') {
64
+ options.delay = {
65
+ show: options.delay
66
+ , hide: options.delay
67
+ }
68
+ }
69
+
70
+ return options
71
+ }
72
+
73
+ Tooltip.prototype.getDelegateOptions = function () {
74
+ var options = {}
75
+ var defaults = this.getDefaults()
76
+
77
+ this._options && $.each(this._options, function (key, value) {
78
+ if (defaults[key] != value) options[key] = value
79
+ })
80
+
81
+ return options
82
+ }
83
+
84
+ Tooltip.prototype.enter = function (obj) {
85
+ var self = obj instanceof this.constructor ?
86
+ obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type)
87
+
88
+ clearTimeout(self.timeout)
89
+
90
+ self.hoverState = 'in'
91
+
92
+ if (!self.options.delay || !self.options.delay.show) return self.show()
93
+
94
+ self.timeout = setTimeout(function () {
95
+ if (self.hoverState == 'in') self.show()
96
+ }, self.options.delay.show)
97
+ }
98
+
99
+ Tooltip.prototype.leave = function (obj) {
100
+ var self = obj instanceof this.constructor ?
101
+ obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type)
102
+
103
+ clearTimeout(self.timeout)
104
+
105
+ self.hoverState = 'out'
106
+
107
+ if (!self.options.delay || !self.options.delay.hide) return self.hide()
108
+
109
+ self.timeout = setTimeout(function () {
110
+ if (self.hoverState == 'out') self.hide()
111
+ }, self.options.delay.hide)
112
+ }
113
+
114
+ Tooltip.prototype.show = function () {
115
+ var e = $.Event('show.bs.'+ this.type)
116
+
117
+ if (this.hasContent() && this.enabled) {
118
+ this.$element.trigger(e)
119
+
120
+ if (e.isDefaultPrevented()) return
121
+
122
+ var $tip = this.tip()
123
+
124
+ this.setContent()
125
+
126
+ if (this.options.animation) $tip.addClass('fade')
127
+
128
+ var placement = typeof this.options.placement == 'function' ?
129
+ this.options.placement.call(this, $tip[0], this.$element[0]) :
130
+ this.options.placement
131
+
132
+ var autoToken = /\s?auto?\s?/i
133
+ var autoPlace = autoToken.test(placement)
134
+ if (autoPlace) placement = placement.replace(autoToken, '') || 'top'
135
+
136
+ $tip
137
+ .detach()
138
+ .css({ top: 0, left: 0, display: 'block' })
139
+ .addClass(placement)
140
+
141
+ this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
142
+
143
+ var pos = this.getPosition()
144
+ var actualWidth = $tip[0].offsetWidth
145
+ var actualHeight = $tip[0].offsetHeight
146
+
147
+ if (autoPlace) {
148
+ var $parent = this.$element.parent()
149
+
150
+ var orgPlacement = placement
151
+ var docScroll = document.documentElement.scrollTop || document.body.scrollTop
152
+ var parentWidth = this.options.container == 'body' ? window.innerWidth : $parent.outerWidth()
153
+ var parentHeight = this.options.container == 'body' ? window.innerHeight : $parent.outerHeight()
154
+ var parentLeft = this.options.container == 'body' ? 0 : $parent.offset().left
155
+
156
+ placement = placement == 'bottom' && pos.top + pos.height + actualHeight - docScroll > parentHeight ? 'top' :
157
+ placement == 'top' && pos.top - docScroll - actualHeight < 0 ? 'bottom' :
158
+ placement == 'right' && pos.right + actualWidth > parentWidth ? 'left' :
159
+ placement == 'left' && pos.left - actualWidth < parentLeft ? 'right' :
160
+ placement
161
+
162
+ $tip
163
+ .removeClass(orgPlacement)
164
+ .addClass(placement)
165
+ }
166
+
167
+ var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight)
168
+
169
+ this.applyPlacement(calculatedOffset, placement)
170
+ this.$element.trigger('shown.bs.' + this.type)
171
+ }
172
+ }
173
+
174
+ Tooltip.prototype.applyPlacement = function(offset, placement) {
175
+ var replace
176
+ var $tip = this.tip()
177
+ var width = $tip[0].offsetWidth
178
+ var height = $tip[0].offsetHeight
179
+
180
+ // manually read margins because getBoundingClientRect includes difference
181
+ var marginTop = parseInt($tip.css('margin-top'), 10)
182
+ var marginLeft = parseInt($tip.css('margin-left'), 10)
183
+
184
+ // we must check for NaN for ie 8/9
185
+ if (isNaN(marginTop)) marginTop = 0
186
+ if (isNaN(marginLeft)) marginLeft = 0
187
+
188
+ offset.top = offset.top + marginTop
189
+ offset.left = offset.left + marginLeft
190
+
191
+ $tip
192
+ .offset(offset)
193
+ .addClass('in')
194
+
195
+ // check to see if placing tip in new offset caused the tip to resize itself
196
+ var actualWidth = $tip[0].offsetWidth
197
+ var actualHeight = $tip[0].offsetHeight
198
+
199
+ if (placement == 'top' && actualHeight != height) {
200
+ replace = true
201
+ offset.top = offset.top + height - actualHeight
202
+ }
203
+
204
+ if (/bottom|top/.test(placement)) {
205
+ var delta = 0
206
+
207
+ if (offset.left < 0) {
208
+ delta = offset.left * -2
209
+ offset.left = 0
210
+
211
+ $tip.offset(offset)
212
+
213
+ actualWidth = $tip[0].offsetWidth
214
+ actualHeight = $tip[0].offsetHeight
215
+ }
216
+
217
+ this.replaceArrow(delta - width + actualWidth, actualWidth, 'left')
218
+ } else {
219
+ this.replaceArrow(actualHeight - height, actualHeight, 'top')
220
+ }
221
+
222
+ if (replace) $tip.offset(offset)
223
+ }
224
+
225
+ Tooltip.prototype.replaceArrow = function(delta, dimension, position) {
226
+ this.arrow().css(position, delta ? (50 * (1 - delta / dimension) + "%") : '')
227
+ }
228
+
229
+ Tooltip.prototype.setContent = function () {
230
+ var $tip = this.tip()
231
+ var title = this.getTitle()
232
+
233
+ $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
234
+ $tip.removeClass('fade in top bottom left right')
235
+ }
236
+
237
+ Tooltip.prototype.hide = function () {
238
+ var that = this
239
+ var $tip = this.tip()
240
+ var e = $.Event('hide.bs.' + this.type)
241
+
242
+ function complete() {
243
+ if (that.hoverState != 'in') $tip.detach()
244
+ }
245
+
246
+ this.$element.trigger(e)
247
+
248
+ if (e.isDefaultPrevented()) return
249
+
250
+ $tip.removeClass('in')
251
+
252
+ $.support.transition && this.$tip.hasClass('fade') ?
253
+ $tip
254
+ .one($.support.transition.end, complete)
255
+ .emulateTransitionEnd(150) :
256
+ complete()
257
+
258
+ this.$element.trigger('hidden.bs.' + this.type)
259
+
260
+ return this
261
+ }
262
+
263
+ Tooltip.prototype.fixTitle = function () {
264
+ var $e = this.$element
265
+ if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
266
+ $e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
267
+ }
268
+ }
269
+
270
+ Tooltip.prototype.hasContent = function () {
271
+ return this.getTitle()
272
+ }
273
+
274
+ Tooltip.prototype.getPosition = function () {
275
+ var el = this.$element[0]
276
+ return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : {
277
+ width: el.offsetWidth
278
+ , height: el.offsetHeight
279
+ }, this.$element.offset())
280
+ }
281
+
282
+ Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {
283
+ return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } :
284
+ placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } :
285
+ placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } :
286
+ /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width }
287
+ }
288
+
289
+ Tooltip.prototype.getTitle = function () {
290
+ var title
291
+ var $e = this.$element
292
+ var o = this.options
293
+
294
+ title = $e.attr('data-original-title')
295
+ || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
296
+
297
+ return title
298
+ }
299
+
300
+ Tooltip.prototype.tip = function () {
301
+ return this.$tip = this.$tip || $(this.options.template)
302
+ }
303
+
304
+ Tooltip.prototype.arrow = function () {
305
+ return this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow')
306
+ }
307
+
308
+ Tooltip.prototype.validate = function () {
309
+ if (!this.$element[0].parentNode) {
310
+ this.hide()
311
+ this.$element = null
312
+ this.options = null
313
+ }
314
+ }
315
+
316
+ Tooltip.prototype.enable = function () {
317
+ this.enabled = true
318
+ }
319
+
320
+ Tooltip.prototype.disable = function () {
321
+ this.enabled = false
322
+ }
323
+
324
+ Tooltip.prototype.toggleEnabled = function () {
325
+ this.enabled = !this.enabled
326
+ }
327
+
328
+ Tooltip.prototype.toggle = function (e) {
329
+ var self = e ? $(e.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type) : this
330
+ self.tip().hasClass('in') ? self.leave(self) : self.enter(self)
331
+ }
332
+
333
+ Tooltip.prototype.destroy = function () {
334
+ this.hide().$element.off('.' + this.type).removeData('bs.' + this.type)
335
+ }
336
+
337
+
338
+ // TOOLTIP PLUGIN DEFINITION
339
+ // =========================
340
+
341
+ var old = $.fn.tooltip
342
+
343
+ $.fn.tooltip = function (option) {
344
+ return this.each(function () {
345
+ var $this = $(this)
346
+ var data = $this.data('bs.tooltip')
347
+ var options = typeof option == 'object' && option
348
+
349
+ if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
350
+ if (typeof option == 'string') data[option]()
351
+ })
352
+ }
353
+
354
+ $.fn.tooltip.Constructor = Tooltip
355
+
356
+
357
+ // TOOLTIP NO CONFLICT
358
+ // ===================
359
+
360
+ $.fn.tooltip.noConflict = function () {
361
+ $.fn.tooltip = old
362
+ return this
363
+ }
364
+
365
+ }(jQuery);
@@ -0,0 +1,36 @@
1
+ +function ($) { "use strict";
2
+
3
+ // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
4
+ // ============================================================
5
+
6
+ function transitionEnd() {
7
+ var el = document.createElement('bootstrap')
8
+
9
+ var transEndEventNames = {
10
+ 'WebkitTransition' : 'webkitTransitionEnd'
11
+ , 'MozTransition' : 'transitionend'
12
+ , 'OTransition' : 'oTransitionEnd otransitionend'
13
+ , 'transition' : 'transitionend'
14
+ }
15
+
16
+ for (var name in transEndEventNames) {
17
+ if (el.style[name] !== undefined) {
18
+ return { end: transEndEventNames[name] }
19
+ }
20
+ }
21
+ }
22
+
23
+ // http://blog.alexmaccaw.com/css-transitions
24
+ $.fn.emulateTransitionEnd = function (duration) {
25
+ var called = false, $el = this
26
+ $(this).one($.support.transition.end, function () { called = true })
27
+ var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
28
+ setTimeout(callback, duration)
29
+ return this
30
+ }
31
+
32
+ $(function () {
33
+ $.support.transition = transitionEnd()
34
+ })
35
+
36
+ }(jQuery);
@@ -0,0 +1,72 @@
1
+ /* Table of Contents
2
+ ==================================================
3
+ #Ad */
4
+
5
+ /* #Ad
6
+ ================================================== */
7
+ .ad {
8
+ background-color: rgba(236,238,241,1);
9
+ height: 220px;
10
+ width: 220px;
11
+ }
12
+ .ad-large-rectangle {
13
+ height: 280px;
14
+ width: 336px;
15
+ }
16
+ .ad-medium-rectangle {
17
+ height: 250px;
18
+ width: 300px;
19
+ }
20
+ .ad-small-rectangle {
21
+ height: 150px;
22
+ width: 180px;
23
+ }
24
+ .ad-square {
25
+ height: 250px;
26
+ width: 250px;
27
+ }
28
+ .ad-small-square {
29
+ height: 200px;
30
+ width: 200px;
31
+ }
32
+ .ad-button {
33
+ height: 125px;
34
+ width: 125px;
35
+ }
36
+ .ad-large-leaderboard {
37
+ height: 90px;
38
+ width: 970px;
39
+ }
40
+ .ad-leaderboard {
41
+ height: 90px;
42
+ width: 728px;
43
+ }
44
+ .ad-banner {
45
+ height: 60px;
46
+ width: 468px;
47
+ }
48
+ .ad-half-banner {
49
+ height: 60px;
50
+ width: 234px;
51
+ }
52
+ .ad-mobile-banner {
53
+ height: 50px;
54
+ width: 320px;
55
+ }
56
+ .ad-vertical-banner {
57
+ height: 240px;
58
+ width: 120px;
59
+ }
60
+ .ad-large-skyscrapper {
61
+ height: 600px;
62
+ width: 300px;
63
+ }
64
+ .ad-wide-skyscrapper {
65
+ height: 600px;
66
+ width: 160px;
67
+ }
68
+ .ad-skyscrapper {
69
+ height: 600px;
70
+ width: 120px;
71
+ }
72
+ .ad-center { margin: 0 auto; }