active_frontend 13.3.0 → 14.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (221) hide show
  1. checksums.yaml +4 -4
  2. data/.DS_Store +0 -0
  3. data/.fasterer.yml +19 -0
  4. data/.reek +27 -0
  5. data/.rubocop.yml +38 -0
  6. data/.scss-lint.yml +27 -0
  7. data/Rakefile +1 -1
  8. data/active_frontend.gemspec +21 -18
  9. data/app/.DS_Store +0 -0
  10. data/app/assets/.DS_Store +0 -0
  11. data/app/assets/fonts/.DS_Store +0 -0
  12. data/app/assets/fonts/dripicons/.DS_Store +0 -0
  13. data/app/assets/fonts/dripicons/dripicons.woff +0 -0
  14. data/app/assets/fonts/fakt-pro/.DS_Store +0 -0
  15. data/app/assets/fonts/fakt-pro/fakt-pro-bold.woff +0 -0
  16. data/app/assets/fonts/fakt-pro/fakt-pro-normal.woff +0 -0
  17. data/app/assets/fonts/fakt-pro/fakt-pro-semibold.woff +0 -0
  18. data/app/assets/fonts/fakt-pro/fakt-pro-semilight.woff +0 -0
  19. data/app/assets/fonts/fakt-soft-pro/.DS_Store +0 -0
  20. data/app/assets/fonts/fakt-soft-pro/fakt-soft-pro-bold.woff +0 -0
  21. data/app/assets/fonts/fakt-soft-pro/fakt-soft-pro-normal.woff +0 -0
  22. data/app/assets/fonts/fakt-soft-pro/fakt-soft-pro-semibold.woff +0 -0
  23. data/app/assets/fonts/fakt-soft-pro/fakt-soft-pro-semilight.woff +0 -0
  24. data/app/assets/images/.DS_Store +0 -0
  25. data/app/assets/images/.keep +0 -0
  26. data/app/assets/images/placeholders/.DS_Store +0 -0
  27. data/app/assets/images/placeholders/camera-large.png +0 -0
  28. data/app/assets/images/placeholders/camera-small.png +0 -0
  29. data/app/assets/images/placeholders/camera.png +0 -0
  30. data/app/assets/images/placeholders/document-large.png +0 -0
  31. data/app/assets/images/placeholders/document-small.png +0 -0
  32. data/app/assets/images/placeholders/document.png +0 -0
  33. data/app/assets/images/placeholders/photo-large.png +0 -0
  34. data/app/assets/images/placeholders/{picture-small.png → photo-small.png} +0 -0
  35. data/app/assets/images/placeholders/photo.png +0 -0
  36. data/app/assets/images/placeholders/store-large.png +0 -0
  37. data/app/assets/images/placeholders/store-small.png +0 -0
  38. data/app/assets/images/placeholders/store.png +0 -0
  39. data/app/assets/images/placeholders/user-large.png +0 -0
  40. data/app/assets/images/placeholders/user-small.png +0 -0
  41. data/app/assets/images/placeholders/user.png +0 -0
  42. data/app/helpers/active_frontend_helper.rb +22 -37
  43. data/lib/.DS_Store +0 -0
  44. data/lib/active_frontend.rb +3 -4
  45. data/lib/active_frontend/.DS_Store +0 -0
  46. data/lib/active_frontend/version.rb +1 -1
  47. data/lib/generators/active_frontend/install_generator.rb +3 -3
  48. data/lib/generators/active_frontend/templates/install.js +35 -30
  49. data/lib/generators/active_frontend/templates/install.scss +55 -58
  50. data/vendor/.DS_Store +0 -0
  51. data/vendor/assets/.DS_Store +0 -0
  52. data/vendor/assets/javascripts/.DS_Store +0 -0
  53. data/vendor/assets/javascripts/active_frontend.js +35 -30
  54. data/vendor/assets/javascripts/base/_affix.js +170 -0
  55. data/vendor/assets/javascripts/base/_alert.js +80 -0
  56. data/vendor/assets/javascripts/base/_animation.js +106 -0
  57. data/vendor/assets/javascripts/base/_button.js +123 -0
  58. data/vendor/assets/javascripts/base/_carousel.js +237 -0
  59. data/vendor/assets/javascripts/base/_collapse.js +200 -0
  60. data/vendor/assets/javascripts/base/_colorpicker.js +147 -0
  61. data/vendor/assets/javascripts/base/_datepicker.js +1411 -0
  62. data/vendor/assets/javascripts/base/_dropdown.js +154 -0
  63. data/vendor/assets/javascripts/base/_filepicker.js +235 -0
  64. data/vendor/assets/javascripts/base/_hoverdown.js +116 -0
  65. data/vendor/assets/javascripts/base/_layout.js +126 -0
  66. data/vendor/assets/javascripts/base/_list.js +103 -0
  67. data/vendor/assets/javascripts/{_modal.js → base/_modal.js} +170 -167
  68. data/vendor/assets/javascripts/base/_popover.js +101 -0
  69. data/vendor/assets/javascripts/base/_scrollspy.js +161 -0
  70. data/vendor/assets/javascripts/base/_switch.js +160 -0
  71. data/vendor/assets/javascripts/base/_tab.js +139 -0
  72. data/vendor/assets/javascripts/base/_table.js +224 -0
  73. data/vendor/assets/javascripts/base/_timeago.js +270 -0
  74. data/vendor/assets/javascripts/base/_timepicker.js +541 -0
  75. data/vendor/assets/javascripts/base/_tooltip.js +525 -0
  76. data/vendor/assets/javascripts/base/_tour.js +268 -0
  77. data/vendor/assets/javascripts/base/_transition.js +52 -0
  78. data/vendor/assets/javascripts/base/_typeahead.js +362 -0
  79. data/vendor/assets/javascripts/extensions/_calendar.js +4709 -0
  80. data/vendor/assets/javascripts/extensions/_chart.js +9371 -0
  81. data/vendor/assets/javascripts/extensions/_map.js +2153 -0
  82. data/vendor/assets/stylesheets/.DS_Store +0 -0
  83. data/vendor/assets/stylesheets/{_mixin.scss → _utility.scss} +96 -10
  84. data/vendor/assets/stylesheets/_variable.scss +201 -19
  85. data/vendor/assets/stylesheets/active_frontend.scss +55 -58
  86. data/vendor/assets/stylesheets/blocks/_anchor.scss +15 -0
  87. data/vendor/assets/stylesheets/blocks/_button.scss +278 -0
  88. data/vendor/assets/stylesheets/blocks/_code.scss +144 -0
  89. data/vendor/assets/stylesheets/blocks/_common.scss +127 -0
  90. data/vendor/assets/stylesheets/blocks/_form.scss +508 -0
  91. data/vendor/assets/stylesheets/blocks/_icon.scss +359 -0
  92. data/vendor/assets/stylesheets/blocks/_list.scss +76 -0
  93. data/vendor/assets/stylesheets/blocks/_multimedia.scss +62 -0
  94. data/vendor/assets/stylesheets/blocks/_reset.scss +179 -0
  95. data/vendor/assets/stylesheets/blocks/_table.scss +211 -0
  96. data/vendor/assets/stylesheets/blocks/_typography.scss +204 -0
  97. data/vendor/assets/stylesheets/components/_ad.scss +78 -0
  98. data/vendor/assets/stylesheets/components/_affix.scss +14 -0
  99. data/vendor/assets/stylesheets/components/_alert.scss +50 -0
  100. data/vendor/assets/stylesheets/components/_animation.scss +1670 -0
  101. data/vendor/assets/stylesheets/components/_breadcrumb.scss +17 -0
  102. data/vendor/assets/stylesheets/components/_calendar.scss +213 -0
  103. data/vendor/assets/stylesheets/components/_card.scss +30 -0
  104. data/vendor/assets/stylesheets/components/_carousel.scss +135 -0
  105. data/vendor/assets/stylesheets/components/_chart.scss +10 -0
  106. data/vendor/assets/stylesheets/components/_collapse.scss +17 -0
  107. data/vendor/assets/stylesheets/components/_colorpicker.scss +38 -0
  108. data/vendor/assets/stylesheets/components/_datepicker.scss +80 -0
  109. data/vendor/assets/stylesheets/components/_dropmenu.scss +151 -0
  110. data/vendor/assets/stylesheets/components/_footer.scss +11 -0
  111. data/vendor/assets/stylesheets/components/_grid.scss +144 -0
  112. data/vendor/assets/stylesheets/components/_header.scss +99 -0
  113. data/vendor/assets/stylesheets/components/_label_and_badge.scss +57 -0
  114. data/vendor/assets/stylesheets/components/_layout.scss +63 -0
  115. data/vendor/assets/stylesheets/components/_map.scss +14 -0
  116. data/vendor/assets/stylesheets/components/_milestone.scss +49 -0
  117. data/vendor/assets/stylesheets/components/_missive.scss +40 -0
  118. data/vendor/assets/stylesheets/components/_modal.scss +126 -0
  119. data/vendor/assets/stylesheets/components/_nav_and_tab.scss +202 -0
  120. data/vendor/assets/stylesheets/components/_navbar.scss +66 -0
  121. data/vendor/assets/stylesheets/components/_pagination.scss +79 -0
  122. data/vendor/assets/stylesheets/components/_placeholder.scss +23 -0
  123. data/vendor/assets/stylesheets/components/_popover.scss +167 -0
  124. data/vendor/assets/stylesheets/components/_progress.scss +62 -0
  125. data/vendor/assets/stylesheets/components/_sidebar.scss +74 -0
  126. data/vendor/assets/stylesheets/components/_spinner.scss +83 -0
  127. data/vendor/assets/stylesheets/components/_switch.scss +150 -0
  128. data/vendor/assets/stylesheets/components/_timepicker.scss +30 -0
  129. data/vendor/assets/stylesheets/components/_tooltip.scss +93 -0
  130. data/vendor/assets/stylesheets/components/_transition.scss +12 -0
  131. data/vendor/assets/stylesheets/components/_typeahead.scss +18 -0
  132. metadata +150 -94
  133. data/app/assets/fonts/gotham/gotham-bold.woff +0 -0
  134. data/app/assets/fonts/gotham/gotham-book.woff +0 -0
  135. data/app/assets/fonts/gotham/gotham-light.woff +0 -0
  136. data/app/assets/fonts/gotham/gotham-medium.woff +0 -0
  137. data/app/assets/fonts/gotham/gotham-rounded-bold.woff +0 -0
  138. data/app/assets/fonts/gotham/gotham-rounded-book.woff +0 -0
  139. data/app/assets/fonts/gotham/gotham-rounded-light.woff +0 -0
  140. data/app/assets/fonts/gotham/gotham-rounded-medium.woff +0 -0
  141. data/app/assets/images/placeholders/archive-large.png +0 -0
  142. data/app/assets/images/placeholders/archive-small.png +0 -0
  143. data/app/assets/images/placeholders/archive.png +0 -0
  144. data/app/assets/images/placeholders/picture-large.png +0 -0
  145. data/app/assets/images/placeholders/picture.png +0 -0
  146. data/vendor/assets/javascripts/_affix.js +0 -153
  147. data/vendor/assets/javascripts/_alert.js +0 -85
  148. data/vendor/assets/javascripts/_animation.js +0 -103
  149. data/vendor/assets/javascripts/_button.js +0 -107
  150. data/vendor/assets/javascripts/_carousel.js +0 -228
  151. data/vendor/assets/javascripts/_chart.js +0 -3742
  152. data/vendor/assets/javascripts/_collapse.js +0 -202
  153. data/vendor/assets/javascripts/_color_picker.js +0 -108
  154. data/vendor/assets/javascripts/_date_picker.js +0 -1650
  155. data/vendor/assets/javascripts/_dropdown.js +0 -156
  156. data/vendor/assets/javascripts/_file_input.js +0 -71
  157. data/vendor/assets/javascripts/_hoverdown.js +0 -109
  158. data/vendor/assets/javascripts/_inputmask.js +0 -341
  159. data/vendor/assets/javascripts/_loader.js +0 -361
  160. data/vendor/assets/javascripts/_map.js +0 -2401
  161. data/vendor/assets/javascripts/_popover.js +0 -99
  162. data/vendor/assets/javascripts/_scrollspy.js +0 -163
  163. data/vendor/assets/javascripts/_slider.js +0 -1572
  164. data/vendor/assets/javascripts/_sort.js +0 -1432
  165. data/vendor/assets/javascripts/_swoggle.js +0 -415
  166. data/vendor/assets/javascripts/_tab.js +0 -146
  167. data/vendor/assets/javascripts/_tablespy.js +0 -1883
  168. data/vendor/assets/javascripts/_time_ago.js +0 -206
  169. data/vendor/assets/javascripts/_time_picker.js +0 -1088
  170. data/vendor/assets/javascripts/_tooltip.js +0 -504
  171. data/vendor/assets/javascripts/_transition.js +0 -50
  172. data/vendor/assets/javascripts/_typeahead.js +0 -366
  173. data/vendor/assets/stylesheets/_ad.scss +0 -63
  174. data/vendor/assets/stylesheets/_affix.scss +0 -14
  175. data/vendor/assets/stylesheets/_alert.scss +0 -114
  176. data/vendor/assets/stylesheets/_animation.scss +0 -1370
  177. data/vendor/assets/stylesheets/_breadcrumb.scss +0 -100
  178. data/vendor/assets/stylesheets/_button.scss +0 -386
  179. data/vendor/assets/stylesheets/_canvas.scss +0 -182
  180. data/vendor/assets/stylesheets/_carousel.scss +0 -158
  181. data/vendor/assets/stylesheets/_chart.scss +0 -15
  182. data/vendor/assets/stylesheets/_code.scss +0 -150
  183. data/vendor/assets/stylesheets/_collapse.scss +0 -14
  184. data/vendor/assets/stylesheets/_color.scss +0 -55
  185. data/vendor/assets/stylesheets/_colorpicker.scss +0 -63
  186. data/vendor/assets/stylesheets/_datepicker.scss +0 -122
  187. data/vendor/assets/stylesheets/_dropdown.scss +0 -248
  188. data/vendor/assets/stylesheets/_footer.scss +0 -71
  189. data/vendor/assets/stylesheets/_form.scss +0 -661
  190. data/vendor/assets/stylesheets/_grid.scss +0 -184
  191. data/vendor/assets/stylesheets/_header.scss +0 -156
  192. data/vendor/assets/stylesheets/_icon.scss +0 -362
  193. data/vendor/assets/stylesheets/_image.scss +0 -33
  194. data/vendor/assets/stylesheets/_label_and_badge.scss +0 -104
  195. data/vendor/assets/stylesheets/_link.scss +0 -55
  196. data/vendor/assets/stylesheets/_list.scss +0 -122
  197. data/vendor/assets/stylesheets/_loader.scss +0 -71
  198. data/vendor/assets/stylesheets/_map.scss +0 -44
  199. data/vendor/assets/stylesheets/_missive.scss +0 -74
  200. data/vendor/assets/stylesheets/_modal.scss +0 -204
  201. data/vendor/assets/stylesheets/_nav_and_tab.scss +0 -230
  202. data/vendor/assets/stylesheets/_navbar.scss +0 -73
  203. data/vendor/assets/stylesheets/_pagination.scss +0 -79
  204. data/vendor/assets/stylesheets/_panel.scss +0 -80
  205. data/vendor/assets/stylesheets/_placeholder.scss +0 -63
  206. data/vendor/assets/stylesheets/_popover.scss +0 -128
  207. data/vendor/assets/stylesheets/_progress.scss +0 -86
  208. data/vendor/assets/stylesheets/_reset.scss +0 -140
  209. data/vendor/assets/stylesheets/_sidebar.scss +0 -148
  210. data/vendor/assets/stylesheets/_slider.scss +0 -151
  211. data/vendor/assets/stylesheets/_spinner.scss +0 -572
  212. data/vendor/assets/stylesheets/_subheader.scss +0 -112
  213. data/vendor/assets/stylesheets/_swoggle.scss +0 -120
  214. data/vendor/assets/stylesheets/_table.scss +0 -210
  215. data/vendor/assets/stylesheets/_timepicker.scss +0 -77
  216. data/vendor/assets/stylesheets/_toolbar.scss +0 -130
  217. data/vendor/assets/stylesheets/_tooltip.scss +0 -105
  218. data/vendor/assets/stylesheets/_transition.scss +0 -11
  219. data/vendor/assets/stylesheets/_trunk.scss +0 -147
  220. data/vendor/assets/stylesheets/_typeahead.scss +0 -18
  221. data/vendor/assets/stylesheets/_typography.scss +0 -233
