uikit-rails 0.0.2 → 1.0.1

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 (177) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +9 -3
  3. data/Gemfile +2 -1
  4. data/LICENSE.txt +21 -0
  5. data/README.md +65 -0
  6. data/Rakefile +0 -1
  7. data/assets/fonts/FontAwesome.otf +0 -0
  8. data/assets/fonts/fontawesome-webfont.ttf +0 -0
  9. data/assets/fonts/fontawesome-webfont.woff +0 -0
  10. data/assets/fonts/fontawesome-webfont.woff2 +0 -0
  11. data/assets/javascripts/components/accordion.js +174 -0
  12. data/assets/javascripts/components/accordion.min.js +2 -0
  13. data/assets/javascripts/components/autocomplete.js +334 -0
  14. data/assets/javascripts/components/autocomplete.min.js +2 -0
  15. data/assets/javascripts/components/datepicker.js +3166 -0
  16. data/assets/javascripts/components/datepicker.min.js +3 -0
  17. data/assets/javascripts/components/form-password.js +67 -0
  18. data/assets/javascripts/components/form-password.min.js +2 -0
  19. data/assets/javascripts/components/form-select.js +70 -0
  20. data/assets/javascripts/components/form-select.min.js +2 -0
  21. data/assets/javascripts/components/grid.js +527 -0
  22. data/assets/javascripts/components/grid.min.js +2 -0
  23. data/assets/javascripts/components/htmleditor.js +623 -0
  24. data/assets/javascripts/components/htmleditor.min.js +2 -0
  25. data/assets/javascripts/components/lightbox.js +555 -0
  26. data/assets/javascripts/components/lightbox.min.js +2 -0
  27. data/assets/javascripts/components/nestable.js +638 -0
  28. data/assets/javascripts/components/nestable.min.js +2 -0
  29. data/assets/javascripts/components/notify.js +189 -0
  30. data/assets/javascripts/components/notify.min.js +2 -0
  31. data/assets/javascripts/components/pagination.js +147 -0
  32. data/assets/javascripts/components/pagination.min.js +2 -0
  33. data/assets/javascripts/components/parallax.js +435 -0
  34. data/assets/javascripts/components/parallax.min.js +2 -0
  35. data/assets/javascripts/components/search.js +92 -0
  36. data/assets/javascripts/components/search.min.js +2 -0
  37. data/assets/javascripts/components/slider.js +531 -0
  38. data/assets/javascripts/components/slider.min.js +2 -0
  39. data/assets/javascripts/components/slideset.js +506 -0
  40. data/assets/javascripts/components/slideset.min.js +2 -0
  41. data/assets/javascripts/components/slideshow-fx.js +375 -0
  42. data/assets/javascripts/components/slideshow-fx.min.js +2 -0
  43. data/assets/javascripts/components/slideshow.js +562 -0
  44. data/assets/javascripts/components/slideshow.min.js +2 -0
  45. data/assets/javascripts/components/sortable.js +688 -0
  46. data/assets/javascripts/components/sortable.min.js +2 -0
  47. data/assets/javascripts/components/sticky.js +359 -0
  48. data/assets/javascripts/components/sticky.min.js +2 -0
  49. data/assets/javascripts/components/timepicker.js +192 -0
  50. data/assets/javascripts/components/timepicker.min.js +2 -0
  51. data/assets/javascripts/components/tooltip.js +234 -0
  52. data/assets/javascripts/components/tooltip.min.js +2 -0
  53. data/assets/javascripts/components/upload.js +260 -0
  54. data/assets/javascripts/components/upload.min.js +2 -0
  55. data/assets/javascripts/core/alert.js +66 -0
  56. data/assets/javascripts/core/alert.min.js +2 -0
  57. data/assets/javascripts/core/button.js +157 -0
  58. data/assets/javascripts/core/button.min.js +2 -0
  59. data/assets/javascripts/core/core.js +730 -0
  60. data/assets/javascripts/core/core.min.js +2 -0
  61. data/assets/javascripts/core/cover.js +95 -0
  62. data/assets/javascripts/core/cover.min.js +2 -0
  63. data/assets/javascripts/core/dropdown.js +514 -0
  64. data/assets/javascripts/core/dropdown.min.js +2 -0
  65. data/assets/javascripts/core/grid.js +114 -0
  66. data/assets/javascripts/core/grid.min.js +2 -0
  67. data/assets/javascripts/core/modal.js +384 -0
  68. data/assets/javascripts/core/modal.min.js +2 -0
  69. data/assets/javascripts/core/nav.js +136 -0
  70. data/assets/javascripts/core/nav.min.js +2 -0
  71. data/assets/javascripts/core/offcanvas.js +180 -0
  72. data/assets/javascripts/core/offcanvas.min.js +2 -0
  73. data/assets/javascripts/core/scrollspy.js +208 -0
  74. data/assets/javascripts/core/scrollspy.min.js +2 -0
  75. data/assets/javascripts/core/smooth-scroll.js +62 -0
  76. data/assets/javascripts/core/smooth-scroll.min.js +2 -0
  77. data/assets/javascripts/core/switcher.js +309 -0
  78. data/assets/javascripts/core/switcher.min.js +2 -0
  79. data/assets/javascripts/core/tab.js +167 -0
  80. data/assets/javascripts/core/tab.min.js +2 -0
  81. data/assets/javascripts/core/toggle.js +120 -0
  82. data/assets/javascripts/core/toggle.min.js +2 -0
  83. data/assets/javascripts/core/touch.js +175 -0
  84. data/assets/javascripts/core/touch.min.js +2 -0
  85. data/assets/javascripts/core/utility.js +289 -0
  86. data/assets/javascripts/core/utility.min.js +2 -0
  87. data/assets/javascripts/uikit-components.js +23 -0
  88. data/assets/javascripts/uikit.js +3706 -0
  89. data/assets/javascripts/uikit.min.js +3 -0
  90. data/assets/stylesheets/components/accordion.scss +94 -0
  91. data/assets/stylesheets/components/autocomplete.scss +102 -0
  92. data/assets/stylesheets/components/datepicker.scss +197 -0
  93. data/assets/stylesheets/components/dotnav.scss +212 -0
  94. data/assets/stylesheets/components/form-advanced.scss +128 -0
  95. data/assets/stylesheets/components/form-file.scss +63 -0
  96. data/assets/stylesheets/components/form-password.scss +74 -0
  97. data/assets/stylesheets/components/form-select.scss +66 -0
  98. data/assets/stylesheets/components/htmleditor.scss +269 -0
  99. data/assets/stylesheets/components/nestable.scss +229 -0
  100. data/assets/stylesheets/components/notify.scss +190 -0
  101. data/assets/stylesheets/components/placeholder.scss +66 -0
  102. data/assets/stylesheets/components/progress.scss +173 -0
  103. data/assets/stylesheets/components/search.scss +309 -0
  104. data/assets/stylesheets/components/slidenav.scss +183 -0
  105. data/assets/stylesheets/components/slider.scss +131 -0
  106. data/assets/stylesheets/components/slideshow.scss +208 -0
  107. data/assets/stylesheets/components/sortable.scss +122 -0
  108. data/assets/stylesheets/components/sticky.scss +64 -0
  109. data/assets/stylesheets/components/tooltip.scss +177 -0
  110. data/assets/stylesheets/components/upload.scss +34 -0
  111. data/assets/stylesheets/core/alert.scss +141 -0
  112. data/assets/stylesheets/core/animation.scss +599 -0
  113. data/assets/stylesheets/core/article.scss +139 -0
  114. data/assets/stylesheets/core/badge.scss +110 -0
  115. data/assets/stylesheets/core/base-noconflict.scss +397 -0
  116. data/assets/stylesheets/core/base.scss +541 -0
  117. data/assets/stylesheets/core/block.scss +153 -0
  118. data/assets/stylesheets/core/breadcrumb.scss +86 -0
  119. data/assets/stylesheets/core/button.scss +406 -0
  120. data/assets/stylesheets/core/close.scss +132 -0
  121. data/assets/stylesheets/core/column.scss +209 -0
  122. data/assets/stylesheets/core/comment.scss +172 -0
  123. data/assets/stylesheets/core/contrast.scss +493 -0
  124. data/assets/stylesheets/core/cover.scss +70 -0
  125. data/assets/stylesheets/core/description-list.scss +71 -0
  126. data/assets/stylesheets/core/dropdown.scss +280 -0
  127. data/assets/stylesheets/core/flex.scss +320 -0
  128. data/assets/stylesheets/core/form.scss +627 -0
  129. data/assets/stylesheets/core/grid.scss +688 -0
  130. data/assets/stylesheets/core/icon.scss +897 -0
  131. data/assets/stylesheets/core/list.scss +102 -0
  132. data/assets/stylesheets/core/modal.scss +341 -0
  133. data/assets/stylesheets/core/nav.scss +468 -0
  134. data/assets/stylesheets/core/navbar.scss +325 -0
  135. data/assets/stylesheets/core/offcanvas.scss +168 -0
  136. data/assets/stylesheets/core/overlay.scss +534 -0
  137. data/assets/stylesheets/core/pagination.scss +197 -0
  138. data/assets/stylesheets/core/panel.scss +332 -0
  139. data/assets/stylesheets/core/print.scss +59 -0
  140. data/assets/stylesheets/core/subnav.scss +213 -0
  141. data/assets/stylesheets/core/switcher.scss +38 -0
  142. data/assets/stylesheets/core/tab.scss +368 -0
  143. data/assets/stylesheets/core/table.scss +147 -0
  144. data/assets/stylesheets/core/text.scss +128 -0
  145. data/assets/stylesheets/core/thumbnail.scss +122 -0
  146. data/assets/stylesheets/core/thumbnav.scss +122 -0
  147. data/assets/stylesheets/core/utility.scss +606 -0
  148. data/assets/stylesheets/core/variables.scss +23 -0
  149. data/assets/stylesheets/uikit-components.scss +22 -0
  150. data/assets/stylesheets/uikit-mixins.scss +327 -0
  151. data/assets/stylesheets/uikit-variables.scss +817 -0
  152. data/assets/stylesheets/uikit.scss +56 -0
  153. data/lib/uikit-rails.rb +2 -2
  154. data/lib/uikit-rails/engine.rb +11 -1
  155. data/lib/uikit-rails/version.rb +1 -3
  156. data/uikit-rails.gemspec +15 -16
  157. metadata +169 -44
  158. data/README.rb +0 -1
  159. data/vendor/assets/javascripts/ui.card.js +0 -115
  160. data/vendor/assets/javascripts/ui.color-picker.js +0 -351
  161. data/vendor/assets/javascripts/ui.confirmation.js +0 -133
  162. data/vendor/assets/javascripts/ui.dialog.js +0 -252
  163. data/vendor/assets/javascripts/ui.emitter.js +0 -99
  164. data/vendor/assets/javascripts/ui.js +0 -1641
  165. data/vendor/assets/javascripts/ui.menu.js +0 -238
  166. data/vendor/assets/javascripts/ui.notification.js +0 -240
  167. data/vendor/assets/javascripts/ui.overlay.js +0 -79
  168. data/vendor/assets/javascripts/ui.split-button.js +0 -108
  169. data/vendor/assets/stylesheets/ui.card.css +0 -55
  170. data/vendor/assets/stylesheets/ui.color-picker.css +0 -6
  171. data/vendor/assets/stylesheets/ui.confirmation.css +0 -7
  172. data/vendor/assets/stylesheets/ui.css +0 -337
  173. data/vendor/assets/stylesheets/ui.dialog.css +0 -92
  174. data/vendor/assets/stylesheets/ui.menu.css +0 -32
  175. data/vendor/assets/stylesheets/ui.notification.css +0 -107
  176. data/vendor/assets/stylesheets/ui.overlay.css +0 -16
  177. data/vendor/assets/stylesheets/ui.split-button.css +0 -27
