uikit-sass-rails 1.3.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (125) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -0
  3. data/README.md +15 -12
  4. data/lib/uikit/sass/rails/engine.rb +1 -1
  5. data/lib/uikit/sass/rails/version.rb +1 -1
  6. data/vendor/assets/fonts/fontawesome-webfont.eot +0 -0
  7. data/vendor/assets/fonts/fontawesome-webfont.otf +0 -0
  8. data/vendor/assets/fonts/fontawesome-webfont.svg +525 -464
  9. data/vendor/assets/fonts/fontawesome-webfont.ttf +0 -0
  10. data/vendor/assets/fonts/fontawesome-webfont.woff +0 -0
  11. data/vendor/assets/fonts/fontawesome-webfont.woff2 +0 -0
  12. data/vendor/assets/javascripts/uikit.js +30 -3
  13. data/vendor/assets/javascripts/uikit/components/accordion.js +172 -0
  14. data/vendor/assets/javascripts/uikit/components/autocomplete.js +48 -27
  15. data/vendor/assets/javascripts/uikit/components/datepicker.js +2887 -97
  16. data/vendor/assets/javascripts/uikit/components/form-password.js +24 -19
  17. data/vendor/assets/javascripts/uikit/components/form-select.js +24 -18
  18. data/vendor/assets/javascripts/uikit/components/grid.js +524 -0
  19. data/vendor/assets/javascripts/uikit/components/htmleditor.js +46 -39
  20. data/vendor/assets/javascripts/uikit/components/lightbox.js +543 -0
  21. data/vendor/assets/javascripts/uikit/components/nestable.js +125 -98
  22. data/vendor/assets/javascripts/uikit/components/notify.js +34 -22
  23. data/vendor/assets/javascripts/uikit/components/pagination.js +24 -21
  24. data/vendor/assets/javascripts/uikit/components/parallax.js +400 -0
  25. data/vendor/assets/javascripts/uikit/components/search.js +19 -16
  26. data/vendor/assets/javascripts/uikit/components/slider.js +482 -0
  27. data/vendor/assets/javascripts/uikit/components/slideset.js +498 -0
  28. data/vendor/assets/javascripts/uikit/components/slideshow-fx.js +377 -0
  29. data/vendor/assets/javascripts/uikit/components/slideshow.js +540 -0
  30. data/vendor/assets/javascripts/uikit/components/sortable.js +392 -263
  31. data/vendor/assets/javascripts/uikit/components/sticky.js +127 -68
  32. data/vendor/assets/javascripts/uikit/components/timepicker.js +65 -42
  33. data/vendor/assets/javascripts/uikit/components/tooltip.js +220 -0
  34. data/vendor/assets/javascripts/uikit/components/upload.js +11 -10
  35. data/vendor/assets/javascripts/uikit/core/alert.js +66 -0
  36. data/vendor/assets/javascripts/uikit/core/button.js +154 -0
  37. data/vendor/assets/javascripts/uikit/core/core.js +717 -0
  38. data/vendor/assets/javascripts/uikit/{components → core}/cover.js +41 -35
  39. data/vendor/assets/javascripts/uikit/core/dropdown.js +296 -0
  40. data/vendor/assets/javascripts/uikit/core/grid.js +172 -0
  41. data/vendor/assets/javascripts/uikit/core/modal.js +323 -0
  42. data/vendor/assets/javascripts/uikit/core/nav.js +117 -0
  43. data/vendor/assets/javascripts/uikit/core/offcanvas.js +178 -0
  44. data/vendor/assets/javascripts/uikit/core/scrollspy.js +208 -0
  45. data/vendor/assets/javascripts/uikit/core/smooth-scroll.js +62 -0
  46. data/vendor/assets/javascripts/uikit/core/switcher.js +298 -0
  47. data/vendor/assets/javascripts/uikit/core/tab.js +159 -0
  48. data/vendor/assets/javascripts/uikit/core/toggle.js +117 -0
  49. data/vendor/assets/javascripts/uikit/core/touch.js +173 -0
  50. data/vendor/assets/javascripts/uikit/core/utility.js +157 -0
  51. data/vendor/assets/javascripts/uikit/uikit.js +1538 -871
  52. data/vendor/assets/stylesheets/extra/font-awesome.scss +4 -7
  53. data/vendor/assets/stylesheets/uikit.scss +22 -1
  54. data/vendor/assets/stylesheets/uikit/almost-flat.scss +22 -2
  55. data/vendor/assets/stylesheets/uikit/components/accordion.almost-flat.scss +45 -0
  56. data/vendor/assets/stylesheets/uikit/components/accordion.gradient.scss +45 -0
  57. data/vendor/assets/stylesheets/uikit/components/accordion.scss +43 -0
  58. data/vendor/assets/stylesheets/uikit/components/autocomplete.almost-flat.scss +62 -0
  59. data/vendor/assets/stylesheets/uikit/components/autocomplete.gradient.scss +62 -0
  60. data/vendor/assets/stylesheets/uikit/components/autocomplete.scss +60 -0
  61. data/vendor/assets/stylesheets/uikit/components/datepicker.almost-flat.scss +148 -0
  62. data/vendor/assets/stylesheets/uikit/components/datepicker.gradient.scss +158 -0
  63. data/vendor/assets/stylesheets/uikit/components/datepicker.scss +142 -0
  64. data/vendor/assets/stylesheets/uikit/components/dotnav.almost-flat.scss +152 -0
  65. data/vendor/assets/stylesheets/uikit/components/dotnav.gradient.scss +152 -0
  66. data/vendor/assets/stylesheets/uikit/components/dotnav.scss +148 -0
  67. data/vendor/assets/stylesheets/uikit/components/form-advanced.almost-flat.scss +92 -0
  68. data/vendor/assets/stylesheets/uikit/components/form-advanced.gradient.scss +92 -0
  69. data/vendor/assets/stylesheets/uikit/components/form-advanced.scss +92 -0
  70. data/vendor/assets/stylesheets/uikit/components/form-file.almost-flat.scss +36 -0
  71. data/vendor/assets/stylesheets/uikit/components/form-file.gradient.scss +36 -0
  72. data/vendor/assets/stylesheets/uikit/components/form-file.scss +36 -0
  73. data/vendor/assets/stylesheets/uikit/components/form-password.almost-flat.scss +37 -0
  74. data/vendor/assets/stylesheets/uikit/components/form-password.gradient.scss +37 -0
  75. data/vendor/assets/stylesheets/uikit/components/form-password.scss +37 -0
  76. data/vendor/assets/stylesheets/uikit/components/form-select.almost-flat.scss +37 -0
  77. data/vendor/assets/stylesheets/uikit/components/form-select.gradient.scss +37 -0
  78. data/vendor/assets/stylesheets/uikit/components/form-select.scss +37 -0
  79. data/vendor/assets/stylesheets/uikit/components/htmleditor.almost-flat.scss +282 -0
  80. data/vendor/assets/stylesheets/uikit/components/htmleditor.gradient.scss +290 -0
  81. data/vendor/assets/stylesheets/uikit/components/htmleditor.scss +208 -0
  82. data/vendor/assets/stylesheets/uikit/components/nestable.almost-flat.scss +137 -0
  83. data/vendor/assets/stylesheets/uikit/components/nestable.gradient.scss +141 -0
  84. data/vendor/assets/stylesheets/uikit/components/nestable.scss +134 -0
  85. data/vendor/assets/stylesheets/uikit/components/notify.almost-flat.scss +112 -0
  86. data/vendor/assets/stylesheets/uikit/components/notify.gradient.scss +112 -0
  87. data/vendor/assets/stylesheets/uikit/components/notify.scss +106 -0
  88. data/vendor/assets/stylesheets/uikit/components/placeholder.almost-flat.scss +36 -0
  89. data/vendor/assets/stylesheets/uikit/components/placeholder.gradient.scss +36 -0
  90. data/vendor/assets/stylesheets/uikit/components/placeholder.scss +36 -0
  91. data/vendor/assets/stylesheets/uikit/components/progress.almost-flat.scss +130 -0
  92. data/vendor/assets/stylesheets/uikit/components/progress.gradient.scss +138 -0
  93. data/vendor/assets/stylesheets/uikit/components/progress.scss +118 -0
  94. data/vendor/assets/stylesheets/uikit/components/search.almost-flat.scss +216 -0
  95. data/vendor/assets/stylesheets/uikit/components/search.gradient.scss +216 -0
  96. data/vendor/assets/stylesheets/uikit/components/search.scss +214 -0
  97. data/vendor/assets/stylesheets/uikit/components/slidenav.almost-flat.scss +110 -0
  98. data/vendor/assets/stylesheets/uikit/components/slidenav.gradient.scss +110 -0
  99. data/vendor/assets/stylesheets/uikit/components/slidenav.scss +110 -0
  100. data/vendor/assets/stylesheets/uikit/components/slider.almost-flat.scss +105 -0
  101. data/vendor/assets/stylesheets/uikit/components/slider.gradient.scss +105 -0
  102. data/vendor/assets/stylesheets/uikit/components/slider.scss +105 -0
  103. data/vendor/assets/stylesheets/uikit/components/slideshow.almost-flat.scss +166 -0
  104. data/vendor/assets/stylesheets/uikit/components/slideshow.gradient.scss +166 -0
  105. data/vendor/assets/stylesheets/uikit/components/slideshow.scss +166 -0
  106. data/vendor/assets/stylesheets/uikit/components/sortable.almost-flat.scss +90 -0
  107. data/vendor/assets/stylesheets/uikit/components/sortable.gradient.scss +90 -0
  108. data/vendor/assets/stylesheets/uikit/components/sortable.scss +90 -0
  109. data/vendor/assets/stylesheets/uikit/components/sticky.almost-flat.scss +39 -0
  110. data/vendor/assets/stylesheets/uikit/components/sticky.gradient.scss +39 -0
  111. data/vendor/assets/stylesheets/uikit/components/sticky.scss +39 -0
  112. data/vendor/assets/stylesheets/uikit/components/tooltip.almost-flat.scss +129 -0
  113. data/vendor/assets/stylesheets/uikit/components/tooltip.gradient.scss +129 -0
  114. data/vendor/assets/stylesheets/uikit/components/tooltip.scss +127 -0
  115. data/vendor/assets/stylesheets/uikit/components/upload.almost-flat.scss +11 -0
  116. data/vendor/assets/stylesheets/uikit/components/upload.gradient.scss +11 -0
  117. data/vendor/assets/stylesheets/uikit/components/upload.scss +11 -0
  118. data/vendor/assets/stylesheets/uikit/gradient.scss +22 -2
  119. data/vendor/assets/stylesheets/uikit/uikit.almost-flat.scss +1768 -498
  120. data/vendor/assets/stylesheets/uikit/uikit.gradient.scss +1776 -512
  121. data/vendor/assets/stylesheets/uikit/uikit.scss +1722 -462
  122. metadata +92 -7
  123. data/vendor/assets/stylesheets/uikit/components/uikit.components.almost-flat.scss +0 -1586
  124. data/vendor/assets/stylesheets/uikit/components/uikit.components.gradient.scss +0 -1608
  125. data/vendor/assets/stylesheets/uikit/components/uikit.components.scss +0 -1489