@@ -1,50 +0,0 @@
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);
@@ -1,366 +0,0 @@
1
- !function($){
2
- "use strict";
3
-
4
-
5
- /* TYPEAHEAD PUBLIC CLASS DEFINITION
6
- * ================================= */
7
-
8
- var Typeahead = function (element, options) {
9
- this.$element = $(element);
10
- this.options = $.extend({}, $.fn.typeahead.defaults, options);
11
- this.matcher = this.options.matcher || this.matcher;
12
- this.sorter = this.options.sorter || this.sorter;
13
- this.select = this.options.select || this.select;
14
- this.autoSelect = typeof this.options.autoSelect == 'boolean' ? this.options.autoSelect : true;
15
- this.highlighter = this.options.highlighter || this.highlighter;
16
- this.updater = this.options.updater || this.updater;
17
- this.source = this.options.source;
18
- this.$menu = $(this.options.menu);
19
- this.shown = false;
20
- this.listen();
21
- this.showHintOnFocus = typeof this.options.showHintOnFocus == 'boolean' ? this.options.showHintOnFocus : false;
22
- };
23
-
24
- Typeahead.prototype = {
25
-
26
- constructor: Typeahead
27
-
28
- , select: function () {
29
- var val = this.$menu.find('.active').data('value');
30
- if(this.autoSelect || val) {
31
- this.$element
32
- .val(this.updater(val))
33
- .change();
34
- }
35
- return this.hide();
36
- }
37
-
38
- , updater: function (item) {
39
- return item;
40
- }
41
-
42
- , setSource: function (source) {
43
- this.source = source;
44
- }
45
-
46
- , show: function () {
47
- var pos = $.extend({}, this.$element.position(), {
48
- height: this.$element[0].offsetHeight
49
- }), scrollHeight;
50
-
51
- scrollHeight = typeof this.options.scrollHeight == 'function' ?
52
- this.options.scrollHeight.call() :
53
- this.options.scrollHeight;
54
-
55
- this.$menu
56
- .insertAfter(this.$element)
57
- .css({
58
- top: pos.top + pos.height + scrollHeight
59
- , left: pos.left
60
- })
61
- .show();
62
-
63
- this.shown = true;
64
- return this;
65
- }
66
-
67
- , hide: function () {
68
- this.$menu.hide();
69
- this.shown = false;
70
- return this;
71
- }
72
-
73
- , lookup: function (query) {
74
- var items;
75
- if (typeof(query) != 'undefined' && query !== null) {
76
- this.query = query;
77
- } else {
78
- this.query = this.$element.val() || '';
79
- }
80
-
81
- if (this.query.length < this.options.minLength) {
82
- return this.shown ? this.hide() : this;
83
- }
84
-
85
- items = $.isFunction(this.source) ? this.source(this.query, $.proxy(this.process, this)) : this.source;
86
-
87
- return items ? this.process(items) : this;
88
- }
89
-
90
- , process: function (items) {
91
- var that = this;
92
-
93
- items = $.grep(items, function (item) {
94
- return that.matcher(item);
95
- });
96
-
97
- items = this.sorter(items);
98
-
99
- if (!items.length) {
100
- return this.shown ? this.hide() : this;
101
- }
102
-
103
- if (this.options.items == 'all' || this.options.minLength === 0 && !this.$element.val()) {
104
- return this.render(items).show();
105
- } else {
106
- return this.render(items.slice(0, this.options.items)).show();
107
- }
108
- }
109
-
110
- , matcher: function (item) {
111
- return ~item.toLowerCase().indexOf(this.query.toLowerCase());
112
- }
113
-
114
- , sorter: function (items) {
115
- var beginswith = []
116
- , caseSensitive = []
117
- , caseInsensitive = []
118
- , item;
119
-
120
- while ((item = items.shift())) {
121
- if (!item.toLowerCase().indexOf(this.query.toLowerCase())) beginswith.push(item);
122
- else if (~item.indexOf(this.query)) caseSensitive.push(item);
123
- else caseInsensitive.push(item);
124
- }
125
-
126
- return beginswith.concat(caseSensitive, caseInsensitive);
127
- }
128
-
129
- , highlighter: function (item) {
130
- var query = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&');
131
- return item.replace(new RegExp('(' + query + ')', 'ig'), function ($1, match) {
132
- return '<b>' + match + '</b>';
133
- });
134
- }
135
-
136
- , render: function (items) {
137
- var that = this;
138
-
139
- items = $(items).map(function (i, item) {
140
- i = $(that.options.item).data('value', item);
141
- i.find('a').html(that.highlighter(item));
142
- return i[0];
143
- });
144
-
145
- if (this.autoSelect) {
146
- items.first().addClass('active');
147
- }
148
- this.$menu.html(items);
149
- return this;
150
- }
151
-
152
- , next: function (event) {
153
- var active = this.$menu.find('.active').removeClass('active')
154
- , next = active.next();
155
-
156
- if (!next.length) {
157
- next = $(this.$menu.find('li')[0]);
158
- }
159
-
160
- next.addClass('active');
161
- }
162
-
163
- , prev: function (event) {
164
- var active = this.$menu.find('.active').removeClass('active')
165
- , prev = active.prev();
166
-
167
- if (!prev.length) {
168
- prev = this.$menu.find('li').last();
169
- }
170
-
171
- prev.addClass('active');
172
- }
173
-
174
- , listen: function () {
175
- this.$element
176
- .on('focus', $.proxy(this.focus, this))
177
- .on('blur', $.proxy(this.blur, this))
178
- .on('keypress', $.proxy(this.keypress, this))
179
- .on('keyup', $.proxy(this.keyup, this));
180
-
181
- if (this.eventSupported('keydown')) {
182
- this.$element.on('keydown', $.proxy(this.keydown, this));
183
- }
184
-
185
- this.$menu
186
- .on('click', $.proxy(this.click, this))
187
- .on('mouseenter', 'li', $.proxy(this.mouseenter, this))
188
- .on('mouseleave', 'li', $.proxy(this.mouseleave, this));
189
- }
190
- , destroy : function () {
191
- this.$element.data('typeahead',null);
192
- this.$element
193
- .off('focus')
194
- .off('blur')
195
- .off('keypress')
196
- .off('keyup');
197
-
198
- if (this.eventSupported('keydown')) {
199
- this.$element.off('keydown');
200
- }
201
-
202
- this.$menu.remove();
203
- }
204
- , eventSupported: function(eventName) {
205
- var isSupported = eventName in this.$element;
206
- if (!isSupported) {
207
- this.$element.setAttribute(eventName, 'return;');
208
- isSupported = typeof this.$element[eventName] === 'function';
209
- }
210
- return isSupported;
211
- }
212
-
213
- , move: function (e) {
214
- if (!this.shown) return;
215
-
216
- switch(e.keyCode) {
217
- case 9: // tab
218
- case 13: // enter
219
- case 27: // escape
220
- e.preventDefault();
221
- break;
222
-
223
- case 38: // up arrow
224
- e.preventDefault();
225
- this.prev();
226
- break;
227
-
228
- case 40: // down arrow
229
- e.preventDefault();
230
- this.next();
231
- break;
232
- }
233
-
234
- e.stopPropagation();
235
- }
236
-
237
- , keydown: function (e) {
238
- this.suppressKeyPressRepeat = ~$.inArray(e.keyCode, [40,38,9,13,27]);
239
- if (!this.shown && e.keyCode == 40) {
240
- this.lookup("");
241
- } else {
242
- this.move(e);
243
- }
244
- }
245
-
246
- , keypress: function (e) {
247
- if (this.suppressKeyPressRepeat) return;
248
- this.move(e);
249
- }
250
-
251
- , keyup: function (e) {
252
- switch(e.keyCode) {
253
- case 40: // down arrow
254
- case 38: // up arrow
255
- case 16: // shift
256
- case 17: // ctrl
257
- case 18: // alt
258
- break;
259
-
260
- case 9: // tab
261
- case 13: // enter
262
- if (!this.shown) return;
263
- this.select();
264
- break;
265
-
266
- case 27: // escape
267
- if (!this.shown) return;
268
- this.hide();
269
- break;
270
- default:
271
- this.lookup();
272
- }
273
-
274
- e.stopPropagation();
275
- e.preventDefault();
276
- }
277
-
278
- , focus: function (e) {
279
- if (!this.focused) {
280
- this.focused = true;
281
- if (this.options.minLength === 0 && !this.$element.val() || this.options.showHintOnFocus) {
282
- this.lookup();
283
- }
284
- }
285
- }
286
-
287
- , blur: function (e) {
288
- this.focused = false;
289
- if (!this.mousedover && this.shown) this.hide();
290
- }
291
-
292
- , click: function (e) {
293
- e.stopPropagation();
294
- e.preventDefault();
295
- this.select();
296
- this.$element.focus();
297
- }
298
-
299
- , mouseenter: function (e) {
300
- this.mousedover = true;
301
- this.$menu.find('.active').removeClass('active');
302
- $(e.currentTarget).addClass('active');
303
- }
304
-
305
- , mouseleave: function (e) {
306
- this.mousedover = false;
307
- if (!this.focused && this.shown) this.hide();
308
- }
309
-
310
- };
311
-
312
-
313
- /* TYPEAHEAD PLUGIN DEFINITION
314
- * =========================== */
315
-
316
- var old = $.fn.typeahead;
317
-
318
- $.fn.typeahead = function (option) {
319
- var arg = arguments;
320
- return this.each(function () {
321
- var $this = $(this)
322
- , data = $this.data('typeahead')
323
- , options = typeof option == 'object' && option;
324
- if (!data) $this.data('typeahead', (data = new Typeahead(this, options)));
325
- if (typeof option == 'string') {
326
- if (arg.length > 1) {
327
- data[option].apply(data, Array.prototype.slice.call(arg ,1));
328
- } else {
329
- data[option]();
330
- }
331
- }
332
- });
333
- };
334
-
335
- $.fn.typeahead.defaults = {
336
- source: []
337
- , items: 8
338
- , menu: '<ul class="typeahead dropdown-menu dropdown-caret"></ul>'
339
- , item: '<li><a href="#"></a></li>'
340
- , minLength: 1
341
- , scrollHeight: 0
342
- , autoSelect: true
343
- };
344
-
345
- $.fn.typeahead.Constructor = Typeahead;
346
-
347
-
348
- /* TYPEAHEAD NO CONFLICT
349
- * =================== */
350
-
351
- $.fn.typeahead.noConflict = function () {
352
- $.fn.typeahead = old;
353
- return this;
354
- };
355
-
356
-
357
- /* TYPEAHEAD DATA-API
358
- * ================== */
359
-
360
- $(document).on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) {
361
- var $this = $(this);
362
- if ($this.data('typeahead')) return;
363
- $this.typeahead($this.data());
364
- });
365
-
366
- }(window.jQuery);
@@ -1,63 +0,0 @@
1
- /* Table of Contents
2
- ==================================================
3
- # Ad
4
- # Alignments
5
- # Sizes
6
- # Colors
7
- # Media Queries */
8
-
9
- /* # Ad
10
- ================================================== */
11
- .ad {
12
- background: $color-white;
13
- border: 1px solid $color-haze;
14
- box-sizing: border-box;
15
- display: block;
16
- visibility: visible;
17
- @include dimensions(220px, 220px);
18
- }
19
-
20
- /* # Alignments
21
- ================================================== */
22
- .ad-center { margin: 0 auto; }
23
-
24
- /* # Sizes
25
- ================================================== */
26
- .ad-banner { @include dimensions(60px, 468px); }
27
- .ad-half-banner { @include dimensions(60px, 234px); }
28
- .ad-mobile-banner { @include dimensions(50px, 320px); }
29
- .ad-vertical-banner { @include dimensions(240px, 120px); }
30
- .ad-button { @include dimensions(125px, 125px); }
31
- .ad-leaderboard { @include dimensions(90px, 728px); }
32
- .ad-large-leaderboard { @include dimensions(90px, 970px); }
33
- .ad-large-rectangle { @include dimensions(280px, 336px); }
34
- .ad-medium-rectangle { @include dimensions(250px, 300px); }
35
- .ad-small-rectangle { @include dimensions(150px, 180px); }
36
- .ad-skyscrapper { @include dimensions(600px, 120px); }
37
- .ad-large-skyscrapper { @include dimensions(600px, 300px); }
38
- .ad-wide-skyscrapper { @include dimensions(600px, 160px); }
39
- .ad-square { @include dimensions(250px, 250px); }
40
- .ad-small-square { @include dimensions(200px, 200px); }
41
-
42
- /* # Colors
43
- ================================================== */
44
- .ad-dark {
45
- background: $color-black;
46
- border-color: $color-dark-black;
47
- }
48
- .ad-light {
49
- background: lighten($color-light-haze, 2%);
50
- border-color: $color-dark-haze;
51
- }
52
-
53
- /* # Media Queries
54
- ================================================== */
55
- @media
56
- only screen and (-webkit-min-device-pixel-ratio: 2),
57
- only screen and ( min--moz-device-pixel-ratio: 2),
58
- only screen and ( -o-min-device-pixel-ratio: 2/1),
59
- only screen and ( min-device-pixel-ratio: 2),
60
- only screen and ( min-resolution: 192dpi),
61
- only screen and ( min-resolution: 2dppx) {
62
- .ad { border-width: 0.5px; }
63
- }