@@ -1,238 +0,0 @@
1
-
2
- /**
3
- * Expose `Menu`.
4
- */
5
-
6
- exports.Menu = Menu;
7
-
8
- /**
9
- * Create a new `Menu`.
10
- *
11
- * @return {Menu}
12
- * @api public
13
- */
14
-
15
- exports.menu = function(){
16
- return new Menu;
17
- };
18
-
19
- /**
20
- * Initialize a new `Menu`.
21
- *
22
- * Emits:
23
- *
24
- * - "show" when shown
25
- * - "hide" when hidden
26
- * - "remove" with the item name when an item is removed
27
- * - * menu item events are emitted when clicked
28
- *
29
- * @api public
30
- */
31
-
32
- function Menu() {
33
- ui.Emitter.call(this);
34
- this.items = {};
35
- this.el = $(html).hide().appendTo('body');
36
- this.el.hover(this.deselect.bind(this));
37
- $('html').click(this.hide.bind(this));
38
- this.on('show', this.bindKeyboardEvents.bind(this));
39
- this.on('hide', this.unbindKeyboardEvents.bind(this));
40
- };
41
-
42
- /**
43
- * Inherit from `Emitter.prototype`.
44
- */
45
-
46
- Menu.prototype = new ui.Emitter;
47
-
48
- /**
49
- * Deselect selected menu items.
50
- *
51
- * @api private
52
- */
53
-
54
- Menu.prototype.deselect = function(){
55
- this.el.find('.selected').removeClass('selected');
56
- };
57
-
58
- /**
59
- * Bind keyboard events.
60
- *
61
- * @api private
62
- */
63
-
64
- Menu.prototype.bindKeyboardEvents = function(){
65
- $(document).bind('keydown.menu', this.onkeydown.bind(this));
66
- return this;
67
- };
68
-
69
- /**
70
- * Unbind keyboard events.
71
- *
72
- * @api private
73
- */
74
-
75
- Menu.prototype.unbindKeyboardEvents = function(){
76
- $(document).unbind('keydown.menu');
77
- return this;
78
- };
79
-
80
- /**
81
- * Handle keydown events.
82
- *
83
- * @api private
84
- */
85
-
86
- Menu.prototype.onkeydown = function(e){
87
- switch (e.keyCode) {
88
- // up
89
- case 38:
90
- e.preventDefault();
91
- this.move('prev');
92
- break;
93
- // down
94
- case 40:
95
- e.preventDefault();
96
- this.move('next');
97
- break;
98
- }
99
- };
100
-
101
- /**
102
- * Focus on the next menu item in `direction`.
103
- *
104
- * @param {String} direction "prev" or "next"
105
- * @api public
106
- */
107
-
108
- Menu.prototype.move = function(direction){
109
- var prev = this.el.find('.selected').eq(0);
110
-
111
- var next = prev.length
112
- ? prev[direction]()
113
- : this.el.find('li:first-child');
114
-
115
- if (next.length) {
116
- prev.removeClass('selected');
117
- next.addClass('selected');
118
- next.find('a').focus();
119
- }
120
- };
121
-
122
- /**
123
- * Add menu item with the given `text` and optional callback `fn`.
124
- *
125
- * When the item is clicked `fn()` will be invoked
126
- * and the `Menu` is immediately closed. When clicked
127
- * an event of the name `text` is emitted regardless of
128
- * the callback function being present.
129
- *
130
- * @param {String} text
131
- * @param {Function} fn
132
- * @return {Menu}
133
- * @api public
134
- */
135
-
136
- Menu.prototype.add = function(text, fn){
137
- var self = this
138
- , el = $('<li><a href="#">' + text + '</a></li>')
139
- .addClass(slug(text))
140
- .appendTo(this.el)
141
- .click(function(e){
142
- e.preventDefault();
143
- e.stopPropagation();
144
- self.hide();
145
- self.emit(text);
146
- fn && fn();
147
- });
148
-
149
- this.items[text] = el;
150
- return this;
151
- };
152
-
153
- /**
154
- * Remove menu item with the given `text`.
155
- *
156
- * @param {String} text
157
- * @return {Menu}
158
- * @api public
159
- */
160
-
161
- Menu.prototype.remove = function(text){
162
- var item = this.items[text];
163
- if (!item) throw new Error('no menu item named "' + text + '"');
164
- this.emit('remove', text);
165
- item.remove();
166
- delete this.items[text];
167
- return this;
168
- };
169
-
170
- /**
171
- * Check if this menu has an item with the given `text`.
172
- *
173
- * @param {String} text
174
- * @return {Boolean}
175
- * @api public
176
- */
177
-
178
- Menu.prototype.has = function(text){
179
- return !! this.items[text];
180
- };
181
-
182
- /**
183
- * Move context menu to `(x, y)`.
184
- *
185
- * @param {Number} x
186
- * @param {Number} y
187
- * @return {Menu}
188
- * @api public
189
- */
190
-
191
- Menu.prototype.moveTo = function(x, y){
192
- this.el.css({
193
- top: y,
194
- left: x
195
- });
196
- return this;
197
- };
198
-
199
- /**
200
- * Show the menu.
201
- *
202
- * @return {Menu}
203
- * @api public
204
- */
205
-
206
- Menu.prototype.show = function(){
207
- this.emit('show');
208
- this.el.show();
209
- return this;
210
- };
211
-
212
- /**
213
- * Hide the menu.
214
- *
215
- * @return {Menu}
216
- * @api public
217
- */
218
-
219
- Menu.prototype.hide = function(){
220
- this.emit('hide');
221
- this.el.hide();
222
- return this;
223
- };
224
-
225
- /**
226
- * Generate a slug from `str`.
227
- *
228
- * @param {String} str
229
- * @return {String}
230
- * @api private
231
- */
232
-
233
- function slug(str) {
234
- return str
235
- .toLowerCase()
236
- .replace(/ +/g, '-')
237
- .replace(/[^a-z0-9-]/g, '');
238
- }
@@ -1,240 +0,0 @@
1
-
2
- /**
3
- * Notification list.
4
- */
5
-
6
- var list;
7
-
8
- /**
9
- * Expose `Notification`.
10
- */
11
-
12
- exports.Notification = Notification;
13
-
14
- // list
15
-
16
- $(function(){
17
- list = $('<ul id="notifications">');
18
- list.appendTo('body');
19
- })
20
-
21
- /**
22
- * Return a new `Notification` with the given
23
- * (optional) `title` and `msg`.
24
- *
25
- * @param {String} title or msg
26
- * @param {String} msg
27
- * @return {Dialog}
28
- * @api public
29
- */
30
-
31
- exports.notify = function(title, msg){
32
- switch (arguments.length) {
33
- case 2:
34
- return new Notification({ title: title, message: msg })
35
- .show()
36
- .hide(4000);
37
- case 1:
38
- return new Notification({ message: title })
39
- .show()
40
- .hide(4000);
41
- }
42
- };
43
-
44
- /**
45
- * Construct a notification function for `type`.
46
- *
47
- * @param {String} type
48
- * @return {Function}
49
- * @api private
50
- */
51
-
52
- function type(type) {
53
- return function(title, msg){
54
- return exports.notify.apply(this, arguments)
55
- .type(type);
56
- }
57
- }
58
-
59
- /**
60
- * Notification methods.
61
- */
62
-
63
- exports.info = exports.notify;
64
- exports.warn = type('warn');
65
- exports.error = type('error');
66
-
67
- /**
68
- * Initialize a new `Notification`.
69
- *
70
- * Options:
71
- *
72
- * - `title` dialog title
73
- * - `message` a message to display
74
- *
75
- * @param {Object} options
76
- * @api public
77
- */
78
-
79
- function Notification(options) {
80
- ui.Emitter.call(this);
81
- options = options || {};
82
- this.template = html;
83
- this.el = $(this.template);
84
- this.render(options);
85
- if (Notification.effect) this.effect(Notification.effect);
86
- };
87
-
88
- /**
89
- * Inherit from `Emitter.prototype`.
90
- */
91
-
92
- Notification.prototype = new ui.Emitter;
93
-
94
- /**
95
- * Render with the given `options`.
96
- *
97
- * @param {Object} options
98
- * @api public
99
- */
100
-
101
- Notification.prototype.render = function(options){
102
- var el = this.el
103
- , title = options.title
104
- , msg = options.message
105
- , self = this;
106
-
107
- el.find('.close').click(function(){
108
- self.hide();
109
- return false;
110
- });
111
-
112
- el.click(function(e){
113
- e.preventDefault();
114
- self.emit('click', e);
115
- });
116
-
117
- el.find('h1').text(title);
118
- if (!title) el.find('h1').remove();
119
-
120
- // message
121
- if ('string' == typeof msg) {
122
- el.find('p').text(msg);
123
- } else if (msg) {
124
- el.find('p').replaceWith(msg.el || msg);
125
- }
126
-
127
- setTimeout(function(){
128
- el.removeClass('hide');
129
- }, 0);
130
- };
131
-
132
- /**
133
- * Enable the dialog close link.
134
- *
135
- * @return {Notification} for chaining
136
- * @api public
137
- */
138
-
139
- Notification.prototype.closable = function(){
140
- this.el.addClass('closable');
141
- return this;
142
- };
143
-
144
- /**
145
- * Set the effect to `type`.
146
- *
147
- * @param {String} type
148
- * @return {Notification} for chaining
149
- * @api public
150
- */
151
-
152
- Notification.prototype.effect = function(type){
153
- this._effect = type;
154
- this.el.addClass(type);
155
- return this;
156
- };
157
-
158
- /**
159
- * Show the notification.
160
- *
161
- * @return {Notification} for chaining
162
- * @api public
163
- */
164
-
165
- Notification.prototype.show = function(){
166
- this.el.appendTo(list);
167
- return this;
168
- };
169
-
170
- /**
171
- * Set the notification `type`.
172
- *
173
- * @param {String} type
174
- * @return {Notification} for chaining
175
- * @api public
176
- */
177
-
178
- Notification.prototype.type = function(type){
179
- this._type = type;
180
- this.el.addClass(type);
181
- return this;
182
- };
183
-
184
- /**
185
- * Make it stick (clear hide timer), and make it closable.
186
- *
187
- * @return {Notification} for chaining
188
- * @api public
189
- */
190
-
191
- Notification.prototype.sticky = function(){
192
- return this.hide(0).closable();
193
- };
194
-
195
- /**
196
- * Hide the dialog with optional delay of `ms`,
197
- * otherwise the notification is removed immediately.
198
- *
199
- * @return {Number} ms
200
- * @return {Notification} for chaining
201
- * @api public
202
- */
203
-
204
- Notification.prototype.hide = function(ms){
205
- var self = this;
206
-
207
- // duration
208
- if ('number' == typeof ms) {
209
- clearTimeout(this.timer);
210
- if (!ms) return this;
211
- this.timer = setTimeout(function(){
212
- self.hide();
213
- }, ms);
214
- return this;
215
- }
216
-
217
- // hide / remove
218
- this.el.addClass('hide');
219
- if (this._effect) {
220
- setTimeout(function(){
221
- self.remove();
222
- }, 500);
223
- } else {
224
- self.remove();
225
- }
226
-
227
- return this;
228
- };
229
-
230
- /**
231
- * Hide the notification without potential animation.
232
- *
233
- * @return {Dialog} for chaining
234
- * @api public
235
- */
236
-
237
- Notification.prototype.remove = function(){
238
- this.el.remove();
239
- return this;
240
- };