active_frontend 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
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,50 @@
1
+ +function ($) {
2
+ 'use strict';
3
+
4
+ // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
5
+ // ============================================================
6
+
7
+ function transitionEnd() {
8
+ var el = document.createElement('bootstrap')
9
+
10
+ var transEndEventNames = {
11
+ WebkitTransition : 'webkitTransitionEnd',
12
+ MozTransition : 'transitionend',
13
+ OTransition : 'oTransitionEnd otransitionend',
14
+ transition : 'transitionend'
15
+ }
16
+
17
+ for (var name in transEndEventNames) {
18
+ if (el.style[name] !== undefined) {
19
+ return { end: transEndEventNames[name] }
20
+ }
21
+ }
22
+
23
+ return false // explicit for ie8 ( ._.)
24
+ }
25
+
26
+ // http://blog.alexmaccaw.com/css-transitions
27
+ $.fn.emulateTransitionEnd = function (duration) {
28
+ var called = false
29
+ var $el = this
30
+ $(this).one('bsTransitionEnd', function () { called = true })
31
+ var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
32
+ setTimeout(callback, duration)
33
+ return this
34
+ }
35
+
36
+ $(function () {
37
+ $.support.transition = transitionEnd()
38
+
39
+ if (!$.support.transition) return
40
+
41
+ $.event.special.bsTransitionEnd = {
42
+ bindType: $.support.transition.end,
43
+ delegateType: $.support.transition.end,
44
+ handle: function (e) {
45
+ if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments)
46
+ }
47
+ }
48
+ })
49
+
50
+ }(jQuery);
@@ -0,0 +1,368 @@
1
+ !function($){
2
+
3
+ "use strict";
4
+ // jshint laxcomma: true
5
+
6
+
7
+ /* TYPEAHEAD PUBLIC CLASS DEFINITION
8
+ * ================================= */
9
+
10
+ var Typeahead = function (element, options) {
11
+ this.$element = $(element);
12
+ this.options = $.extend({}, $.fn.typeahead.defaults, options);
13
+ this.matcher = this.options.matcher || this.matcher;
14
+ this.sorter = this.options.sorter || this.sorter;
15
+ this.select = this.options.select || this.select;
16
+ this.autoSelect = typeof this.options.autoSelect == 'boolean' ? this.options.autoSelect : true;
17
+ this.highlighter = this.options.highlighter || this.highlighter;
18
+ this.updater = this.options.updater || this.updater;
19
+ this.source = this.options.source;
20
+ this.$menu = $(this.options.menu);
21
+ this.shown = false;
22
+ this.listen();
23
+ this.showHintOnFocus = typeof this.options.showHintOnFocus == 'boolean' ? this.options.showHintOnFocus : false;
24
+ };
25
+
26
+ Typeahead.prototype = {
27
+
28
+ constructor: Typeahead
29
+
30
+ , select: function () {
31
+ var val = this.$menu.find('.active').data('value');
32
+ if(this.autoSelect || val) {
33
+ this.$element
34
+ .val(this.updater(val))
35
+ .change();
36
+ }
37
+ return this.hide();
38
+ }
39
+
40
+ , updater: function (item) {
41
+ return item;
42
+ }
43
+
44
+ , setSource: function (source) {
45
+ this.source = source;
46
+ }
47
+
48
+ , show: function () {
49
+ var pos = $.extend({}, this.$element.position(), {
50
+ height: this.$element[0].offsetHeight
51
+ }), scrollHeight;
52
+
53
+ scrollHeight = typeof this.options.scrollHeight == 'function' ?
54
+ this.options.scrollHeight.call() :
55
+ this.options.scrollHeight;
56
+
57
+ this.$menu
58
+ .insertAfter(this.$element)
59
+ .css({
60
+ top: pos.top + pos.height + scrollHeight
61
+ , left: pos.left
62
+ })
63
+ .show();
64
+
65
+ this.shown = true;
66
+ return this;
67
+ }
68
+
69
+ , hide: function () {
70
+ this.$menu.hide();
71
+ this.shown = false;
72
+ return this;
73
+ }
74
+
75
+ , lookup: function (query) {
76
+ var items;
77
+ if (typeof(query) != 'undefined' && query !== null) {
78
+ this.query = query;
79
+ } else {
80
+ this.query = this.$element.val() || '';
81
+ }
82
+
83
+ if (this.query.length < this.options.minLength) {
84
+ return this.shown ? this.hide() : this;
85
+ }
86
+
87
+ items = $.isFunction(this.source) ? this.source(this.query, $.proxy(this.process, this)) : this.source;
88
+
89
+ return items ? this.process(items) : this;
90
+ }
91
+
92
+ , process: function (items) {
93
+ var that = this;
94
+
95
+ items = $.grep(items, function (item) {
96
+ return that.matcher(item);
97
+ });
98
+
99
+ items = this.sorter(items);
100
+
101
+ if (!items.length) {
102
+ return this.shown ? this.hide() : this;
103
+ }
104
+
105
+ if (this.options.items == 'all' || this.options.minLength === 0 && !this.$element.val()) {
106
+ return this.render(items).show();
107
+ } else {
108
+ return this.render(items.slice(0, this.options.items)).show();
109
+ }
110
+ }
111
+
112
+ , matcher: function (item) {
113
+ return ~item.toLowerCase().indexOf(this.query.toLowerCase());
114
+ }
115
+
116
+ , sorter: function (items) {
117
+ var beginswith = []
118
+ , caseSensitive = []
119
+ , caseInsensitive = []
120
+ , item;
121
+
122
+ while ((item = items.shift())) {
123
+ if (!item.toLowerCase().indexOf(this.query.toLowerCase())) beginswith.push(item);
124
+ else if (~item.indexOf(this.query)) caseSensitive.push(item);
125
+ else caseInsensitive.push(item);
126
+ }
127
+
128
+ return beginswith.concat(caseSensitive, caseInsensitive);
129
+ }
130
+
131
+ , highlighter: function (item) {
132
+ var query = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&');
133
+ return item.replace(new RegExp('(' + query + ')', 'ig'), function ($1, match) {
134
+ return '<b>' + match + '</b>';
135
+ });
136
+ }
137
+
138
+ , render: function (items) {
139
+ var that = this;
140
+
141
+ items = $(items).map(function (i, item) {
142
+ i = $(that.options.item).data('value', item);
143
+ i.find('a').html(that.highlighter(item));
144
+ return i[0];
145
+ });
146
+
147
+ if (this.autoSelect) {
148
+ items.first().addClass('active');
149
+ }
150
+ this.$menu.html(items);
151
+ return this;
152
+ }
153
+
154
+ , next: function (event) {
155
+ var active = this.$menu.find('.active').removeClass('active')
156
+ , next = active.next();
157
+
158
+ if (!next.length) {
159
+ next = $(this.$menu.find('li')[0]);
160
+ }
161
+
162
+ next.addClass('active');
163
+ }
164
+
165
+ , prev: function (event) {
166
+ var active = this.$menu.find('.active').removeClass('active')
167
+ , prev = active.prev();
168
+
169
+ if (!prev.length) {
170
+ prev = this.$menu.find('li').last();
171
+ }
172
+
173
+ prev.addClass('active');
174
+ }
175
+
176
+ , listen: function () {
177
+ this.$element
178
+ .on('focus', $.proxy(this.focus, this))
179
+ .on('blur', $.proxy(this.blur, this))
180
+ .on('keypress', $.proxy(this.keypress, this))
181
+ .on('keyup', $.proxy(this.keyup, this));
182
+
183
+ if (this.eventSupported('keydown')) {
184
+ this.$element.on('keydown', $.proxy(this.keydown, this));
185
+ }
186
+
187
+ this.$menu
188
+ .on('click', $.proxy(this.click, this))
189
+ .on('mouseenter', 'li', $.proxy(this.mouseenter, this))
190
+ .on('mouseleave', 'li', $.proxy(this.mouseleave, this));
191
+ }
192
+ , destroy : function () {
193
+ this.$element.data('typeahead',null);
194
+ this.$element
195
+ .off('focus')
196
+ .off('blur')
197
+ .off('keypress')
198
+ .off('keyup');
199
+
200
+ if (this.eventSupported('keydown')) {
201
+ this.$element.off('keydown');
202
+ }
203
+
204
+ this.$menu.remove();
205
+ }
206
+ , eventSupported: function(eventName) {
207
+ var isSupported = eventName in this.$element;
208
+ if (!isSupported) {
209
+ this.$element.setAttribute(eventName, 'return;');
210
+ isSupported = typeof this.$element[eventName] === 'function';
211
+ }
212
+ return isSupported;
213
+ }
214
+
215
+ , move: function (e) {
216
+ if (!this.shown) return;
217
+
218
+ switch(e.keyCode) {
219
+ case 9: // tab
220
+ case 13: // enter
221
+ case 27: // escape
222
+ e.preventDefault();
223
+ break;
224
+
225
+ case 38: // up arrow
226
+ e.preventDefault();
227
+ this.prev();
228
+ break;
229
+
230
+ case 40: // down arrow
231
+ e.preventDefault();
232
+ this.next();
233
+ break;
234
+ }
235
+
236
+ e.stopPropagation();
237
+ }
238
+
239
+ , keydown: function (e) {
240
+ this.suppressKeyPressRepeat = ~$.inArray(e.keyCode, [40,38,9,13,27]);
241
+ if (!this.shown && e.keyCode == 40) {
242
+ this.lookup("");
243
+ } else {
244
+ this.move(e);
245
+ }
246
+ }
247
+
248
+ , keypress: function (e) {
249
+ if (this.suppressKeyPressRepeat) return;
250
+ this.move(e);
251
+ }
252
+
253
+ , keyup: function (e) {
254
+ switch(e.keyCode) {
255
+ case 40: // down arrow
256
+ case 38: // up arrow
257
+ case 16: // shift
258
+ case 17: // ctrl
259
+ case 18: // alt
260
+ break;
261
+
262
+ case 9: // tab
263
+ case 13: // enter
264
+ if (!this.shown) return;
265
+ this.select();
266
+ break;
267
+
268
+ case 27: // escape
269
+ if (!this.shown) return;
270
+ this.hide();
271
+ break;
272
+ default:
273
+ this.lookup();
274
+ }
275
+
276
+ e.stopPropagation();
277
+ e.preventDefault();
278
+ }
279
+
280
+ , focus: function (e) {
281
+ if (!this.focused) {
282
+ this.focused = true;
283
+ if (this.options.minLength === 0 && !this.$element.val() || this.options.showHintOnFocus) {
284
+ this.lookup();
285
+ }
286
+ }
287
+ }
288
+
289
+ , blur: function (e) {
290
+ this.focused = false;
291
+ if (!this.mousedover && this.shown) this.hide();
292
+ }
293
+
294
+ , click: function (e) {
295
+ e.stopPropagation();
296
+ e.preventDefault();
297
+ this.select();
298
+ this.$element.focus();
299
+ }
300
+
301
+ , mouseenter: function (e) {
302
+ this.mousedover = true;
303
+ this.$menu.find('.active').removeClass('active');
304
+ $(e.currentTarget).addClass('active');
305
+ }
306
+
307
+ , mouseleave: function (e) {
308
+ this.mousedover = false;
309
+ if (!this.focused && this.shown) this.hide();
310
+ }
311
+
312
+ };
313
+
314
+
315
+ /* TYPEAHEAD PLUGIN DEFINITION
316
+ * =========================== */
317
+
318
+ var old = $.fn.typeahead;
319
+
320
+ $.fn.typeahead = function (option) {
321
+ var arg = arguments;
322
+ return this.each(function () {
323
+ var $this = $(this)
324
+ , data = $this.data('typeahead')
325
+ , options = typeof option == 'object' && option;
326
+ if (!data) $this.data('typeahead', (data = new Typeahead(this, options)));
327
+ if (typeof option == 'string') {
328
+ if (arg.length > 1) {
329
+ data[option].apply(data, Array.prototype.slice.call(arg ,1));
330
+ } else {
331
+ data[option]();
332
+ }
333
+ }
334
+ });
335
+ };
336
+
337
+ $.fn.typeahead.defaults = {
338
+ source: []
339
+ , items: 8
340
+ , menu: '<ul class="typeahead dropdown-menu"></ul>'
341
+ , item: '<li><a href="#"></a></li>'
342
+ , minLength: 1
343
+ , scrollHeight: 0
344
+ , autoSelect: true
345
+ };
346
+
347
+ $.fn.typeahead.Constructor = Typeahead;
348
+
349
+
350
+ /* TYPEAHEAD NO CONFLICT
351
+ * =================== */
352
+
353
+ $.fn.typeahead.noConflict = function () {
354
+ $.fn.typeahead = old;
355
+ return this;
356
+ };
357
+
358
+
359
+ /* TYPEAHEAD DATA-API
360
+ * ================== */
361
+
362
+ $(document).on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) {
363
+ var $this = $(this);
364
+ if ($this.data('typeahead')) return;
365
+ $this.typeahead($this.data());
366
+ });
367
+
368
+ }(window.jQuery);
File without changes
@@ -0,0 +1,72 @@
1
+ /* Table of Contents
2
+ ==================================================
3
+ # Ad */
4
+
5
+ /* # Ad
6
+ ================================================== */
7
+ .ad {
8
+ background: rgba(245,248,250,1);
9
+ height: 220px;
10
+ width: 220px;
11
+ }
12
+ .ad-center { margin: 0 auto; }
13
+ .ad-large-rectangle {
14
+ height: 280px;
15
+ width: 336px;
16
+ }
17
+ .ad-medium-rectangle {
18
+ height: 250px;
19
+ width: 300px;
20
+ }
21
+ .ad-small-rectangle {
22
+ height: 150px;
23
+ width: 180px;
24
+ }
25
+ .ad-square {
26
+ height: 250px;
27
+ width: 250px;
28
+ }
29
+ .ad-small-square {
30
+ height: 200px;
31
+ width: 200px;
32
+ }
33
+ .ad-button {
34
+ height: 125px;
35
+ width: 125px;
36
+ }
37
+ .ad-large-leaderboard {
38
+ height: 90px;
39
+ width: 970px;
40
+ }
41
+ .ad-leaderboard {
42
+ height: 90px;
43
+ width: 728px;
44
+ }
45
+ .ad-banner {
46
+ height: 60px;
47
+ width: 468px;
48
+ }
49
+ .ad-half-banner {
50
+ height: 60px;
51
+ width: 234px;
52
+ }
53
+ .ad-mobile-banner {
54
+ height: 50px;
55
+ width: 320px;
56
+ }
57
+ .ad-vertical-banner {
58
+ height: 240px;
59
+ width: 120px;
60
+ }
61
+ .ad-large-skyscrapper {
62
+ height: 600px;
63
+ width: 300px;
64
+ }
65
+ .ad-wide-skyscrapper {
66
+ height: 600px;
67
+ width: 160px;
68
+ }
69
+ .ad-skyscrapper {
70
+ height: 600px;
71
+ width: 120px;
72
+ }