@@ -1,19 +1,21 @@
1
- /*! UIkit 2.11.1 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
1
+ /*! UIkit 2.20.3 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
2
2
  (function(addon) {
3
3
 
4
4
  var component;
5
5
 
6
- if (jQuery && jQuery.UIkit) {
7
- component = addon(jQuery, jQuery.UIkit);
6
+ if (window.UIkit) {
7
+ component = addon(UIkit);
8
8
  }
9
9
 
10
10
  if (typeof define == "function" && define.amd) {
11
11
  define("uikit-sticky", ["uikit"], function(){
12
- return component || addon(jQuery, jQuery.UIkit);
12
+ return component || addon(UIkit);
13
13
  });
14
14
  }
15
15
 
16
- })(function($, UI){
16
+ })(function(UI){
17
+
18
+ "use strict";
17
19
 
18
20
  var $win = UI.$win,
19
21
  $doc = UI.$doc,
@@ -28,28 +30,78 @@
28
30
  clsinit : 'uk-sticky-init',
29
31
  clsactive : 'uk-active',
30
32
  getWidthFrom : '',
33
+ boundary : false,
31
34
  media : false,
32
- target : false
35
+ target : false,
36
+ disabled : false
37
+ },
38
+
39
+ boot: function() {
40
+
41
+ // should be more efficient than using $win.scroll(checkscrollposition):
42
+ UI.$doc.on('scrolling.uk.document', function() { checkscrollposition(); });
43
+ UI.$win.on('resize orientationchange', UI.Utils.debounce(function() {
44
+
45
+ if (!sticked.length) return;
46
+
47
+ for (var i = 0; i < sticked.length; i++) {
48
+ sticked[i].reset(true);
49
+ sticked[i].self.computeWrapper();
50
+ }
51
+
52
+ checkscrollposition();
53
+ }, 100));
54
+
55
+ // init code
56
+ UI.ready(function(context) {
57
+
58
+ setTimeout(function(){
59
+
60
+ UI.$("[data-uk-sticky]", context).each(function(){
61
+
62
+ var $ele = UI.$(this);
63
+
64
+ if(!$ele.data("sticky")) {
65
+ UI.sticky($ele, UI.Utils.options($ele.attr('data-uk-sticky')));
66
+ }
67
+ });
68
+
69
+ checkscrollposition();
70
+ }, 0);
71
+ });
33
72
  },
34
73
 
35
74
  init: function() {
36
75
 
37
- var wrapper = $('<div class="uk-sticky-placeholder"></div>').css({
38
- 'height' : this.element.css('position') != 'absolute' ? this.element.outerHeight() : '',
39
- 'float' : this.element.css("float") != "none" ? this.element.css("float") : '',
40
- 'margin' : this.element.css("margin")
41
- });
76
+ var wrapper = UI.$('<div class="uk-sticky-placeholder"></div>'), boundary = this.options.boundary, boundtoparent;
77
+
78
+ this.wrapper = this.element.css('margin', 0).wrap(wrapper).parent();
79
+
80
+ this.computeWrapper();
81
+
82
+ if (boundary) {
42
83
 
43
- wrapper = this.element.css('margin', 0).wrap(wrapper).parent();
84
+ if (boundary === true) {
85
+
86
+ boundary = this.wrapper.parent();
87
+ boundtoparent = true;
88
+
89
+ } else if (typeof boundary === "string") {
90
+ boundary = UI.$(boundary);
91
+ }
92
+ }
44
93
 
45
94
  this.sticky = {
46
- options : this.options,
47
- element : this.element,
48
- currentTop : null,
49
- wrapper : wrapper,
50
- init : false,
51
- getWidthFrom : this.options.getWidthFrom || wrapper,
52
- reset : function(force) {
95
+ self : this,
96
+ options : this.options,
97
+ element : this.element,
98
+ currentTop : null,
99
+ wrapper : this.wrapper,
100
+ init : false,
101
+ getWidthFrom : this.options.getWidthFrom || this.wrapper,
102
+ boundary : boundary,
103
+ boundtoparent : boundtoparent,
104
+ reset : function(force) {
53
105
 
54
106
  var finalize = function() {
55
107
  this.element.css({"position":"", "top":"", "width":"", "left":"", "margin":"0"});
@@ -73,8 +125,13 @@
73
125
  finalize();
74
126
  }
75
127
  },
128
+
76
129
  check: function() {
77
130
 
131
+ if (this.options.disabled) {
132
+ return false;
133
+ }
134
+
78
135
  if (this.options.media) {
79
136
 
80
137
  switch(typeof(this.options.media)) {
@@ -93,7 +150,7 @@
93
150
 
94
151
  var scrollTop = $win.scrollTop(),
95
152
  documentHeight = $doc.height(),
96
- dwh = documentHeight - $win.height(),
153
+ dwh = documentHeight - window.innerHeight,
97
154
  extra = (scrollTop > dwh) ? dwh - scrollTop : 0,
98
155
  elementTop = this.wrapper.offset().top,
99
156
  etse = elementTop - this.options.top - extra;
@@ -106,31 +163,50 @@
106
163
  },
107
164
 
108
165
  update: function() {
109
- scroller();
166
+ checkscrollposition(this.sticky);
167
+ },
168
+
169
+ enable: function() {
170
+ this.options.disabled = false;
171
+ this.update();
172
+ },
173
+
174
+ disable: function(force) {
175
+ this.options.disabled = true;
176
+ this.sticky.reset(force);
177
+ },
178
+
179
+ computeWrapper: function() {
180
+
181
+ this.wrapper.css({
182
+ 'height' : this.element.css('position') != 'absolute' ? this.element.outerHeight() : '',
183
+ 'float' : this.element.css("float") != "none" ? this.element.css("float") : '',
184
+ 'margin' : this.element.css("margin")
185
+ });
110
186
  }
111
187
  });
112
188
 
113
- function scroller() {
189
+ function checkscrollposition() {
114
190
 
115
- if (!sticked.length) return;
191
+ var stickies = arguments.length ? arguments : sticked;
192
+
193
+ if (!stickies.length || $win.scrollTop() < 0) return;
116
194
 
117
195
  var scrollTop = $win.scrollTop(),
118
196
  documentHeight = $doc.height(),
119
- dwh = documentHeight - $win.height(),
197
+ windowHeight = $win.height(),
198
+ dwh = documentHeight - windowHeight,
120
199
  extra = (scrollTop > dwh) ? dwh - scrollTop : 0,
121
- cls, newTop;
122
-
123
- if(scrollTop < 0) return;
200
+ newTop, containerBottom, stickyHeight, sticky;
124
201
 
202
+ for (var i = 0; i < stickies.length; i++) {
125
203
 
126
- for (var i = 0; i < sticked.length; i++) {
204
+ sticky = stickies[i];
127
205
 
128
- if (!sticked[i].element.is(":visible") || sticked[i].animate) {
206
+ if (!sticky.element.is(":visible") || sticky.animate) {
129
207
  continue;
130
208
  }
131
209
 
132
- var sticky = sticked[i];
133
-
134
210
  if (!sticky.check()) {
135
211
 
136
212
  if (sticky.currentTop !== null) {
@@ -142,16 +218,31 @@
142
218
  if (sticky.options.top < 0) {
143
219
  newTop = 0;
144
220
  } else {
145
- newTop = documentHeight - sticky.element.outerHeight() - sticky.options.top - sticky.options.bottom - scrollTop - extra;
221
+ stickyHeight = sticky.element.outerHeight();
222
+ newTop = documentHeight - stickyHeight - sticky.options.top - sticky.options.bottom - scrollTop - extra;
146
223
  newTop = newTop < 0 ? newTop + sticky.options.top : sticky.options.top;
147
224
  }
148
225
 
226
+ if (sticky.boundary && sticky.boundary.length) {
227
+
228
+ var bTop = sticky.boundary.position().top;
229
+
230
+ if (sticky.boundtoparent) {
231
+ containerBottom = documentHeight - (bTop + sticky.boundary.outerHeight()) + parseInt(sticky.boundary.css('padding-bottom'));
232
+ } else {
233
+ containerBottom = documentHeight - bTop - parseInt(sticky.boundary.css('margin-top'));
234
+ }
235
+
236
+ newTop = (scrollTop + stickyHeight) > (documentHeight - containerBottom - (sticky.options.top < 0 ? 0 : sticky.options.top)) ? (documentHeight - containerBottom) - (scrollTop + stickyHeight) : newTop;
237
+ }
238
+
239
+
149
240
  if (sticky.currentTop != newTop) {
150
241
 
151
242
  sticky.element.css({
152
243
  "position" : "fixed",
153
244
  "top" : newTop,
154
- "width" : (typeof sticky.getWidthFrom !== 'undefined') ? $(sticky.getWidthFrom).width() : sticky.element.width(),
245
+ "width" : (typeof sticky.getWidthFrom !== 'undefined') ? UI.$(sticky.getWidthFrom).width() : sticky.element.width(),
155
246
  "left" : sticky.wrapper.offset().left
156
247
  });
157
248
 
@@ -161,7 +252,7 @@
161
252
 
162
253
  if (location.hash && scrollTop > 0 && sticky.options.target) {
163
254
 
164
- var $target = $(location.hash);
255
+ var $target = UI.$(location.hash);
165
256
 
166
257
  if ($target.length) {
167
258
 
@@ -201,39 +292,7 @@
201
292
 
202
293
  sticky.init = true;
203
294
  }
204
-
205
295
  }
206
296
 
207
- // should be more efficient than using $win.scroll(scroller):
208
- $doc.on('uk-scroll', scroller);
209
- $win.on('resize orientationchange', UI.Utils.debounce(function() {
210
-
211
- if (!sticked.length) return;
212
-
213
- for (var i = 0; i < sticked.length; i++) {
214
- sticked[i].reset(true);
215
- }
216
-
217
- scroller();
218
- }, 100));
219
-
220
- // init code
221
- UI.ready(function(context) {
222
-
223
- setTimeout(function(){
224
-
225
- $("[data-uk-sticky]", context).each(function(){
226
-
227
- var $ele = $(this);
228
-
229
- if(!$ele.data("sticky")) {
230
- UI.sticky($ele, UI.Utils.options($ele.attr('data-uk-sticky')));
231
- }
232
- });
233
-
234
- scroller();
235
- }, 0);
236
- });
237
-
238
- return $.fn.uksticky;
239
- });
297
+ return UI.sticky;
298
+ });
@@ -1,60 +1,52 @@
1
- /*! UIkit 2.11.1 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
1
+ /*! UIkit 2.20.3 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
2
2
  (function(addon) {
3
3
 
4
4
  var component;
5
5
 
6
- if (jQuery && jQuery.UIkit) {
7
- component = addon(jQuery, jQuery.UIkit);
6
+ if (window.UIkit) {
7
+ component = addon(UIkit);
8
8
  }
9
9
 
10
10
  if (typeof define == "function" && define.amd) {
11
11
  define("uikit-search", ["uikit"], function(){
12
- return component || addon(jQuery, jQuery.UIkit);
12
+ return component || addon(UIkit);
13
13
  });
14
14
  }
15
15
 
16
- })(function($, UI){
16
+ })(function(UI){
17
17
 
18
18
  "use strict";
19
19
 
20
- var times = {'12h':[], '24h':[]};
21
20
 
22
- for(var i = 0, h=''; i<24; i++) {
23
-
24
- h = ''+i;
25
-
26
- if(i<10) h = '0'+h;
27
-
28
- times['24h'].push({value: (h+':00')});
29
- times['24h'].push({value: (h+':30')});
30
-
31
- if (i > 0 && i<13) {
32
- times['12h'].push({value: (h+':00 AM')});
33
- times['12h'].push({value: (h+':30 AM')});
34
- }
35
-
36
- if (i > 12) {
21
+ UI.component('timepicker', {
37
22
 
38
- h = h-12;
23
+ defaults: {
24
+ format : '24h',
25
+ delay : 0,
26
+ start : 0,
27
+ end : 24
28
+ },
39
29
 
40
- if (h < 10) h = '0'+String(h);
30
+ boot: function() {
41
31
 
42
- times['12h'].push({value: (h+':00 PM')});
43
- times['12h'].push({value: (h+':30 PM')});
44
- }
45
- }
32
+ // init code
33
+ UI.$html.on("focus.timepicker.uikit", "[data-uk-timepicker]", function(e) {
46
34
 
35
+ var ele = UI.$(this);
47
36
 
48
- UI.component('timepicker', {
37
+ if (!ele.data("timepicker")) {
38
+ var obj = UI.timepicker(ele, UI.Utils.options(ele.attr("data-uk-timepicker")));
49
39
 
50
- defaults: {
51
- format : '24h',
52
- delay : 0
40
+ setTimeout(function(){
41
+ obj.autocomplete.input.focus();
42
+ }, 40);
43
+ }
44
+ });
53
45
  },
54
46
 
55
47
  init: function() {
56
48
 
57
- var $this = this;
49
+ var $this = this, times = getTimeRange(this.options.start, this.options.end);
58
50
 
59
51
  this.options.minLength = 0;
60
52
  this.options.template = '<ul class="uk-nav uk-nav-autocomplete uk-autocomplete-results">{{~items}}<li data-value="{{$item.value}}"><a>{{$item.value}}</a></li>{{/items}}</ul>';
@@ -68,7 +60,7 @@
68
60
  this.autocomplete = UI.autocomplete(this.element.parent(), this.options);
69
61
  this.autocomplete.dropdown.addClass('uk-dropdown-small uk-dropdown-scrollable');
70
62
 
71
- this.autocomplete.on('uk.autocomplete.show', function() {
63
+ this.autocomplete.on('show.uk.autocomplete', function() {
72
64
 
73
65
  var selected = $this.autocomplete.dropdown.find('[data-value="'+$this.autocomplete.input.val()+'"]');
74
66
 
@@ -149,16 +141,47 @@
149
141
  }
150
142
  });
151
143
 
152
- // init code
153
- UI.$html.on("focus.timepicker.uikit", "[data-uk-timepicker]", function(e) {
154
- var ele = $(this);
144
+ // helper
155
145
 
156
- if (!ele.data("timepicker")) {
157
- var obj = UI.timepicker(ele, UI.Utils.options(ele.attr("data-uk-timepicker")));
146
+ function getTimeRange(start, end) {
158
147
 
159
- setTimeout(function(){
160
- obj.autocomplete.input.focus();
161
- }, 20);
148
+ start = start || 0;
149
+ end = end || 24;
150
+
151
+ var times = {'12h':[], '24h':[]}, i, h;
152
+
153
+ for (i = start, h=''; i<end; i++) {
154
+
155
+ h = ''+i;
156
+
157
+ if (i<10) h = '0'+h;
158
+
159
+ times['24h'].push({value: (h+':00')});
160
+ times['24h'].push({value: (h+':30')});
161
+
162
+ if (i === 0) {
163
+ h = 12;
164
+ times['12h'].push({value: (h+':00 AM')});
165
+ times['12h'].push({value: (h+':30 AM')});
166
+ }
167
+
168
+ if (i > 0 && i<13 && i!==12) {
169
+ times['12h'].push({value: (h+':00 AM')});
170
+ times['12h'].push({value: (h+':30 AM')});
171
+ }
172
+
173
+ if (i >= 12) {
174
+
175
+ h = h-12;
176
+ if (h === 0) h = 12;
177
+ if (h < 10) h = '0'+String(h);
178
+
179
+ times['12h'].push({value: (h+':00 PM')});
180
+ times['12h'].push({value: (h+':30 PM')});
181
+ }
162
182
  }
163
- });
183
+
184
+ return times;
185
+ }
186
+
164
187
  });
@@ -0,0 +1,220 @@
1
+ /*! UIkit 2.20.3 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
2
+ (function(addon) {
3
+ var component;
4
+
5
+ if (window.UIkit) {
6
+ component = addon(UIkit);
7
+ }
8
+
9
+ if (typeof define == "function" && define.amd) {
10
+ define("uikit-tooltip", ["uikit"], function(){
11
+ return component || addon(UIkit);
12
+ });
13
+ }
14
+ })(function(UI){
15
+
16
+ "use strict";
17
+
18
+ var $tooltip, // tooltip container
19
+ tooltipdelay, checkdelay;
20
+
21
+ UI.component('tooltip', {
22
+
23
+ defaults: {
24
+ "offset": 5,
25
+ "pos": "top",
26
+ "animation": false,
27
+ "delay": 0, // in miliseconds
28
+ "cls": "",
29
+ "src": function() { return this.attr("title"); }
30
+ },
31
+
32
+ tip: "",
33
+
34
+ boot: function() {
35
+
36
+ // init code
37
+ UI.$html.on("mouseenter.tooltip.uikit focus.tooltip.uikit", "[data-uk-tooltip]", function(e) {
38
+ var ele = UI.$(this);
39
+
40
+ if (!ele.data("tooltip")) {
41
+ var obj = UI.tooltip(ele, UI.Utils.options(ele.attr("data-uk-tooltip")));
42
+ ele.trigger("mouseenter");
43
+ }
44
+ });
45
+ },
46
+
47
+ init: function() {
48
+
49
+ var $this = this;
50
+
51
+ if (!$tooltip) {
52
+ $tooltip = UI.$('<div class="uk-tooltip"></div>').appendTo("body");
53
+ }
54
+
55
+ this.on({
56
+ "focus" : function(e) { $this.show(); },
57
+ "blur" : function(e) { $this.hide(); },
58
+ "mouseenter": function(e) { $this.show(); },
59
+ "mouseleave": function(e) { $this.hide(); }
60
+ });
61
+
62
+ this.tip = typeof(this.options.src) === "function" ? this.options.src.call(this.element) : this.options.src;
63
+
64
+ // disable title attribute
65
+ this.element.attr("data-cached-title", this.element.attr("title")).attr("title", "");
66
+ },
67
+
68
+ show: function() {
69
+
70
+ if (tooltipdelay) clearTimeout(tooltipdelay);
71
+ if (checkdelay) clearTimeout(checkdelay);
72
+ if (!this.tip.length) return;
73
+
74
+ $tooltip.stop().css({"top": -2000, "visibility": "hidden"}).show();
75
+ $tooltip.html('<div class="uk-tooltip-inner">' + this.tip + '</div>');
76
+
77
+ var $this = this,
78
+ pos = UI.$.extend({}, this.element.offset(), {width: this.element[0].offsetWidth, height: this.element[0].offsetHeight}),
79
+ width = $tooltip[0].offsetWidth,
80
+ height = $tooltip[0].offsetHeight,
81
+ offset = typeof(this.options.offset) === "function" ? this.options.offset.call(this.element) : this.options.offset,
82
+ position = typeof(this.options.pos) === "function" ? this.options.pos.call(this.element) : this.options.pos,
83
+ tmppos = position.split("-"),
84
+ tcss = {
85
+ "display" : "none",
86
+ "visibility" : "visible",
87
+ "top" : (pos.top + pos.height + height),
88
+ "left" : pos.left
89
+ };
90
+
91
+
92
+ // prevent strange position
93
+ // when tooltip is in offcanvas etc.
94
+ if (UI.$html.css('position')=='fixed' || UI.$body.css('position')=='fixed'){
95
+ var bodyoffset = UI.$('body').offset(),
96
+ htmloffset = UI.$('html').offset(),
97
+ docoffset = {'top': (htmloffset.top + bodyoffset.top), 'left': (htmloffset.left + bodyoffset.left)};
98
+
99
+ pos.left -= docoffset.left;
100
+ pos.top -= docoffset.top;
101
+ }
102
+
103
+
104
+ if ((tmppos[0] == "left" || tmppos[0] == "right") && UI.langdirection == 'right') {
105
+ tmppos[0] = tmppos[0] == "left" ? "right" : "left";
106
+ }
107
+
108
+ var variants = {
109
+ "bottom" : {top: pos.top + pos.height + offset, left: pos.left + pos.width / 2 - width / 2},
110
+ "top" : {top: pos.top - height - offset, left: pos.left + pos.width / 2 - width / 2},
111
+ "left" : {top: pos.top + pos.height / 2 - height / 2, left: pos.left - width - offset},
112
+ "right" : {top: pos.top + pos.height / 2 - height / 2, left: pos.left + pos.width + offset}
113
+ };
114
+
115
+ UI.$.extend(tcss, variants[tmppos[0]]);
116
+
117
+ if (tmppos.length == 2) tcss.left = (tmppos[1] == 'left') ? (pos.left) : ((pos.left + pos.width) - width);
118
+
119
+ var boundary = this.checkBoundary(tcss.left, tcss.top, width, height);
120
+
121
+ if(boundary) {
122
+
123
+ switch(boundary) {
124
+ case "x":
125
+
126
+ if (tmppos.length == 2) {
127
+ position = tmppos[0]+"-"+(tcss.left < 0 ? "left": "right");
128
+ } else {
129
+ position = tcss.left < 0 ? "right": "left";
130
+ }
131
+
132
+ break;
133
+
134
+ case "y":
135
+ if (tmppos.length == 2) {
136
+ position = (tcss.top < 0 ? "bottom": "top")+"-"+tmppos[1];
137
+ } else {
138
+ position = (tcss.top < 0 ? "bottom": "top");
139
+ }
140
+
141
+ break;
142
+
143
+ case "xy":
144
+ if (tmppos.length == 2) {
145
+ position = (tcss.top < 0 ? "bottom": "top")+"-"+(tcss.left < 0 ? "left": "right");
146
+ } else {
147
+ position = tcss.left < 0 ? "right": "left";
148
+ }
149
+
150
+ break;
151
+
152
+ }
153
+
154
+ tmppos = position.split("-");
155
+
156
+ UI.$.extend(tcss, variants[tmppos[0]]);
157
+
158
+ if (tmppos.length == 2) tcss.left = (tmppos[1] == 'left') ? (pos.left) : ((pos.left + pos.width) - width);
159
+ }
160
+
161
+
162
+ tcss.left -= UI.$body.position().left;
163
+
164
+ tooltipdelay = setTimeout(function(){
165
+
166
+ $tooltip.css(tcss).attr("class", ["uk-tooltip", "uk-tooltip-"+position, $this.options.cls].join(' '));
167
+
168
+ if ($this.options.animation) {
169
+ $tooltip.css({opacity: 0, display: 'block'}).animate({opacity: 1}, parseInt($this.options.animation, 10) || 400);
170
+ } else {
171
+ $tooltip.show();
172
+ }
173
+
174
+ tooltipdelay = false;
175
+
176
+ // close tooltip if element was removed or hidden
177
+ checkdelay = setInterval(function(){
178
+ if(!$this.element.is(':visible')) $this.hide();
179
+ }, 150);
180
+
181
+ }, parseInt(this.options.delay, 10) || 0);
182
+ },
183
+
184
+ hide: function() {
185
+ if(this.element.is("input") && this.element[0]===document.activeElement) return;
186
+
187
+ if(tooltipdelay) clearTimeout(tooltipdelay);
188
+ if (checkdelay) clearTimeout(checkdelay);
189
+
190
+ $tooltip.stop();
191
+
192
+ if (this.options.animation) {
193
+ $tooltip.fadeOut(parseInt(this.options.animation, 10) || 400);
194
+ } else {
195
+ $tooltip.hide();
196
+ }
197
+ },
198
+
199
+ content: function() {
200
+ return this.tip;
201
+ },
202
+
203
+ checkBoundary: function(left, top, width, height) {
204
+
205
+ var axis = "";
206
+
207
+ if(left < 0 || ((left - UI.$win.scrollLeft())+width) > window.innerWidth) {
208
+ axis += "x";
209
+ }
210
+
211
+ if(top < 0 || ((top - UI.$win.scrollTop())+height) > window.innerHeight) {
212
+ axis += "y";
213
+ }
214
+
215
+ return axis;
216
+ }
217
+ });
218
+
219
+ return UI.tooltip;
220
+ });