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,22 +1,23 @@
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-upload", ["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
- UI.component('uploadSelect', {
18
+ "use strict";
19
19
 
20
+ UI.component('uploadSelect', {
20
21
 
21
22
  init: function() {
22
23
 
@@ -49,7 +50,7 @@
49
50
  e.preventDefault();
50
51
 
51
52
  $this.element.removeClass($this.options.dragoverClass);
52
- $this.element.trigger('uk.dropped', [e.dataTransfer.files]);
53
+ $this.element.trigger('dropped.uk.upload', [e.dataTransfer.files]);
53
54
 
54
55
  xhrupload(e.dataTransfer.files, $this.options);
55
56
  }
@@ -93,7 +94,7 @@
93
94
  })();
94
95
 
95
96
  if (UI.support.ajaxupload){
96
- $.event.props.push("dataTransfer");
97
+ UI.$.event.props.push("dataTransfer");
97
98
  }
98
99
 
99
100
  function xhrupload(files, settings) {
@@ -102,7 +103,7 @@
102
103
  return this;
103
104
  }
104
105
 
105
- settings = $.extend({}, xhrupload.defaults, settings);
106
+ settings = UI.$.extend({}, xhrupload.defaults, settings);
106
107
 
107
108
  if (!files.length){
108
109
  return;
@@ -197,7 +198,7 @@
197
198
 
198
199
  if (settings.type=="json") {
199
200
  try {
200
- response = $.parseJSON(response);
201
+ response = UI.$.parseJSON(response);
201
202
  } catch(e) {
202
203
  response = false;
203
204
  }
@@ -0,0 +1,66 @@
1
+ /*! UIkit 2.20.3 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
2
+ (function(UI) {
3
+
4
+ "use strict";
5
+
6
+ UI.component('alert', {
7
+
8
+ defaults: {
9
+ "fade": true,
10
+ "duration": 200,
11
+ "trigger": ".uk-alert-close"
12
+ },
13
+
14
+ boot: function() {
15
+
16
+ // init code
17
+ UI.$html.on("click.alert.uikit", "[data-uk-alert]", function(e) {
18
+
19
+ var ele = UI.$(this);
20
+
21
+ if (!ele.data("alert")) {
22
+
23
+ var alert = UI.alert(ele, UI.Utils.options(ele.attr("data-uk-alert")));
24
+
25
+ if (UI.$(e.target).is(alert.options.trigger)) {
26
+ e.preventDefault();
27
+ alert.close();
28
+ }
29
+ }
30
+ });
31
+ },
32
+
33
+ init: function() {
34
+
35
+ var $this = this;
36
+
37
+ this.on("click", this.options.trigger, function(e) {
38
+ e.preventDefault();
39
+ $this.close();
40
+ });
41
+ },
42
+
43
+ close: function() {
44
+
45
+ var element = this.trigger("close.uk.alert"),
46
+ removeElement = function () {
47
+ this.trigger("closed.uk.alert").remove();
48
+ }.bind(this);
49
+
50
+ if (this.options.fade) {
51
+ element.css("overflow", "hidden").css("max-height", element.height()).animate({
52
+ "height" : 0,
53
+ "opacity" : 0,
54
+ "padding-top" : 0,
55
+ "padding-bottom" : 0,
56
+ "margin-top" : 0,
57
+ "margin-bottom" : 0
58
+ }, this.options.duration, removeElement);
59
+ } else {
60
+ removeElement();
61
+ }
62
+ }
63
+
64
+ });
65
+
66
+ })(UIkit);
@@ -0,0 +1,154 @@
1
+ /*! UIkit 2.20.3 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
2
+ (function(UI) {
3
+
4
+ "use strict";
5
+
6
+ UI.component('buttonRadio', {
7
+
8
+ defaults: {
9
+ "target": ".uk-button"
10
+ },
11
+
12
+ boot: function() {
13
+
14
+ // init code
15
+ UI.$html.on("click.buttonradio.uikit", "[data-uk-button-radio]", function(e) {
16
+
17
+ var ele = UI.$(this);
18
+
19
+ if (!ele.data("buttonRadio")) {
20
+
21
+ var obj = UI.buttonRadio(ele, UI.Utils.options(ele.attr("data-uk-button-radio"))),
22
+ target = UI.$(e.target);
23
+
24
+ if (target.is(obj.options.target)) {
25
+ target.trigger("click");
26
+ }
27
+ }
28
+ });
29
+ },
30
+
31
+ init: function() {
32
+
33
+ var $this = this;
34
+
35
+ // Init ARIA
36
+ this.find($this.options.target).attr('aria-checked', 'false').filter(".uk-active").attr('aria-checked', 'true');
37
+
38
+ this.on("click", this.options.target, function(e) {
39
+
40
+ var ele = UI.$(this);
41
+
42
+ if (ele.is('a[href="#"]')) e.preventDefault();
43
+
44
+ $this.find($this.options.target).not(ele).removeClass("uk-active").blur();
45
+ ele.addClass("uk-active");
46
+
47
+ // Update ARIA
48
+ $this.find($this.options.target).not(ele).attr('aria-checked', 'false');
49
+ ele.attr('aria-checked', 'true');
50
+
51
+ $this.trigger("change.uk.button", [ele]);
52
+ });
53
+
54
+ },
55
+
56
+ getSelected: function() {
57
+ return this.find(".uk-active");
58
+ }
59
+ });
60
+
61
+ UI.component('buttonCheckbox', {
62
+
63
+ defaults: {
64
+ "target": ".uk-button"
65
+ },
66
+
67
+ boot: function() {
68
+
69
+ UI.$html.on("click.buttoncheckbox.uikit", "[data-uk-button-checkbox]", function(e) {
70
+ var ele = UI.$(this);
71
+
72
+ if (!ele.data("buttonCheckbox")) {
73
+
74
+ var obj = UI.buttonCheckbox(ele, UI.Utils.options(ele.attr("data-uk-button-checkbox"))),
75
+ target = UI.$(e.target);
76
+
77
+ if (target.is(obj.options.target)) {
78
+ target.trigger("click");
79
+ }
80
+ }
81
+ });
82
+ },
83
+
84
+ init: function() {
85
+
86
+ var $this = this;
87
+
88
+ // Init ARIA
89
+ this.find($this.options.target).attr('aria-checked', 'false').filter(".uk-active").attr('aria-checked', 'true');
90
+
91
+ this.on("click", this.options.target, function(e) {
92
+ var ele = UI.$(this);
93
+
94
+ if (ele.is('a[href="#"]')) e.preventDefault();
95
+
96
+ ele.toggleClass("uk-active").blur();
97
+
98
+ // Update ARIA
99
+ ele.attr('aria-checked', ele.hasClass("uk-active"));
100
+
101
+ $this.trigger("change.uk.button", [ele]);
102
+ });
103
+
104
+ },
105
+
106
+ getSelected: function() {
107
+ return this.find(".uk-active");
108
+ }
109
+ });
110
+
111
+
112
+ UI.component('button', {
113
+
114
+ defaults: {},
115
+
116
+ boot: function() {
117
+
118
+ UI.$html.on("click.button.uikit", "[data-uk-button]", function(e) {
119
+ var ele = UI.$(this);
120
+
121
+ if (!ele.data("button")) {
122
+
123
+ var obj = UI.button(ele, UI.Utils.options(ele.attr("data-uk-button")));
124
+ ele.trigger("click");
125
+ }
126
+ });
127
+ },
128
+
129
+ init: function() {
130
+
131
+ var $this = this;
132
+
133
+ // Init ARIA
134
+ this.element.attr('aria-pressed', this.element.hasClass("uk-active"));
135
+
136
+ this.on("click", function(e) {
137
+
138
+ if ($this.element.is('a[href="#"]')) e.preventDefault();
139
+
140
+ $this.toggle();
141
+ $this.trigger("change.uk.button", [$this.element.blur().hasClass("uk-active")]);
142
+ });
143
+
144
+ },
145
+
146
+ toggle: function() {
147
+ this.element.toggleClass("uk-active");
148
+
149
+ // Update ARIA
150
+ this.element.attr('aria-pressed', this.element.hasClass("uk-active"));
151
+ }
152
+ });
153
+
154
+ })(UIkit);
@@ -0,0 +1,717 @@
1
+ /*! UIkit 2.20.3 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
2
+ (function(core) {
3
+
4
+ if (typeof define == "function" && define.amd) { // AMD
5
+ define("uikit", function(){
6
+
7
+ var uikit = window.UIkit || core(window, window.jQuery, window.document);
8
+
9
+ uikit.load = function(res, req, onload, config) {
10
+
11
+ var resources = res.split(','), load = [], i, base = (config.config && config.config.uikit && config.config.uikit.base ? config.config.uikit.base : "").replace(/\/+$/g, "");
12
+
13
+ if (!base) {
14
+ throw new Error( "Please define base path to UIkit in the requirejs config." );
15
+ }
16
+
17
+ for (i = 0; i < resources.length; i += 1) {
18
+ var resource = resources[i].replace(/\./g, '/');
19
+ load.push(base+'/components/'+resource);
20
+ }
21
+
22
+ req(load, function() {
23
+ onload(uikit);
24
+ });
25
+ };
26
+
27
+ return uikit;
28
+ });
29
+ }
30
+
31
+ if (!window.jQuery) {
32
+ throw new Error( "UIkit requires jQuery" );
33
+ }
34
+
35
+ if (window && window.jQuery) {
36
+ core(window, window.jQuery, window.document);
37
+ }
38
+
39
+
40
+ })(function(global, $, doc) {
41
+
42
+ "use strict";
43
+
44
+ var UI = {}, _UI = global.UIkit ? Object.create(global.UIkit) : undefined;
45
+
46
+ UI.version = '2.20.3';
47
+
48
+ UI.noConflict = function() {
49
+ // restore UIkit version
50
+ if (_UI) {
51
+ global.UIkit = _UI;
52
+ $.UIkit = _UI;
53
+ $.fn.uk = _UI.fn;
54
+ }
55
+
56
+ return UI;
57
+ };
58
+
59
+ UI.prefix = function(str) {
60
+ return str;
61
+ };
62
+
63
+ // cache jQuery
64
+ UI.$ = $;
65
+
66
+ UI.$doc = UI.$(document);
67
+ UI.$win = UI.$(window);
68
+ UI.$html = UI.$('html');
69
+
70
+ UI.support = {};
71
+ UI.support.transition = (function() {
72
+
73
+ var transitionEnd = (function() {
74
+
75
+ var element = doc.body || doc.documentElement,
76
+ transEndEventNames = {
77
+ WebkitTransition : 'webkitTransitionEnd',
78
+ MozTransition : 'transitionend',
79
+ OTransition : 'oTransitionEnd otransitionend',
80
+ transition : 'transitionend'
81
+ }, name;
82
+
83
+ for (name in transEndEventNames) {
84
+ if (element.style[name] !== undefined) return transEndEventNames[name];
85
+ }
86
+ }());
87
+
88
+ return transitionEnd && { end: transitionEnd };
89
+ })();
90
+
91
+ UI.support.animation = (function() {
92
+
93
+ var animationEnd = (function() {
94
+
95
+ var element = doc.body || doc.documentElement,
96
+ animEndEventNames = {
97
+ WebkitAnimation : 'webkitAnimationEnd',
98
+ MozAnimation : 'animationend',
99
+ OAnimation : 'oAnimationEnd oanimationend',
100
+ animation : 'animationend'
101
+ }, name;
102
+
103
+ for (name in animEndEventNames) {
104
+ if (element.style[name] !== undefined) return animEndEventNames[name];
105
+ }
106
+ }());
107
+
108
+ return animationEnd && { end: animationEnd };
109
+ })();
110
+
111
+ // requestAnimationFrame polyfill
112
+ // https://gist.github.com/paulirish/1579671
113
+ (function(){
114
+
115
+ var lastTime = 0;
116
+
117
+ global.requestAnimationFrame = global.requestAnimationFrame || global.webkitRequestAnimationFrame || function(callback, element) {
118
+ var currTime = new Date().getTime();
119
+ var timeToCall = Math.max(0, 16 - (currTime - lastTime));
120
+ var id = global.setTimeout(function() { callback(currTime + timeToCall); }, timeToCall);
121
+ lastTime = currTime + timeToCall;
122
+ return id;
123
+ };
124
+
125
+ if (!global.cancelAnimationFrame) {
126
+
127
+ global.cancelAnimationFrame = function(id) {
128
+ clearTimeout(id);
129
+ };
130
+ }
131
+
132
+ })();
133
+
134
+ UI.support.touch = (
135
+ ('ontouchstart' in document) ||
136
+ (global.DocumentTouch && document instanceof global.DocumentTouch) ||
137
+ (global.navigator.msPointerEnabled && global.navigator.msMaxTouchPoints > 0) || //IE 10
138
+ (global.navigator.pointerEnabled && global.navigator.maxTouchPoints > 0) || //IE >=11
139
+ false
140
+ );
141
+
142
+ UI.support.mutationobserver = (global.MutationObserver || global.WebKitMutationObserver || null);
143
+
144
+ UI.Utils = {};
145
+
146
+ UI.Utils.str2json = function(str, notevil) {
147
+ try {
148
+ if (notevil) {
149
+ return JSON.parse(str
150
+ // wrap keys without quote with valid double quote
151
+ .replace(/([\$\w]+)\s*:/g, function(_, $1){return '"'+$1+'":';})
152
+ // replacing single quote wrapped ones to double quote
153
+ .replace(/'([^']+)'/g, function(_, $1){return '"'+$1+'"';})
154
+ );
155
+ } else {
156
+ return (new Function("", "var json = " + str + "; return JSON.parse(JSON.stringify(json));"))();
157
+ }
158
+ } catch(e) { return false; }
159
+ };
160
+
161
+ UI.Utils.debounce = function(func, wait, immediate) {
162
+ var timeout;
163
+ return function() {
164
+ var context = this, args = arguments;
165
+ var later = function() {
166
+ timeout = null;
167
+ if (!immediate) func.apply(context, args);
168
+ };
169
+ var callNow = immediate && !timeout;
170
+ clearTimeout(timeout);
171
+ timeout = setTimeout(later, wait);
172
+ if (callNow) func.apply(context, args);
173
+ };
174
+ };
175
+
176
+ UI.Utils.removeCssRules = function(selectorRegEx) {
177
+ var idx, idxs, stylesheet, _i, _j, _k, _len, _len1, _len2, _ref;
178
+
179
+ if(!selectorRegEx) return;
180
+
181
+ setTimeout(function(){
182
+ try {
183
+ _ref = document.styleSheets;
184
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
185
+ stylesheet = _ref[_i];
186
+ idxs = [];
187
+ stylesheet.cssRules = stylesheet.cssRules;
188
+ for (idx = _j = 0, _len1 = stylesheet.cssRules.length; _j < _len1; idx = ++_j) {
189
+ if (stylesheet.cssRules[idx].type === CSSRule.STYLE_RULE && selectorRegEx.test(stylesheet.cssRules[idx].selectorText)) {
190
+ idxs.unshift(idx);
191
+ }
192
+ }
193
+ for (_k = 0, _len2 = idxs.length; _k < _len2; _k++) {
194
+ stylesheet.deleteRule(idxs[_k]);
195
+ }
196
+ }
197
+ } catch (_error) {}
198
+ }, 0);
199
+ };
200
+
201
+ UI.Utils.isInView = function(element, options) {
202
+
203
+ var $element = $(element);
204
+
205
+ if (!$element.is(':visible')) {
206
+ return false;
207
+ }
208
+
209
+ var window_left = UI.$win.scrollLeft(), window_top = UI.$win.scrollTop(), offset = $element.offset(), left = offset.left, top = offset.top;
210
+
211
+ options = $.extend({topoffset:0, leftoffset:0}, options);
212
+
213
+ if (top + $element.height() >= window_top && top - options.topoffset <= window_top + UI.$win.height() &&
214
+ left + $element.width() >= window_left && left - options.leftoffset <= window_left + UI.$win.width()) {
215
+ return true;
216
+ } else {
217
+ return false;
218
+ }
219
+ };
220
+
221
+ UI.Utils.checkDisplay = function(context, initanimation) {
222
+
223
+ var elements = UI.$('[data-uk-margin], [data-uk-grid-match], [data-uk-grid-margin], [data-uk-check-display]', context || document), animated;
224
+
225
+ if (context && !elements.length) {
226
+ elements = $(context);
227
+ }
228
+
229
+ elements.trigger('display.uk.check');
230
+
231
+ // fix firefox / IE animations
232
+ if (initanimation) {
233
+
234
+ if (typeof(initanimation)!='string') {
235
+ initanimation = '[class*="uk-animation-"]';
236
+ }
237
+
238
+ elements.find(initanimation).each(function(){
239
+
240
+ var ele = UI.$(this),
241
+ cls = ele.attr('class'),
242
+ anim = cls.match(/uk\-animation\-(.+)/);
243
+
244
+ ele.removeClass(anim[0]).width();
245
+
246
+ ele.addClass(anim[0]);
247
+ });
248
+ }
249
+
250
+ return elements;
251
+ };
252
+
253
+ UI.Utils.options = function(string) {
254
+
255
+ if ($.isPlainObject(string)) return string;
256
+
257
+ var start = (string ? string.indexOf("{") : -1), options = {};
258
+
259
+ if (start != -1) {
260
+ try {
261
+ options = UI.Utils.str2json(string.substr(start));
262
+ } catch (e) {}
263
+ }
264
+
265
+ return options;
266
+ };
267
+
268
+ UI.Utils.animate = function(element, cls) {
269
+
270
+ var d = $.Deferred();
271
+
272
+ element = UI.$(element);
273
+ cls = cls;
274
+
275
+ element.css('display', 'none').addClass(cls).one(UI.support.animation.end, function() {
276
+ element.removeClass(cls);
277
+ d.resolve();
278
+ }).width();
279
+
280
+ element.css('display', '');
281
+
282
+ return d.promise();
283
+ };
284
+
285
+ UI.Utils.uid = function(prefix) {
286
+ return (prefix || 'id') + (new Date().getTime())+"RAND"+(Math.ceil(Math.random() * 100000));
287
+ };
288
+
289
+ UI.Utils.template = function(str, data) {
290
+
291
+ var tokens = str.replace(/\n/g, '\\n').replace(/\{\{\{\s*(.+?)\s*\}\}\}/g, "{{!$1}}").split(/(\{\{\s*(.+?)\s*\}\})/g),
292
+ i=0, toc, cmd, prop, val, fn, output = [], openblocks = 0;
293
+
294
+ while(i < tokens.length) {
295
+
296
+ toc = tokens[i];
297
+
298
+ if(toc.match(/\{\{\s*(.+?)\s*\}\}/)) {
299
+ i = i + 1;
300
+ toc = tokens[i];
301
+ cmd = toc[0];
302
+ prop = toc.substring(toc.match(/^(\^|\#|\!|\~|\:)/) ? 1:0);
303
+
304
+ switch(cmd) {
305
+ case '~':
306
+ output.push("for(var $i=0;$i<"+prop+".length;$i++) { var $item = "+prop+"[$i];");
307
+ openblocks++;
308
+ break;
309
+ case ':':
310
+ output.push("for(var $key in "+prop+") { var $val = "+prop+"[$key];");
311
+ openblocks++;
312
+ break;
313
+ case '#':
314
+ output.push("if("+prop+") {");
315
+ openblocks++;
316
+ break;
317
+ case '^':
318
+ output.push("if(!"+prop+") {");
319
+ openblocks++;
320
+ break;
321
+ case '/':
322
+ output.push("}");
323
+ openblocks--;
324
+ break;
325
+ case '!':
326
+ output.push("__ret.push("+prop+");");
327
+ break;
328
+ default:
329
+ output.push("__ret.push(escape("+prop+"));");
330
+ break;
331
+ }
332
+ } else {
333
+ output.push("__ret.push('"+toc.replace(/\'/g, "\\'")+"');");
334
+ }
335
+ i = i + 1;
336
+ }
337
+
338
+ fn = new Function('$data', [
339
+ 'var __ret = [];',
340
+ 'try {',
341
+ 'with($data){', (!openblocks ? output.join('') : '__ret = ["Not all blocks are closed correctly."]'), '};',
342
+ '}catch(e){__ret = [e.message];}',
343
+ 'return __ret.join("").replace(/\\n\\n/g, "\\n");',
344
+ "function escape(html) { return String(html).replace(/&/g, '&amp;').replace(/\"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;');}"
345
+ ].join("\n"));
346
+
347
+ return data ? fn(data) : fn;
348
+ };
349
+
350
+ UI.Utils.events = {};
351
+ UI.Utils.events.click = UI.support.touch ? 'tap' : 'click';
352
+
353
+ global.UIkit = UI;
354
+
355
+ // deprecated
356
+
357
+ UI.fn = function(command, options) {
358
+
359
+ var args = arguments, cmd = command.match(/^([a-z\-]+)(?:\.([a-z]+))?/i), component = cmd[1], method = cmd[2];
360
+
361
+ if (!UI[component]) {
362
+ $.error("UIkit component [" + component + "] does not exist.");
363
+ return this;
364
+ }
365
+
366
+ return this.each(function() {
367
+ var $this = $(this), data = $this.data(component);
368
+ if (!data) $this.data(component, (data = UI[component](this, method ? undefined : options)));
369
+ if (method) data[method].apply(data, Array.prototype.slice.call(args, 1));
370
+ });
371
+ };
372
+
373
+ $.UIkit = UI;
374
+ $.fn.uk = UI.fn;
375
+
376
+ UI.langdirection = UI.$html.attr("dir") == "rtl" ? "right" : "left";
377
+
378
+ UI.components = {};
379
+
380
+ UI.component = function(name, def) {
381
+
382
+ var fn = function(element, options) {
383
+
384
+ var $this = this;
385
+
386
+ this.UIkit = UI;
387
+ this.element = element ? UI.$(element) : null;
388
+ this.options = $.extend(true, {}, this.defaults, options);
389
+ this.plugins = {};
390
+
391
+ if (this.element) {
392
+ this.element.data(name, this);
393
+ }
394
+
395
+ this.init();
396
+
397
+ (this.options.plugins.length ? this.options.plugins : Object.keys(fn.plugins)).forEach(function(plugin) {
398
+
399
+ if (fn.plugins[plugin].init) {
400
+ fn.plugins[plugin].init($this);
401
+ $this.plugins[plugin] = true;
402
+ }
403
+
404
+ });
405
+
406
+ this.trigger('init.uk.component', [name, this]);
407
+
408
+ return this;
409
+ };
410
+
411
+ fn.plugins = {};
412
+
413
+ $.extend(true, fn.prototype, {
414
+
415
+ defaults : {plugins: []},
416
+
417
+ boot: function(){},
418
+ init: function(){},
419
+
420
+ on: function(a1,a2,a3){
421
+ return UI.$(this.element || this).on(a1,a2,a3);
422
+ },
423
+
424
+ one: function(a1,a2,a3){
425
+ return UI.$(this.element || this).one(a1,a2,a3);
426
+ },
427
+
428
+ off: function(evt){
429
+ return UI.$(this.element || this).off(evt);
430
+ },
431
+
432
+ trigger: function(evt, params) {
433
+ return UI.$(this.element || this).trigger(evt, params);
434
+ },
435
+
436
+ find: function(selector) {
437
+ return UI.$(this.element ? this.element: []).find(selector);
438
+ },
439
+
440
+ proxy: function(obj, methods) {
441
+
442
+ var $this = this;
443
+
444
+ methods.split(' ').forEach(function(method) {
445
+ if (!$this[method]) $this[method] = function() { return obj[method].apply(obj, arguments); };
446
+ });
447
+ },
448
+
449
+ mixin: function(obj, methods) {
450
+
451
+ var $this = this;
452
+
453
+ methods.split(' ').forEach(function(method) {
454
+ if (!$this[method]) $this[method] = obj[method].bind($this);
455
+ });
456
+ },
457
+
458
+ option: function() {
459
+
460
+ if (arguments.length == 1) {
461
+ return this.options[arguments[0]] || undefined;
462
+ } else if (arguments.length == 2) {
463
+ this.options[arguments[0]] = arguments[1];
464
+ }
465
+ }
466
+
467
+ }, def);
468
+
469
+ this.components[name] = fn;
470
+
471
+ this[name] = function() {
472
+
473
+ var element, options;
474
+
475
+ if (arguments.length) {
476
+
477
+ switch(arguments.length) {
478
+ case 1:
479
+
480
+ if (typeof arguments[0] === "string" || arguments[0].nodeType || arguments[0] instanceof jQuery) {
481
+ element = $(arguments[0]);
482
+ } else {
483
+ options = arguments[0];
484
+ }
485
+
486
+ break;
487
+ case 2:
488
+
489
+ element = $(arguments[0]);
490
+ options = arguments[1];
491
+ break;
492
+ }
493
+ }
494
+
495
+ if (element && element.data(name)) {
496
+ return element.data(name);
497
+ }
498
+
499
+ return (new UI.components[name](element, options));
500
+ };
501
+
502
+ if (UI.domready) {
503
+ UI.component.boot(name);
504
+ }
505
+
506
+ return fn;
507
+ };
508
+
509
+ UI.plugin = function(component, name, def) {
510
+ this.components[component].plugins[name] = def;
511
+ };
512
+
513
+ UI.component.boot = function(name) {
514
+
515
+ if (UI.components[name].prototype && UI.components[name].prototype.boot && !UI.components[name].booted) {
516
+ UI.components[name].prototype.boot.apply(UI, []);
517
+ UI.components[name].booted = true;
518
+ }
519
+ };
520
+
521
+ UI.component.bootComponents = function() {
522
+
523
+ for (var component in UI.components) {
524
+ UI.component.boot(component);
525
+ }
526
+ };
527
+
528
+
529
+ // DOM mutation save ready helper function
530
+
531
+ UI.domObservers = [];
532
+ UI.domready = false;
533
+
534
+ UI.ready = function(fn) {
535
+
536
+ UI.domObservers.push(fn);
537
+
538
+ if (UI.domready) {
539
+ fn(document);
540
+ }
541
+ };
542
+
543
+ UI.on = function(a1,a2,a3){
544
+
545
+ if (a1 && a1.indexOf('ready.uk.dom') > -1 && UI.domready) {
546
+ a2.apply(UI.$doc);
547
+ }
548
+
549
+ return UI.$doc.on(a1,a2,a3);
550
+ };
551
+
552
+ UI.one = function(a1,a2,a3){
553
+
554
+ if (a1 && a1.indexOf('ready.uk.dom') > -1 && UI.domready) {
555
+ a2.apply(UI.$doc);
556
+ return UI.$doc;
557
+ }
558
+
559
+ return UI.$doc.one(a1,a2,a3);
560
+ };
561
+
562
+ UI.trigger = function(evt, params) {
563
+ return UI.$doc.trigger(evt, params);
564
+ };
565
+
566
+ UI.domObserve = function(selector, fn) {
567
+
568
+ if(!UI.support.mutationobserver) return;
569
+
570
+ fn = fn || function() {};
571
+
572
+ UI.$(selector).each(function() {
573
+
574
+ var element = this,
575
+ $element = UI.$(element);
576
+
577
+ if ($element.data('observer')) {
578
+ return;
579
+ }
580
+
581
+ try {
582
+
583
+ var observer = new UI.support.mutationobserver(UI.Utils.debounce(function(mutations) {
584
+ fn.apply(element, []);
585
+ $element.trigger('changed.uk.dom');
586
+ }, 50));
587
+
588
+ // pass in the target node, as well as the observer options
589
+ observer.observe(element, { childList: true, subtree: true });
590
+
591
+ $element.data('observer', observer);
592
+
593
+ } catch(e) {}
594
+ });
595
+ };
596
+
597
+ UI.init = function(root) {
598
+
599
+ root = root || document;
600
+
601
+ UI.domObservers.forEach(function(fn){
602
+ fn(root);
603
+ });
604
+ };
605
+
606
+ UI.on('domready.uk.dom', function(){
607
+
608
+ UI.init();
609
+
610
+ if (UI.domready) UI.Utils.checkDisplay();
611
+ });
612
+
613
+ $(function(){
614
+
615
+ UI.$body = UI.$('body');
616
+
617
+ UI.ready(function(context){
618
+ UI.domObserve('[data-uk-observe]');
619
+ });
620
+
621
+ UI.on('changed.uk.dom', function(e) {
622
+ UI.init(e.target);
623
+ UI.Utils.checkDisplay(e.target);
624
+ });
625
+
626
+ UI.trigger('beforeready.uk.dom');
627
+
628
+ UI.component.bootComponents();
629
+
630
+ // custom scroll observer
631
+ setInterval((function(){
632
+
633
+ var memory = {x: window.pageXOffset, y:window.pageYOffset}, dir;
634
+
635
+ var fn = function(){
636
+
637
+ if (memory.x != window.pageXOffset || memory.y != window.pageYOffset) {
638
+
639
+ dir = {x: 0 , y: 0};
640
+
641
+ if (window.pageXOffset != memory.x) dir.x = window.pageXOffset > memory.x ? 1:-1;
642
+ if (window.pageYOffset != memory.y) dir.y = window.pageYOffset > memory.y ? 1:-1;
643
+
644
+ memory = {
645
+ "dir": dir, "x": window.pageXOffset, "y": window.pageYOffset
646
+ };
647
+
648
+ UI.$doc.trigger('scrolling.uk.document', [memory]);
649
+ }
650
+ };
651
+
652
+ if (UI.support.touch) {
653
+ UI.$html.on('touchmove touchend MSPointerMove MSPointerUp pointermove pointerup', fn);
654
+ }
655
+
656
+ if (memory.x || memory.y) fn();
657
+
658
+ return fn;
659
+
660
+ })(), 15);
661
+
662
+ // run component init functions on dom
663
+ UI.trigger('domready.uk.dom');
664
+
665
+ if (UI.support.touch) {
666
+
667
+ // remove css hover rules for touch devices
668
+ // UI.Utils.removeCssRules(/\.uk-(?!navbar).*:hover/);
669
+
670
+ // viewport unit fix for uk-height-viewport - should be fixed in iOS 8
671
+ if (navigator.userAgent.match(/(iPad|iPhone|iPod)/g)) {
672
+
673
+ UI.$win.on('load orientationchange resize', UI.Utils.debounce((function(){
674
+
675
+ var fn = function() {
676
+ $('.uk-height-viewport').css('height', window.innerHeight);
677
+ return fn;
678
+ };
679
+
680
+ return fn();
681
+
682
+ })(), 100));
683
+ }
684
+ }
685
+
686
+ UI.trigger('afterready.uk.dom');
687
+
688
+ // mark that domready is left behind
689
+ UI.domready = true;
690
+ });
691
+
692
+ // add touch identifier class
693
+ UI.$html.addClass(UI.support.touch ? "uk-touch" : "uk-notouch");
694
+
695
+ // add uk-hover class on tap to support overlays on touch devices
696
+ if (UI.support.touch) {
697
+
698
+ var hoverset = false, exclude, hovercls = 'uk-hover', selector = '.uk-overlay, .uk-overlay-hover, .uk-overlay-toggle, .uk-animation-hover, .uk-has-hover';
699
+
700
+ UI.$html.on('touchstart MSPointerDown pointerdown', selector, function() {
701
+
702
+ if (hoverset) $('.'+hovercls).removeClass(hovercls);
703
+
704
+ hoverset = $(this).addClass(hovercls);
705
+
706
+ }).on('touchend MSPointerUp pointerup', function(e) {
707
+
708
+ exclude = $(e.target).parents(selector);
709
+
710
+ if (hoverset) {
711
+ hoverset.not(exclude).removeClass(hovercls);
712
+ }
713
+ });
714
+ }
715
+
716
+ return UI;
717
+ });