uikit-on-rails 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (120) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +18 -0
  3. data/README.md +37 -0
  4. data/Rakefile +1 -0
  5. data/lib/uikit-on-rails.rb +1 -0
  6. data/lib/uikit/sass/rails.rb +2 -0
  7. data/lib/uikit/sass/rails/engine.rb +12 -0
  8. data/lib/uikit/sass/rails/version.rb +7 -0
  9. data/uikit-on-rails.gemspec +23 -0
  10. data/vendor/assets/fonts/fontawesome-webfont.eot +0 -0
  11. data/vendor/assets/fonts/fontawesome-webfont.otf +0 -0
  12. data/vendor/assets/fonts/fontawesome-webfont.svg +565 -0
  13. data/vendor/assets/fonts/fontawesome-webfont.ttf +0 -0
  14. data/vendor/assets/fonts/fontawesome-webfont.woff +0 -0
  15. data/vendor/assets/fonts/fontawesome-webfont.woff2 +0 -0
  16. data/vendor/assets/javascripts/uikit.js +19 -0
  17. data/vendor/assets/javascripts/uikit/components/accordion.js +180 -0
  18. data/vendor/assets/javascripts/uikit/components/autocomplete.js +340 -0
  19. data/vendor/assets/javascripts/uikit/components/datepicker.js +3167 -0
  20. data/vendor/assets/javascripts/uikit/components/form-password.js +67 -0
  21. data/vendor/assets/javascripts/uikit/components/form-select.js +85 -0
  22. data/vendor/assets/javascripts/uikit/components/grid-parallax.js +168 -0
  23. data/vendor/assets/javascripts/uikit/components/grid.js +540 -0
  24. data/vendor/assets/javascripts/uikit/components/htmleditor.js +679 -0
  25. data/vendor/assets/javascripts/uikit/components/lightbox.js +591 -0
  26. data/vendor/assets/javascripts/uikit/components/nestable.js +653 -0
  27. data/vendor/assets/javascripts/uikit/components/notify.js +189 -0
  28. data/vendor/assets/javascripts/uikit/components/pagination.js +147 -0
  29. data/vendor/assets/javascripts/uikit/components/parallax.js +462 -0
  30. data/vendor/assets/javascripts/uikit/components/search.js +92 -0
  31. data/vendor/assets/javascripts/uikit/components/slider.js +552 -0
  32. data/vendor/assets/javascripts/uikit/components/slideset.js +523 -0
  33. data/vendor/assets/javascripts/uikit/components/slideshow-fx.js +383 -0
  34. data/vendor/assets/javascripts/uikit/components/slideshow.js +596 -0
  35. data/vendor/assets/javascripts/uikit/components/sortable.js +688 -0
  36. data/vendor/assets/javascripts/uikit/components/sticky.js +364 -0
  37. data/vendor/assets/javascripts/uikit/components/timepicker.js +192 -0
  38. data/vendor/assets/javascripts/uikit/components/tooltip.js +234 -0
  39. data/vendor/assets/javascripts/uikit/components/upload.js +262 -0
  40. data/vendor/assets/javascripts/uikit/core/alert.js +66 -0
  41. data/vendor/assets/javascripts/uikit/core/button.js +156 -0
  42. data/vendor/assets/javascripts/uikit/core/core.js +820 -0
  43. data/vendor/assets/javascripts/uikit/core/cover.js +95 -0
  44. data/vendor/assets/javascripts/uikit/core/dropdown.js +529 -0
  45. data/vendor/assets/javascripts/uikit/core/grid.js +117 -0
  46. data/vendor/assets/javascripts/uikit/core/modal.js +389 -0
  47. data/vendor/assets/javascripts/uikit/core/nav.js +152 -0
  48. data/vendor/assets/javascripts/uikit/core/offcanvas.js +197 -0
  49. data/vendor/assets/javascripts/uikit/core/scrollspy.js +209 -0
  50. data/vendor/assets/javascripts/uikit/core/smooth-scroll.js +62 -0
  51. data/vendor/assets/javascripts/uikit/core/switcher.js +309 -0
  52. data/vendor/assets/javascripts/uikit/core/tab.js +167 -0
  53. data/vendor/assets/javascripts/uikit/core/toggle.js +124 -0
  54. data/vendor/assets/javascripts/uikit/core/touch.js +175 -0
  55. data/vendor/assets/javascripts/uikit/core/utility.js +338 -0
  56. data/vendor/assets/javascripts/uikit/uikit.js +3905 -0
  57. data/vendor/assets/stylesheets/extra/font-awesome.scss +14 -0
  58. data/vendor/assets/stylesheets/uikit.scss +7 -0
  59. data/vendor/assets/stylesheets/uikit/components/accordion.scss +94 -0
  60. data/vendor/assets/stylesheets/uikit/components/autocomplete.scss +107 -0
  61. data/vendor/assets/stylesheets/uikit/components/datepicker.scss +197 -0
  62. data/vendor/assets/stylesheets/uikit/components/dotnav.scss +212 -0
  63. data/vendor/assets/stylesheets/uikit/components/form-advanced.scss +128 -0
  64. data/vendor/assets/stylesheets/uikit/components/form-file.scss +63 -0
  65. data/vendor/assets/stylesheets/uikit/components/form-password.scss +74 -0
  66. data/vendor/assets/stylesheets/uikit/components/form-select.scss +66 -0
  67. data/vendor/assets/stylesheets/uikit/components/htmleditor.scss +269 -0
  68. data/vendor/assets/stylesheets/uikit/components/nestable.scss +231 -0
  69. data/vendor/assets/stylesheets/uikit/components/notify.scss +190 -0
  70. data/vendor/assets/stylesheets/uikit/components/placeholder.scss +66 -0
  71. data/vendor/assets/stylesheets/uikit/components/progress.scss +173 -0
  72. data/vendor/assets/stylesheets/uikit/components/search.scss +309 -0
  73. data/vendor/assets/stylesheets/uikit/components/slidenav.scss +183 -0
  74. data/vendor/assets/stylesheets/uikit/components/slider.scss +139 -0
  75. data/vendor/assets/stylesheets/uikit/components/slideshow.scss +208 -0
  76. data/vendor/assets/stylesheets/uikit/components/sortable.scss +124 -0
  77. data/vendor/assets/stylesheets/uikit/components/sticky.scss +57 -0
  78. data/vendor/assets/stylesheets/uikit/components/tooltip.scss +177 -0
  79. data/vendor/assets/stylesheets/uikit/components/upload.scss +34 -0
  80. data/vendor/assets/stylesheets/uikit/core/alert.scss +141 -0
  81. data/vendor/assets/stylesheets/uikit/core/animation.scss +599 -0
  82. data/vendor/assets/stylesheets/uikit/core/article.scss +139 -0
  83. data/vendor/assets/stylesheets/uikit/core/badge.scss +110 -0
  84. data/vendor/assets/stylesheets/uikit/core/base.scss +563 -0
  85. data/vendor/assets/stylesheets/uikit/core/block.scss +155 -0
  86. data/vendor/assets/stylesheets/uikit/core/breadcrumb.scss +86 -0
  87. data/vendor/assets/stylesheets/uikit/core/button.scss +406 -0
  88. data/vendor/assets/stylesheets/uikit/core/close.scss +132 -0
  89. data/vendor/assets/stylesheets/uikit/core/column.scss +209 -0
  90. data/vendor/assets/stylesheets/uikit/core/comment.scss +172 -0
  91. data/vendor/assets/stylesheets/uikit/core/contrast.scss +493 -0
  92. data/vendor/assets/stylesheets/uikit/core/cover.scss +70 -0
  93. data/vendor/assets/stylesheets/uikit/core/description-list.scss +71 -0
  94. data/vendor/assets/stylesheets/uikit/core/dropdown.scss +280 -0
  95. data/vendor/assets/stylesheets/uikit/core/flex.scss +320 -0
  96. data/vendor/assets/stylesheets/uikit/core/form.scss +629 -0
  97. data/vendor/assets/stylesheets/uikit/core/grid.scss +731 -0
  98. data/vendor/assets/stylesheets/uikit/core/icon.scss +930 -0
  99. data/vendor/assets/stylesheets/uikit/core/list.scss +102 -0
  100. data/vendor/assets/stylesheets/uikit/core/modal.scss +343 -0
  101. data/vendor/assets/stylesheets/uikit/core/nav.scss +468 -0
  102. data/vendor/assets/stylesheets/uikit/core/navbar.scss +325 -0
  103. data/vendor/assets/stylesheets/uikit/core/offcanvas.scss +203 -0
  104. data/vendor/assets/stylesheets/uikit/core/overlay.scss +534 -0
  105. data/vendor/assets/stylesheets/uikit/core/pagination.scss +197 -0
  106. data/vendor/assets/stylesheets/uikit/core/panel.scss +332 -0
  107. data/vendor/assets/stylesheets/uikit/core/print.scss +61 -0
  108. data/vendor/assets/stylesheets/uikit/core/subnav.scss +213 -0
  109. data/vendor/assets/stylesheets/uikit/core/switcher.scss +38 -0
  110. data/vendor/assets/stylesheets/uikit/core/tab.scss +368 -0
  111. data/vendor/assets/stylesheets/uikit/core/table.scss +147 -0
  112. data/vendor/assets/stylesheets/uikit/core/text.scss +136 -0
  113. data/vendor/assets/stylesheets/uikit/core/thumbnail.scss +122 -0
  114. data/vendor/assets/stylesheets/uikit/core/thumbnav.scss +122 -0
  115. data/vendor/assets/stylesheets/uikit/core/utility.scss +610 -0
  116. data/vendor/assets/stylesheets/uikit/core/variables.scss +23 -0
  117. data/vendor/assets/stylesheets/uikit/uikit-mixins.scss +327 -0
  118. data/vendor/assets/stylesheets/uikit/uikit-variables.scss +819 -0
  119. data/vendor/assets/stylesheets/uikit/uikit.scss +52 -0
  120. metadata +177 -0
