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