@@ -0,0 +1,117 @@
1
+ /*! UIkit 2.27.1 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
2
+ (function(UI) {
3
+
4
+ "use strict";
5
+
6
+ var grids = [];
7
+
8
+ UI.component('gridMatchHeight', {
9
+
10
+ defaults: {
11
+ target : false,
12
+ row : true,
13
+ ignorestacked : false,
14
+ observe : false
15
+ },
16
+
17
+ boot: function() {
18
+
19
+ // init code
20
+ UI.ready(function(context) {
21
+
22
+ UI.$("[data-uk-grid-match]", context).each(function() {
23
+ var grid = UI.$(this), obj;
24
+
25
+ if (!grid.data("gridMatchHeight")) {
26
+ obj = UI.gridMatchHeight(grid, UI.Utils.options(grid.attr("data-uk-grid-match")));
27
+ }
28
+ });
29
+ });
30
+ },
31
+
32
+ init: function() {
33
+
34
+ var $this = this;
35
+
36
+ this.columns = this.element.children();
37
+ this.elements = this.options.target ? this.find(this.options.target) : this.columns;
38
+
39
+ if (!this.columns.length) return;
40
+
41
+ UI.$win.on('load resize orientationchange', (function() {
42
+
43
+ var fn = function() {
44
+ if ($this.element.is(":visible")) $this.match();
45
+ };
46
+
47
+ UI.$(function() { fn(); });
48
+
49
+ return UI.Utils.debounce(fn, 50);
50
+ })());
51
+
52
+ if (this.options.observe) {
53
+
54
+ UI.domObserve(this.element, function(e) {
55
+ if ($this.element.is(":visible")) $this.match();
56
+ });
57
+ }
58
+
59
+ this.on("display.uk.check", function(e) {
60
+ if(this.element.is(":visible")) this.match();
61
+ }.bind(this));
62
+
63
+ grids.push(this);
64
+ },
65
+
66
+ match: function() {
67
+
68
+ var firstvisible = this.columns.filter(":visible:first");
69
+
70
+ if (!firstvisible.length) return;
71
+
72
+ var stacked = Math.ceil(100 * parseFloat(firstvisible.css('width')) / parseFloat(firstvisible.parent().css('width'))) >= 100;
73
+
74
+ if (stacked && !this.options.ignorestacked) {
75
+ this.revert();
76
+ } else {
77
+ UI.Utils.matchHeights(this.elements, this.options);
78
+ }
79
+
80
+ return this;
81
+ },
82
+
83
+ revert: function() {
84
+ this.elements.css('min-height', '');
85
+ return this;
86
+ }
87
+ });
88
+
89
+ UI.component('gridMargin', {
90
+
91
+ defaults: {
92
+ cls : 'uk-grid-margin',
93
+ rowfirst : 'uk-row-first'
94
+ },
95
+
96
+ boot: function() {
97
+
98
+ // init code
99
+ UI.ready(function(context) {
100
+
101
+ UI.$("[data-uk-grid-margin]", context).each(function() {
102
+ var grid = UI.$(this), obj;
103
+
104
+ if (!grid.data("gridMargin")) {
105
+ obj = UI.gridMargin(grid, UI.Utils.options(grid.attr("data-uk-grid-margin")));
106
+ }
107
+ });
108
+ });
109
+ },
110
+
111
+ init: function() {
112
+
113
+ var stackMargin = UI.stackMargin(this.element, this.options);
114
+ }
115
+ });
116
+
117
+ })(UIkit);
@@ -0,0 +1,389 @@
1
+ /*! UIkit 2.27.1 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
2
+ (function(UI) {
3
+
4
+ "use strict";
5
+
6
+ var active = false, activeCount = 0, $html = UI.$html, body;
7
+
8
+ UI.$win.on("resize orientationchange", UI.Utils.debounce(function(){
9
+ UI.$('.uk-modal.uk-open').each(function(){
10
+ return UI.$(this).data('modal') && UI.$(this).data('modal').resize();
11
+ });
12
+ }, 150));
13
+
14
+ UI.component('modal', {
15
+
16
+ defaults: {
17
+ keyboard: true,
18
+ bgclose: true,
19
+ minScrollHeight: 150,
20
+ center: false,
21
+ modal: true
22
+ },
23
+
24
+ scrollable: false,
25
+ transition: false,
26
+ hasTransitioned: true,
27
+
28
+ init: function() {
29
+
30
+ if (!body) body = UI.$('body');
31
+
32
+ if (!this.element.length) return;
33
+
34
+ var $this = this;
35
+
36
+ this.paddingdir = "padding-" + (UI.langdirection == 'left' ? "right":"left");
37
+ this.dialog = this.find(".uk-modal-dialog");
38
+
39
+ this.active = false;
40
+
41
+ // Update ARIA
42
+ this.element.attr('aria-hidden', this.element.hasClass("uk-open"));
43
+
44
+ this.on("click", ".uk-modal-close", function(e) {
45
+ e.preventDefault();
46
+ $this.hide();
47
+ }).on("click", function(e) {
48
+
49
+ var target = UI.$(e.target);
50
+
51
+ if (target[0] == $this.element[0] && $this.options.bgclose) {
52
+ $this.hide();
53
+ }
54
+ });
55
+
56
+ UI.domObserve(this.element, function(e) { $this.resize(); });
57
+ },
58
+
59
+ toggle: function() {
60
+ return this[this.isActive() ? "hide" : "show"]();
61
+ },
62
+
63
+ show: function() {
64
+
65
+ if (!this.element.length) return;
66
+
67
+ var $this = this;
68
+
69
+ if (this.isActive()) return;
70
+
71
+ if (this.options.modal && active) {
72
+ active.hide(true);
73
+ }
74
+
75
+ this.element.removeClass("uk-open").show();
76
+ this.resize(true);
77
+
78
+ if (this.options.modal) {
79
+ active = this;
80
+ }
81
+
82
+ this.active = true;
83
+
84
+ activeCount++;
85
+
86
+ if (UI.support.transition) {
87
+ this.hasTransitioned = false;
88
+ this.element.one(UI.support.transition.end, function(){
89
+ $this.hasTransitioned = true;
90
+ UI.Utils.focus($this.dialog, 'a[href]');
91
+ }).addClass("uk-open");
92
+ } else {
93
+ this.element.addClass("uk-open");
94
+ UI.Utils.focus(this.dialog, 'a[href]');
95
+ }
96
+
97
+ $html.addClass("uk-modal-page").height(); // force browser engine redraw
98
+
99
+ // Update ARIA
100
+ this.element.attr('aria-hidden', 'false');
101
+
102
+ this.element.trigger("show.uk.modal");
103
+
104
+ UI.Utils.checkDisplay(this.dialog, true);
105
+
106
+ return this;
107
+ },
108
+
109
+ hide: function(force) {
110
+
111
+ if (!force && UI.support.transition && this.hasTransitioned) {
112
+
113
+ var $this = this;
114
+
115
+ this.one(UI.support.transition.end, function() {
116
+ $this._hide();
117
+ }).removeClass("uk-open");
118
+
119
+ } else {
120
+
121
+ this._hide();
122
+ }
123
+
124
+ return this;
125
+ },
126
+
127
+ resize: function(force) {
128
+
129
+ if (!this.isActive() && !force) return;
130
+
131
+ var bodywidth = body.width();
132
+
133
+ this.scrollbarwidth = window.innerWidth - bodywidth;
134
+
135
+ body.css(this.paddingdir, this.scrollbarwidth);
136
+
137
+ this.element.css('overflow-y', this.scrollbarwidth ? 'scroll' : 'auto');
138
+
139
+ if (!this.updateScrollable() && this.options.center) {
140
+
141
+ var dh = this.dialog.outerHeight(),
142
+ pad = parseInt(this.dialog.css('margin-top'), 10) + parseInt(this.dialog.css('margin-bottom'), 10);
143
+
144
+ if ((dh + pad) < window.innerHeight) {
145
+ this.dialog.css({'top': (window.innerHeight/2 - dh/2) - pad });
146
+ } else {
147
+ this.dialog.css({'top': ''});
148
+ }
149
+ }
150
+ },
151
+
152
+ updateScrollable: function() {
153
+
154
+ // has scrollable?
155
+ var scrollable = this.dialog.find('.uk-overflow-container:visible:first');
156
+
157
+ if (scrollable.length) {
158
+
159
+ scrollable.css('height', 0);
160
+
161
+ var offset = Math.abs(parseInt(this.dialog.css('margin-top'), 10)),
162
+ dh = this.dialog.outerHeight(),
163
+ wh = window.innerHeight,
164
+ h = wh - 2*(offset < 20 ? 20:offset) - dh;
165
+
166
+ scrollable.css({
167
+ 'max-height': (h < this.options.minScrollHeight ? '':h),
168
+ 'height':''
169
+ });
170
+
171
+ return true;
172
+ }
173
+
174
+ return false;
175
+ },
176
+
177
+ _hide: function() {
178
+
179
+ this.active = false;
180
+ if (activeCount > 0) activeCount--;
181
+ else activeCount = 0;
182
+
183
+ this.element.hide().removeClass('uk-open');
184
+
185
+ // Update ARIA
186
+ this.element.attr('aria-hidden', 'true');
187
+
188
+ if (!activeCount) {
189
+ $html.removeClass('uk-modal-page');
190
+ body.css(this.paddingdir, "");
191
+ }
192
+
193
+ if (active===this) active = false;
194
+
195
+ this.trigger('hide.uk.modal');
196
+ },
197
+
198
+ isActive: function() {
199
+ return this.element.hasClass('uk-open');
200
+ }
201
+
202
+ });
203
+
204
+ UI.component('modalTrigger', {
205
+
206
+ boot: function() {
207
+
208
+ // init code
209
+ UI.$html.on("click.modal.uikit", "[data-uk-modal]", function(e) {
210
+
211
+ var ele = UI.$(this);
212
+
213
+ if (ele.is("a")) {
214
+ e.preventDefault();
215
+ }
216
+
217
+ if (!ele.data("modalTrigger")) {
218
+ var modal = UI.modalTrigger(ele, UI.Utils.options(ele.attr("data-uk-modal")));
219
+ modal.show();
220
+ }
221
+
222
+ });
223
+
224
+ // close modal on esc button
225
+ UI.$html.on('keydown.modal.uikit', function (e) {
226
+
227
+ if (active && e.keyCode === 27 && active.options.keyboard) { // ESC
228
+ e.preventDefault();
229
+ active.hide();
230
+ }
231
+ });
232
+ },
233
+
234
+ init: function() {
235
+
236
+ var $this = this;
237
+
238
+ this.options = UI.$.extend({
239
+ "target": $this.element.is("a") ? $this.element.attr("href") : false
240
+ }, this.options);
241
+
242
+ this.modal = UI.modal(this.options.target, this.options);
243
+
244
+ this.on("click", function(e) {
245
+ e.preventDefault();
246
+ $this.show();
247
+ });
248
+
249
+ //methods
250
+ this.proxy(this.modal, "show hide isActive");
251
+ }
252
+ });
253
+
254
+ UI.modal.dialog = function(content, options) {
255
+
256
+ var modal = UI.modal(UI.$(UI.modal.dialog.template).appendTo("body"), options);
257
+
258
+ modal.on("hide.uk.modal", function(){
259
+ if (modal.persist) {
260
+ modal.persist.appendTo(modal.persist.data("modalPersistParent"));
261
+ modal.persist = false;
262
+ }
263
+ modal.element.remove();
264
+ });
265
+
266
+ setContent(content, modal);
267
+
268
+ return modal;
269
+ };
270
+
271
+ UI.modal.dialog.template = '<div class="uk-modal"><div class="uk-modal-dialog" style="min-height:0;"></div></div>';
272
+
273
+ UI.modal.alert = function(content, options) {
274
+
275
+ options = UI.$.extend(true, {bgclose:false, keyboard:false, modal:false, labels:UI.modal.labels}, options);
276
+
277
+ var modal = UI.modal.dialog(([
278
+ '<div class="uk-margin uk-modal-content">'+String(content)+'</div>',
279
+ '<div class="uk-modal-footer uk-text-right"><button class="uk-button uk-button-primary uk-modal-close">'+options.labels.Ok+'</button></div>'
280
+ ]).join(""), options);
281
+
282
+ modal.on('show.uk.modal', function(){
283
+ setTimeout(function(){
284
+ modal.element.find('button:first').focus();
285
+ }, 50);
286
+ });
287
+
288
+ return modal.show();
289
+ };
290
+
291
+ UI.modal.confirm = function(content, onconfirm, oncancel) {
292
+
293
+ var options = arguments.length > 1 && arguments[arguments.length-1] ? arguments[arguments.length-1] : {};
294
+
295
+ onconfirm = UI.$.isFunction(onconfirm) ? onconfirm : function(){};
296
+ oncancel = UI.$.isFunction(oncancel) ? oncancel : function(){};
297
+ options = UI.$.extend(true, {bgclose:false, keyboard:false, modal:false, labels:UI.modal.labels}, UI.$.isFunction(options) ? {}:options);
298
+
299
+ var modal = UI.modal.dialog(([
300
+ '<div class="uk-margin uk-modal-content">'+String(content)+'</div>',
301
+ '<div class="uk-modal-footer uk-text-right"><button class="uk-button js-modal-confirm-cancel">'+options.labels.Cancel+'</button> <button class="uk-button uk-button-primary js-modal-confirm">'+options.labels.Ok+'</button></div>'
302
+ ]).join(""), options);
303
+
304
+ modal.element.find(".js-modal-confirm, .js-modal-confirm-cancel").on("click", function(){
305
+ UI.$(this).is('.js-modal-confirm') ? onconfirm() : oncancel();
306
+ modal.hide();
307
+ });
308
+
309
+ modal.on('show.uk.modal', function(){
310
+ setTimeout(function(){
311
+ modal.element.find('.js-modal-confirm').focus();
312
+ }, 50);
313
+ });
314
+
315
+ return modal.show();
316
+ };
317
+
318
+ UI.modal.prompt = function(text, value, onsubmit, options) {
319
+
320
+ onsubmit = UI.$.isFunction(onsubmit) ? onsubmit : function(value){};
321
+ options = UI.$.extend(true, {bgclose:false, keyboard:false, modal:false, labels:UI.modal.labels}, options);
322
+
323
+ var modal = UI.modal.dialog(([
324
+ text ? '<div class="uk-modal-content uk-form">'+String(text)+'</div>':'',
325
+ '<div class="uk-margin-small-top uk-modal-content uk-form"><p><input type="text" class="uk-width-1-1"></p></div>',
326
+ '<div class="uk-modal-footer uk-text-right"><button class="uk-button uk-modal-close">'+options.labels.Cancel+'</button> <button class="uk-button uk-button-primary js-modal-ok">'+options.labels.Ok+'</button></div>'
327
+ ]).join(""), options),
328
+
329
+ input = modal.element.find("input[type='text']").val(value || '').on('keyup', function(e){
330
+ if (e.keyCode == 13) {
331
+ modal.element.find(".js-modal-ok").trigger('click');
332
+ }
333
+ });
334
+
335
+ modal.element.find(".js-modal-ok").on("click", function(){
336
+ if (onsubmit(input.val())!==false){
337
+ modal.hide();
338
+ }
339
+ });
340
+
341
+ return modal.show();
342
+ };
343
+
344
+ UI.modal.blockUI = function(content, options) {
345
+
346
+ var modal = UI.modal.dialog(([
347
+ '<div class="uk-margin uk-modal-content">'+String(content || '<div class="uk-text-center">...</div>')+'</div>'
348
+ ]).join(""), UI.$.extend({bgclose:false, keyboard:false, modal:false}, options));
349
+
350
+ modal.content = modal.element.find('.uk-modal-content:first');
351
+
352
+ return modal.show();
353
+ };
354
+
355
+
356
+ UI.modal.labels = {
357
+ 'Ok': 'Ok',
358
+ 'Cancel': 'Cancel'
359
+ };
360
+
361
+
362
+ // helper functions
363
+ function setContent(content, modal){
364
+
365
+ if(!modal) return;
366
+
367
+ if (typeof content === 'object') {
368
+
369
+ // convert DOM object to a jQuery object
370
+ content = content instanceof jQuery ? content : UI.$(content);
371
+
372
+ if(content.parent().length) {
373
+ modal.persist = content;
374
+ modal.persist.data("modalPersistParent", content.parent());
375
+ }
376
+ }else if (typeof content === 'string' || typeof content === 'number') {
377
+ // just insert the data as innerHTML
378
+ content = UI.$('<div></div>').html(content);
379
+ }else {
380
+ // unsupported data type!
381
+ content = UI.$('<div></div>').html('UIkit.modal Error: Unsupported data type: ' + typeof content);
382
+ }
383
+
384
+ content.appendTo(modal.element.find('.uk-modal-dialog'));
385
+
386
+ return modal;
387
+ }
388
+
389
+ })(UIkit);