uikit-rails 0.0.2 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (177) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +9 -3
  3. data/Gemfile +2 -1
  4. data/LICENSE.txt +21 -0
  5. data/README.md +65 -0
  6. data/Rakefile +0 -1
  7. data/assets/fonts/FontAwesome.otf +0 -0
  8. data/assets/fonts/fontawesome-webfont.ttf +0 -0
  9. data/assets/fonts/fontawesome-webfont.woff +0 -0
  10. data/assets/fonts/fontawesome-webfont.woff2 +0 -0
  11. data/assets/javascripts/components/accordion.js +174 -0
  12. data/assets/javascripts/components/accordion.min.js +2 -0
  13. data/assets/javascripts/components/autocomplete.js +334 -0
  14. data/assets/javascripts/components/autocomplete.min.js +2 -0
  15. data/assets/javascripts/components/datepicker.js +3166 -0
  16. data/assets/javascripts/components/datepicker.min.js +3 -0
  17. data/assets/javascripts/components/form-password.js +67 -0
  18. data/assets/javascripts/components/form-password.min.js +2 -0
  19. data/assets/javascripts/components/form-select.js +70 -0
  20. data/assets/javascripts/components/form-select.min.js +2 -0
  21. data/assets/javascripts/components/grid.js +527 -0
  22. data/assets/javascripts/components/grid.min.js +2 -0
  23. data/assets/javascripts/components/htmleditor.js +623 -0
  24. data/assets/javascripts/components/htmleditor.min.js +2 -0
  25. data/assets/javascripts/components/lightbox.js +555 -0
  26. data/assets/javascripts/components/lightbox.min.js +2 -0
  27. data/assets/javascripts/components/nestable.js +638 -0
  28. data/assets/javascripts/components/nestable.min.js +2 -0
  29. data/assets/javascripts/components/notify.js +189 -0
  30. data/assets/javascripts/components/notify.min.js +2 -0
  31. data/assets/javascripts/components/pagination.js +147 -0
  32. data/assets/javascripts/components/pagination.min.js +2 -0
  33. data/assets/javascripts/components/parallax.js +435 -0
  34. data/assets/javascripts/components/parallax.min.js +2 -0
  35. data/assets/javascripts/components/search.js +92 -0
  36. data/assets/javascripts/components/search.min.js +2 -0
  37. data/assets/javascripts/components/slider.js +531 -0
  38. data/assets/javascripts/components/slider.min.js +2 -0
  39. data/assets/javascripts/components/slideset.js +506 -0
  40. data/assets/javascripts/components/slideset.min.js +2 -0
  41. data/assets/javascripts/components/slideshow-fx.js +375 -0
  42. data/assets/javascripts/components/slideshow-fx.min.js +2 -0
  43. data/assets/javascripts/components/slideshow.js +562 -0
  44. data/assets/javascripts/components/slideshow.min.js +2 -0
  45. data/assets/javascripts/components/sortable.js +688 -0
  46. data/assets/javascripts/components/sortable.min.js +2 -0
  47. data/assets/javascripts/components/sticky.js +359 -0
  48. data/assets/javascripts/components/sticky.min.js +2 -0
  49. data/assets/javascripts/components/timepicker.js +192 -0
  50. data/assets/javascripts/components/timepicker.min.js +2 -0
  51. data/assets/javascripts/components/tooltip.js +234 -0
  52. data/assets/javascripts/components/tooltip.min.js +2 -0
  53. data/assets/javascripts/components/upload.js +260 -0
  54. data/assets/javascripts/components/upload.min.js +2 -0
  55. data/assets/javascripts/core/alert.js +66 -0
  56. data/assets/javascripts/core/alert.min.js +2 -0
  57. data/assets/javascripts/core/button.js +157 -0
  58. data/assets/javascripts/core/button.min.js +2 -0
  59. data/assets/javascripts/core/core.js +730 -0
  60. data/assets/javascripts/core/core.min.js +2 -0
  61. data/assets/javascripts/core/cover.js +95 -0
  62. data/assets/javascripts/core/cover.min.js +2 -0
  63. data/assets/javascripts/core/dropdown.js +514 -0
  64. data/assets/javascripts/core/dropdown.min.js +2 -0
  65. data/assets/javascripts/core/grid.js +114 -0
  66. data/assets/javascripts/core/grid.min.js +2 -0
  67. data/assets/javascripts/core/modal.js +384 -0
  68. data/assets/javascripts/core/modal.min.js +2 -0
  69. data/assets/javascripts/core/nav.js +136 -0
  70. data/assets/javascripts/core/nav.min.js +2 -0
  71. data/assets/javascripts/core/offcanvas.js +180 -0
  72. data/assets/javascripts/core/offcanvas.min.js +2 -0
  73. data/assets/javascripts/core/scrollspy.js +208 -0
  74. data/assets/javascripts/core/scrollspy.min.js +2 -0
  75. data/assets/javascripts/core/smooth-scroll.js +62 -0
  76. data/assets/javascripts/core/smooth-scroll.min.js +2 -0
  77. data/assets/javascripts/core/switcher.js +309 -0
  78. data/assets/javascripts/core/switcher.min.js +2 -0
  79. data/assets/javascripts/core/tab.js +167 -0
  80. data/assets/javascripts/core/tab.min.js +2 -0
  81. data/assets/javascripts/core/toggle.js +120 -0
  82. data/assets/javascripts/core/toggle.min.js +2 -0
  83. data/assets/javascripts/core/touch.js +175 -0
  84. data/assets/javascripts/core/touch.min.js +2 -0
  85. data/assets/javascripts/core/utility.js +289 -0
  86. data/assets/javascripts/core/utility.min.js +2 -0
  87. data/assets/javascripts/uikit-components.js +23 -0
  88. data/assets/javascripts/uikit.js +3706 -0
  89. data/assets/javascripts/uikit.min.js +3 -0
  90. data/assets/stylesheets/components/accordion.scss +94 -0
  91. data/assets/stylesheets/components/autocomplete.scss +102 -0
  92. data/assets/stylesheets/components/datepicker.scss +197 -0
  93. data/assets/stylesheets/components/dotnav.scss +212 -0
  94. data/assets/stylesheets/components/form-advanced.scss +128 -0
  95. data/assets/stylesheets/components/form-file.scss +63 -0
  96. data/assets/stylesheets/components/form-password.scss +74 -0
  97. data/assets/stylesheets/components/form-select.scss +66 -0
  98. data/assets/stylesheets/components/htmleditor.scss +269 -0
  99. data/assets/stylesheets/components/nestable.scss +229 -0
  100. data/assets/stylesheets/components/notify.scss +190 -0
  101. data/assets/stylesheets/components/placeholder.scss +66 -0
  102. data/assets/stylesheets/components/progress.scss +173 -0
  103. data/assets/stylesheets/components/search.scss +309 -0
  104. data/assets/stylesheets/components/slidenav.scss +183 -0
  105. data/assets/stylesheets/components/slider.scss +131 -0
  106. data/assets/stylesheets/components/slideshow.scss +208 -0
  107. data/assets/stylesheets/components/sortable.scss +122 -0
  108. data/assets/stylesheets/components/sticky.scss +64 -0
  109. data/assets/stylesheets/components/tooltip.scss +177 -0
  110. data/assets/stylesheets/components/upload.scss +34 -0
  111. data/assets/stylesheets/core/alert.scss +141 -0
  112. data/assets/stylesheets/core/animation.scss +599 -0
  113. data/assets/stylesheets/core/article.scss +139 -0
  114. data/assets/stylesheets/core/badge.scss +110 -0
  115. data/assets/stylesheets/core/base-noconflict.scss +397 -0
  116. data/assets/stylesheets/core/base.scss +541 -0
  117. data/assets/stylesheets/core/block.scss +153 -0
  118. data/assets/stylesheets/core/breadcrumb.scss +86 -0
  119. data/assets/stylesheets/core/button.scss +406 -0
  120. data/assets/stylesheets/core/close.scss +132 -0
  121. data/assets/stylesheets/core/column.scss +209 -0
  122. data/assets/stylesheets/core/comment.scss +172 -0
  123. data/assets/stylesheets/core/contrast.scss +493 -0
  124. data/assets/stylesheets/core/cover.scss +70 -0
  125. data/assets/stylesheets/core/description-list.scss +71 -0
  126. data/assets/stylesheets/core/dropdown.scss +280 -0
  127. data/assets/stylesheets/core/flex.scss +320 -0
  128. data/assets/stylesheets/core/form.scss +627 -0
  129. data/assets/stylesheets/core/grid.scss +688 -0
  130. data/assets/stylesheets/core/icon.scss +897 -0
  131. data/assets/stylesheets/core/list.scss +102 -0
  132. data/assets/stylesheets/core/modal.scss +341 -0
  133. data/assets/stylesheets/core/nav.scss +468 -0
  134. data/assets/stylesheets/core/navbar.scss +325 -0
  135. data/assets/stylesheets/core/offcanvas.scss +168 -0
  136. data/assets/stylesheets/core/overlay.scss +534 -0
  137. data/assets/stylesheets/core/pagination.scss +197 -0
  138. data/assets/stylesheets/core/panel.scss +332 -0
  139. data/assets/stylesheets/core/print.scss +59 -0
  140. data/assets/stylesheets/core/subnav.scss +213 -0
  141. data/assets/stylesheets/core/switcher.scss +38 -0
  142. data/assets/stylesheets/core/tab.scss +368 -0
  143. data/assets/stylesheets/core/table.scss +147 -0
  144. data/assets/stylesheets/core/text.scss +128 -0
  145. data/assets/stylesheets/core/thumbnail.scss +122 -0
  146. data/assets/stylesheets/core/thumbnav.scss +122 -0
  147. data/assets/stylesheets/core/utility.scss +606 -0
  148. data/assets/stylesheets/core/variables.scss +23 -0
  149. data/assets/stylesheets/uikit-components.scss +22 -0
  150. data/assets/stylesheets/uikit-mixins.scss +327 -0
  151. data/assets/stylesheets/uikit-variables.scss +817 -0
  152. data/assets/stylesheets/uikit.scss +56 -0
  153. data/lib/uikit-rails.rb +2 -2
  154. data/lib/uikit-rails/engine.rb +11 -1
  155. data/lib/uikit-rails/version.rb +1 -3
  156. data/uikit-rails.gemspec +15 -16
  157. metadata +169 -44
  158. data/README.rb +0 -1
  159. data/vendor/assets/javascripts/ui.card.js +0 -115
  160. data/vendor/assets/javascripts/ui.color-picker.js +0 -351
  161. data/vendor/assets/javascripts/ui.confirmation.js +0 -133
  162. data/vendor/assets/javascripts/ui.dialog.js +0 -252
  163. data/vendor/assets/javascripts/ui.emitter.js +0 -99
  164. data/vendor/assets/javascripts/ui.js +0 -1641
  165. data/vendor/assets/javascripts/ui.menu.js +0 -238
  166. data/vendor/assets/javascripts/ui.notification.js +0 -240
  167. data/vendor/assets/javascripts/ui.overlay.js +0 -79
  168. data/vendor/assets/javascripts/ui.split-button.js +0 -108
  169. data/vendor/assets/stylesheets/ui.card.css +0 -55
  170. data/vendor/assets/stylesheets/ui.color-picker.css +0 -6
  171. data/vendor/assets/stylesheets/ui.confirmation.css +0 -7
  172. data/vendor/assets/stylesheets/ui.css +0 -337
  173. data/vendor/assets/stylesheets/ui.dialog.css +0 -92
  174. data/vendor/assets/stylesheets/ui.menu.css +0 -32
  175. data/vendor/assets/stylesheets/ui.notification.css +0 -107
  176. data/vendor/assets/stylesheets/ui.overlay.css +0 -16
  177. data/vendor/assets/stylesheets/ui.split-button.css +0 -27
@@ -0,0 +1,2 @@
1
+ /*! UIkit 2.24.2 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
2
+ !function(t){var e;window.UIkit&&(e=t(UIkit)),"function"==typeof define&&define.amd&&define("uikit-parallax",["uikit"],function(){return e||t(UIkit)})}(function(t){"use strict";function e(e,a,r){var n,i,s,o,c,p,l,d=new Image;return i=e.element.css({"background-size":"cover","background-repeat":"no-repeat"}),n=i.css("background-image").replace(/^url\(/g,"").replace(/\)$/g,"").replace(/("|')/g,""),o=function(){var t=i.width(),n=i.height(),o="bg"==a?r.diff:r.diff/100*n;return n+=o,t+=Math.ceil(o*c),t>s.w&&n<s.h?e.element.css({"background-size":""}):(n>t/c?(p=Math.ceil(n*c),l=n,n>window.innerHeight&&(p=1.2*p,l=1.2*l)):(p=t,l=Math.ceil(t/c)),i.css({"background-size":p+"px "+l+"px"}).data("bgsize",{w:p,h:l}),void 0)},d.onerror=function(){},d.onload=function(){s={w:d.width,h:d.height},c=d.width/d.height,t.$win.on("load resize orientationchange",t.Utils.debounce(function(){o()},50)),o()},d.src=n,!0}function a(t,e,a){return t=n(t),e=n(e),a=a||0,r(t,e,a)}function r(t,e,a){var r="rgba("+parseInt(t[0]+a*(e[0]-t[0]),10)+","+parseInt(t[1]+a*(e[1]-t[1]),10)+","+parseInt(t[2]+a*(e[2]-t[2]),10)+","+(t&&e?parseFloat(t[3]+a*(e[3]-t[3])):1);return r+=")"}function n(t){var e,a;return a=(e=/#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})/.exec(t))?[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16),1]:(e=/#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])/.exec(t))?[17*parseInt(e[1],16),17*parseInt(e[2],16),17*parseInt(e[3],16),1]:(e=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(t))?[parseInt(e[1]),parseInt(e[2]),parseInt(e[3]),1]:(e=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9\.]*)\s*\)/.exec(t))?[parseInt(e[1],10),parseInt(e[2],10),parseInt(e[3],10),parseFloat(e[4])]:l[t]||[255,255,255,0]}var i=[],s=!1,o=0,c=window.innerHeight,p=function(){o=t.$win.scrollTop(),window.requestAnimationFrame(function(){for(var t=0;t<i.length;t++)i[t].process()})};t.component("parallax",{defaults:{velocity:.5,target:!1,viewport:!1,media:!1},boot:function(){s=function(){var t,e=document.createElement("div"),a={WebkitTransform:"-webkit-transform",MSTransform:"-ms-transform",MozTransform:"-moz-transform",Transform:"transform"};document.body.insertBefore(e,null);for(var r in a)void 0!==e.style[r]&&(e.style[r]="translate3d(1px,1px,1px)",t=window.getComputedStyle(e).getPropertyValue(a[r]));return document.body.removeChild(e),void 0!==t&&t.length>0&&"none"!==t}(),t.$doc.on("scrolling.uk.document",p),t.$win.on("load resize orientationchange",t.Utils.debounce(function(){c=window.innerHeight,p()},50)),t.ready(function(e){t.$("[data-uk-parallax]",e).each(function(){var e=t.$(this);e.data("parallax")||t.parallax(e,t.Utils.options(e.attr("data-uk-parallax")))})})},init:function(){this.base=this.options.target?t.$(this.options.target):this.element,this.props={},this.velocity=this.options.velocity||1;var e=["target","velocity","viewport","plugins","media"];Object.keys(this.options).forEach(function(t){if(-1===e.indexOf(t)){var a,r,n,i,s=String(this.options[t]).split(",");t.match(/color/i)?(a=s[1]?s[0]:this._getStartValue(t),r=s[1]?s[1]:s[0],a||(a="rgba(255,255,255,0)")):(a=parseFloat(s[1]?s[0]:this._getStartValue(t)),r=parseFloat(s[1]?s[1]:s[0]),i=r>a?r-a:a-r,n=r>a?1:-1),this.props[t]={start:a,end:r,dir:n,diff:i}}}.bind(this)),i.push(this)},process:function(){if(this.options.media)switch(typeof this.options.media){case"number":if(window.innerWidth<this.options.media)return!1;break;case"string":if(window.matchMedia&&!window.matchMedia(this.options.media).matches)return!1}var t=this.percentageInViewport();this.options.viewport!==!1&&(t=0===this.options.viewport?1:t/this.options.viewport),this.update(t)},percentageInViewport:function(){var t,e,a,r=this.base.offset().top,n=this.base.outerHeight();return r>o+c?a=0:o>r+n?a=1:c>r+n?a=(c>o?o:o-c)/(r+n):(t=o+c-r,e=Math.round(t/((c+n)/100)),a=e/100),a},update:function(t){var r,n,i={transform:""},o=t*(1-(this.velocity-this.velocity*t));0>o&&(o=0),o>1&&(o=1),(void 0===this._percent||this._percent!=o)&&(Object.keys(this.props).forEach(function(c){switch(r=this.props[c],0===t?n=r.start:1===t?n=r.end:void 0!==r.diff&&(n=r.start+r.diff*o*r.dir),"bg"!=c&&"bgp"!=c||this._bgcover||(this._bgcover=e(this,c,r)),c){case"x":i.transform+=s?" translate3d("+n+"px, 0, 0)":" translateX("+n+"px)";break;case"xp":i.transform+=s?" translate3d("+n+"%, 0, 0)":" translateX("+n+"%)";break;case"y":i.transform+=s?" translate3d(0, "+n+"px, 0)":" translateY("+n+"px)";break;case"yp":i.transform+=s?" translate3d(0, "+n+"%, 0)":" translateY("+n+"%)";break;case"rotate":i.transform+=" rotate("+n+"deg)";break;case"scale":i.transform+=" scale("+n+")";break;case"bg":i["background-position"]="50% "+n+"px";break;case"bgp":i["background-position"]="50% "+n+"%";break;case"color":case"background-color":case"border-color":i[c]=a(r.start,r.end,o);break;default:i[c]=n}}.bind(this)),this.element.css(i),this._percent=o)},_getStartValue:function(t){var e=0;switch(t){case"scale":e=1;break;default:e=this.element.css(t)}return e||0}});var l={black:[0,0,0,1],blue:[0,0,255,1],brown:[165,42,42,1],cyan:[0,255,255,1],fuchsia:[255,0,255,1],gold:[255,215,0,1],green:[0,128,0,1],indigo:[75,0,130,1],khaki:[240,230,140,1],lime:[0,255,0,1],magenta:[255,0,255,1],maroon:[128,0,0,1],navy:[0,0,128,1],olive:[128,128,0,1],orange:[255,165,0,1],pink:[255,192,203,1],purple:[128,0,128,1],violet:[128,0,128,1],red:[255,0,0,1],silver:[192,192,192,1],white:[255,255,255,1],yellow:[255,255,0,1],transparent:[255,255,255,0]};return t.parallax});
@@ -0,0 +1,92 @@
1
+ /*! UIkit 2.24.2 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
2
+ (function(addon) {
3
+
4
+ var component;
5
+
6
+ if (window.UIkit) {
7
+ component = addon(UIkit);
8
+ }
9
+
10
+ if (typeof define == "function" && define.amd) {
11
+ define("uikit-search", ["uikit"], function(){
12
+ return component || addon(UIkit);
13
+ });
14
+ }
15
+
16
+ })(function(UI){
17
+
18
+ "use strict";
19
+
20
+ UI.component('search', {
21
+ defaults: {
22
+ msgResultsHeader : 'Search Results',
23
+ msgMoreResults : 'More Results',
24
+ msgNoResults : 'No results found',
25
+ template : '<ul class="uk-nav uk-nav-search uk-autocomplete-results">\
26
+ {{#msgResultsHeader}}<li class="uk-nav-header uk-skip">{{msgResultsHeader}}</li>{{/msgResultsHeader}}\
27
+ {{#items && items.length}}\
28
+ {{~items}}\
29
+ <li data-url="{{!$item.url}}">\
30
+ <a href="{{!$item.url}}">\
31
+ {{{$item.title}}}\
32
+ {{#$item.text}}<div>{{{$item.text}}}</div>{{/$item.text}}\
33
+ </a>\
34
+ </li>\
35
+ {{/items}}\
36
+ {{#msgMoreResults}}\
37
+ <li class="uk-nav-divider uk-skip"></li>\
38
+ <li class="uk-search-moreresults" data-moreresults="true"><a href="#" onclick="jQuery(this).closest(\'form\').submit();">{{msgMoreResults}}</a></li>\
39
+ {{/msgMoreResults}}\
40
+ {{/end}}\
41
+ {{^items.length}}\
42
+ {{#msgNoResults}}<li class="uk-skip"><a>{{msgNoResults}}</a></li>{{/msgNoResults}}\
43
+ {{/end}}\
44
+ </ul>',
45
+
46
+ renderer: function(data) {
47
+
48
+ var opts = this.options;
49
+
50
+ this.dropdown.append(this.template({"items":data.results || [], "msgResultsHeader":opts.msgResultsHeader, "msgMoreResults": opts.msgMoreResults, "msgNoResults": opts.msgNoResults}));
51
+ this.show();
52
+ }
53
+ },
54
+
55
+ boot: function() {
56
+
57
+ // init code
58
+ UI.$html.on("focus.search.uikit", "[data-uk-search]", function(e) {
59
+ var ele =UI.$(this);
60
+
61
+ if (!ele.data("search")) {
62
+ UI.search(ele, UI.Utils.options(ele.attr("data-uk-search")));
63
+ }
64
+ });
65
+ },
66
+
67
+ init: function() {
68
+ var $this = this;
69
+
70
+ this.autocomplete = UI.autocomplete(this.element, this.options);
71
+
72
+ this.autocomplete.dropdown.addClass('uk-dropdown-search');
73
+
74
+ this.autocomplete.input.on("keyup", function(){
75
+ $this.element[$this.autocomplete.input.val() ? "addClass":"removeClass"]("uk-active");
76
+ }).closest("form").on("reset", function(){
77
+ $this.value="";
78
+ $this.element.removeClass("uk-active");
79
+ });
80
+
81
+ this.on('selectitem.uk.autocomplete', function(e, data) {
82
+ if (data.url) {
83
+ location.href = data.url;
84
+ } else if(data.moreresults) {
85
+ $this.autocomplete.input.closest('form').submit();
86
+ }
87
+ });
88
+
89
+ this.element.data("search", this);
90
+ }
91
+ });
92
+ });
@@ -0,0 +1,2 @@
1
+ /*! UIkit 2.24.2 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
2
+ !function(e){var s;window.UIkit&&(s=e(UIkit)),"function"==typeof define&&define.amd&&define("uikit-search",["uikit"],function(){return s||e(UIkit)})}(function(e){"use strict";e.component("search",{defaults:{msgResultsHeader:"Search Results",msgMoreResults:"More Results",msgNoResults:"No results found",template:'<ul class="uk-nav uk-nav-search uk-autocomplete-results"> {{#msgResultsHeader}}<li class="uk-nav-header uk-skip">{{msgResultsHeader}}</li>{{/msgResultsHeader}} {{#items && items.length}} {{~items}} <li data-url="{{!$item.url}}"> <a href="{{!$item.url}}"> {{{$item.title}}} {{#$item.text}}<div>{{{$item.text}}}</div>{{/$item.text}} </a> </li> {{/items}} {{#msgMoreResults}} <li class="uk-nav-divider uk-skip"></li> <li class="uk-search-moreresults" data-moreresults="true"><a href="#" onclick="jQuery(this).closest(\'form\').submit();">{{msgMoreResults}}</a></li> {{/msgMoreResults}} {{/end}} {{^items.length}} {{#msgNoResults}}<li class="uk-skip"><a>{{msgNoResults}}</a></li>{{/msgNoResults}} {{/end}} </ul>',renderer:function(e){var s=this.options;this.dropdown.append(this.template({items:e.results||[],msgResultsHeader:s.msgResultsHeader,msgMoreResults:s.msgMoreResults,msgNoResults:s.msgNoResults})),this.show()}},boot:function(){e.$html.on("focus.search.uikit","[data-uk-search]",function(){var s=e.$(this);s.data("search")||e.search(s,e.Utils.options(s.attr("data-uk-search")))})},init:function(){var s=this;this.autocomplete=e.autocomplete(this.element,this.options),this.autocomplete.dropdown.addClass("uk-dropdown-search"),this.autocomplete.input.on("keyup",function(){s.element[s.autocomplete.input.val()?"addClass":"removeClass"]("uk-active")}).closest("form").on("reset",function(){s.value="",s.element.removeClass("uk-active")}),this.on("selectitem.uk.autocomplete",function(e,t){t.url?location.href=t.url:t.moreresults&&s.autocomplete.input.closest("form").submit()}),this.element.data("search",this)}})});
@@ -0,0 +1,531 @@
1
+ /*! UIkit 2.24.2 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
2
+ (function(addon) {
3
+
4
+ var component;
5
+
6
+ if (window.UIkit) {
7
+ component = addon(UIkit);
8
+ }
9
+
10
+ if (typeof define == "function" && define.amd) {
11
+ define("uikit-slider", ["uikit"], function(){
12
+ return component || addon(UIkit);
13
+ });
14
+ }
15
+
16
+ })(function(UI){
17
+
18
+ "use strict";
19
+
20
+ var dragging, delayIdle, anchor, dragged, store = {};
21
+
22
+ UI.component('slider', {
23
+
24
+ defaults: {
25
+ center : false,
26
+ threshold : 10,
27
+ infinite : true,
28
+ autoplay : false,
29
+ autoplayInterval : 7000,
30
+ pauseOnHover : true,
31
+ activecls : 'uk-active'
32
+ },
33
+
34
+ boot: function() {
35
+
36
+ // init code
37
+ UI.ready(function(context) {
38
+
39
+ setTimeout(function(){
40
+
41
+ UI.$('[data-uk-slider]', context).each(function(){
42
+
43
+ var ele = UI.$(this);
44
+
45
+ if (!ele.data('slider')) {
46
+ UI.slider(ele, UI.Utils.options(ele.attr('data-uk-slider')));
47
+ }
48
+ });
49
+
50
+ }, 0);
51
+ });
52
+ },
53
+
54
+ init: function() {
55
+
56
+ var $this = this;
57
+
58
+ this.container = this.element.find('.uk-slider');
59
+ this.focus = 0;
60
+
61
+ UI.$win.on('resize load', UI.Utils.debounce(function() {
62
+ $this.resize(true);
63
+ }, 100));
64
+
65
+ this.on('click.uikit.slider', '[data-uk-slider-item]', function(e) {
66
+
67
+ e.preventDefault();
68
+
69
+ var item = UI.$(this).attr('data-uk-slider-item');
70
+
71
+ if ($this.focus == item) return;
72
+
73
+ // stop autoplay
74
+ $this.stop();
75
+
76
+ switch(item) {
77
+ case 'next':
78
+ case 'previous':
79
+ $this[item=='next' ? 'next':'previous']();
80
+ break;
81
+ default:
82
+ $this.updateFocus(parseInt(item, 10));
83
+ }
84
+ });
85
+
86
+ this.container.on({
87
+
88
+ 'touchstart mousedown': function(evt) {
89
+
90
+ if (evt.originalEvent && evt.originalEvent.touches) {
91
+ evt = evt.originalEvent.touches[0];
92
+ }
93
+
94
+ // ignore right click button
95
+ if (evt.button && evt.button==2 || !$this.active) {
96
+ return;
97
+ }
98
+
99
+ // stop autoplay
100
+ $this.stop();
101
+
102
+ anchor = UI.$(evt.target).is('a') ? UI.$(evt.target) : UI.$(evt.target).parents('a:first');
103
+ dragged = false;
104
+
105
+ if (anchor.length) {
106
+
107
+ anchor.one('click', function(e){
108
+ if (dragged) e.preventDefault();
109
+ });
110
+ }
111
+
112
+ delayIdle = function(e) {
113
+
114
+ dragged = true;
115
+ dragging = $this;
116
+ store = {
117
+ touchx : parseInt(e.pageX, 10),
118
+ dir : 1,
119
+ focus : $this.focus,
120
+ base : $this.options.center ? 'center':'area'
121
+ };
122
+
123
+ if (e.originalEvent && e.originalEvent.touches) {
124
+ e = e.originalEvent.touches[0];
125
+ }
126
+
127
+ dragging.element.data({
128
+ 'pointer-start': {x: parseInt(e.pageX, 10), y: parseInt(e.pageY, 10)},
129
+ 'pointer-pos-start': $this.pos
130
+ });
131
+
132
+ $this.container.addClass('uk-drag');
133
+
134
+ delayIdle = false;
135
+ };
136
+
137
+ delayIdle.x = parseInt(evt.pageX, 10);
138
+ delayIdle.threshold = $this.options.threshold;
139
+
140
+ },
141
+
142
+ mouseenter: function() { if ($this.options.pauseOnHover) $this.hovering = true; },
143
+ mouseleave: function() { $this.hovering = false; }
144
+ });
145
+
146
+ this.resize(true);
147
+
148
+ this.on('display.uk.check', function(){
149
+ if ($this.element.is(":visible")) {
150
+ $this.resize(true);
151
+ }
152
+ });
153
+
154
+ // prevent dragging links + images
155
+ this.element.find('a,img').attr('draggable', 'false');
156
+
157
+ // Set autoplay
158
+ if (this.options.autoplay) {
159
+ this.start();
160
+ }
161
+
162
+ },
163
+
164
+ resize: function(focus) {
165
+
166
+ var $this = this, pos = 0, maxheight = 0, item, width, cwidth, size;
167
+
168
+ this.items = this.container.children().filter(':visible');
169
+ this.vp = this.element[0].getBoundingClientRect().width;
170
+
171
+ this.container.css({'min-width': '', 'min-height': ''});
172
+
173
+ this.items.each(function(idx){
174
+
175
+ item = UI.$(this);
176
+ size = item.css({'left': '', 'width':''})[0].getBoundingClientRect();
177
+ width = size.width;
178
+ cwidth = item.width();
179
+ maxheight = Math.max(maxheight, size.height);
180
+
181
+ item.css({'left': pos, 'width':width}).data({'idx':idx, 'left': pos, 'width': width, 'cwidth':cwidth, 'area': (pos+width), 'center':(pos - ($this.vp/2 - cwidth/2))});
182
+
183
+ pos += width;
184
+ });
185
+
186
+ this.container.css({'min-width': pos, 'min-height': maxheight});
187
+
188
+ if (this.options.infinite && pos <= (2*this.vp) && !this.itemsResized) {
189
+
190
+ // fill with cloned items
191
+ this.container.children().each(function(idx){
192
+ $this.container.append($this.items.eq(idx).clone(true).attr('id', ''));
193
+ }).each(function(idx){
194
+ $this.container.append($this.items.eq(idx).clone(true).attr('id', ''));
195
+ });
196
+
197
+ this.itemsResized = true;
198
+
199
+ return this.resize();
200
+ }
201
+
202
+ this.cw = pos;
203
+ this.pos = 0;
204
+ this.active = pos >= this.vp;
205
+
206
+ this.container.css({
207
+ '-ms-transform': '',
208
+ '-webkit-transform': '',
209
+ 'transform': ''
210
+ });
211
+
212
+ if (focus) this.updateFocus(this.focus);
213
+ },
214
+
215
+ updatePos: function(pos) {
216
+ this.pos = pos;
217
+ this.container.css({
218
+ '-ms-transform': 'translateX('+pos+'px)',
219
+ '-webkit-transform': 'translateX('+pos+'px)',
220
+ 'transform': 'translateX('+pos+'px)'
221
+ });
222
+ },
223
+
224
+ updateFocus: function(idx, dir) {
225
+
226
+ if (!this.active) {
227
+ return;
228
+ }
229
+
230
+ dir = dir || (idx > this.focus ? 1:-1);
231
+
232
+ var item = this.items.eq(idx), area, i;
233
+
234
+ if (this.options.infinite) {
235
+ this.infinite(idx, dir);
236
+ }
237
+
238
+ if (this.options.center) {
239
+
240
+ this.updatePos(item.data('center')*-1);
241
+
242
+ this.items.filter('.'+this.options.activecls).removeClass(this.options.activecls);
243
+ item.addClass(this.options.activecls);
244
+
245
+ } else {
246
+
247
+ if (this.options.infinite) {
248
+
249
+ this.updatePos(item.data('left')*-1);
250
+
251
+ } else {
252
+
253
+ area = 0;
254
+
255
+ for (i=idx;i<this.items.length;i++) {
256
+ area += this.items.eq(i).data('width');
257
+ }
258
+
259
+
260
+ if (area > this.vp) {
261
+
262
+ this.updatePos(item.data('left')*-1);
263
+
264
+ } else {
265
+
266
+ if (dir == 1) {
267
+
268
+ area = 0;
269
+
270
+ for (i=this.items.length-1;i>=0;i--) {
271
+
272
+ area += this.items.eq(i).data('width');
273
+
274
+ if (area == this.vp) {
275
+ idx = i;
276
+ break;
277
+ }
278
+
279
+ if (area > this.vp) {
280
+ idx = (i < this.items.length-1) ? i+1 : i;
281
+ break;
282
+ }
283
+ }
284
+
285
+ if (area > this.vp) {
286
+ this.updatePos((this.container.width() - this.vp) * -1);
287
+ } else {
288
+ this.updatePos(this.items.eq(idx).data('left')*-1);
289
+ }
290
+ }
291
+ }
292
+ }
293
+ }
294
+
295
+ this.focus = idx;
296
+
297
+ this.trigger('focusitem.uk.slider', [idx,this.items.eq(idx),this]);
298
+ },
299
+
300
+ next: function() {
301
+
302
+ var focus = this.items[this.focus + 1] ? (this.focus + 1) : (this.options.infinite ? 0:this.focus);
303
+
304
+ this.updateFocus(focus, 1);
305
+ },
306
+
307
+ previous: function() {
308
+
309
+ var focus = this.items[this.focus - 1] ? (this.focus - 1) : (this.options.infinite ? (this.items[this.focus - 1] ? this.items-1:this.items.length-1):this.focus);
310
+
311
+ this.updateFocus(focus, -1);
312
+ },
313
+
314
+ start: function() {
315
+
316
+ this.stop();
317
+
318
+ var $this = this;
319
+
320
+ this.interval = setInterval(function() {
321
+ if (!$this.hovering) $this.next();
322
+ }, this.options.autoplayInterval);
323
+
324
+ },
325
+
326
+ stop: function() {
327
+ if (this.interval) clearInterval(this.interval);
328
+ },
329
+
330
+ infinite: function(baseidx, direction) {
331
+
332
+ var $this = this, item = this.items.eq(baseidx), i, z = baseidx, move = [], area = 0;
333
+
334
+ if (direction == 1) {
335
+
336
+
337
+ for (i=0;i<this.items.length;i++) {
338
+
339
+ if (z != baseidx) {
340
+ area += this.items.eq(z).data('width');
341
+ move.push(this.items.eq(z));
342
+ }
343
+
344
+ if (area > this.vp) {
345
+ break;
346
+ }
347
+
348
+ z = z+1 == this.items.length ? 0:z+1;
349
+ }
350
+
351
+ if (move.length) {
352
+
353
+ move.forEach(function(itm){
354
+
355
+ var left = item.data('area');
356
+
357
+ itm.css({'left': left}).data({
358
+ 'left' : left,
359
+ 'area' : (left+itm.data('width')),
360
+ 'center': (left - ($this.vp/2 - itm.data('cwidth')/2))
361
+ });
362
+
363
+ item = itm;
364
+ });
365
+ }
366
+
367
+
368
+ } else {
369
+
370
+ for (i=this.items.length-1;i >-1 ;i--) {
371
+
372
+ area += this.items.eq(z).data('width');
373
+
374
+ if (z != baseidx) {
375
+ move.push(this.items.eq(z));
376
+ }
377
+
378
+ if (area > this.vp) {
379
+ break;
380
+ }
381
+
382
+ z = z-1 == -1 ? this.items.length-1:z-1;
383
+ }
384
+
385
+ if (move.length) {
386
+
387
+ move.forEach(function(itm){
388
+
389
+ var left = item.data('left') - itm.data('width');
390
+
391
+ itm.css({'left': left}).data({
392
+ 'left' : left,
393
+ 'area' : (left+itm.data('width')),
394
+ 'center': (left - ($this.vp/2 - itm.data('cwidth')/2))
395
+ });
396
+
397
+ item = itm;
398
+ });
399
+ }
400
+ }
401
+ }
402
+ });
403
+
404
+ // handle dragging
405
+ UI.$doc.on('mousemove.uikit.slider touchmove.uikit.slider', function(e) {
406
+
407
+ if (e.originalEvent && e.originalEvent.touches) {
408
+ e = e.originalEvent.touches[0];
409
+ }
410
+
411
+ if (delayIdle && Math.abs(e.pageX - delayIdle.x) > delayIdle.threshold) {
412
+
413
+ if (!window.getSelection().toString()) {
414
+ delayIdle(e);
415
+ } else {
416
+ dragging = delayIdle = false;
417
+ }
418
+ }
419
+
420
+ if (!dragging) {
421
+ return;
422
+ }
423
+
424
+ var x, xDiff, pos, dir, focus, item, next, diff, i, z, itm;
425
+
426
+ if (e.clientX || e.clientY) {
427
+ x = e.clientX;
428
+ } else if (e.pageX || e.pageY) {
429
+ x = e.pageX - document.body.scrollLeft - document.documentElement.scrollLeft;
430
+ }
431
+
432
+ focus = store.focus;
433
+ xDiff = x - dragging.element.data('pointer-start').x;
434
+ pos = dragging.element.data('pointer-pos-start') + xDiff;
435
+ dir = x > dragging.element.data('pointer-start').x ? -1:1;
436
+ item = dragging.items.eq(store.focus);
437
+
438
+ if (dir == 1) {
439
+
440
+ diff = item.data('left') + Math.abs(xDiff);
441
+
442
+ for (i=0,z=store.focus;i<dragging.items.length;i++) {
443
+
444
+ itm = dragging.items.eq(z);
445
+
446
+ if (z != store.focus && itm.data('left') < diff && itm.data('area') > diff) {
447
+ focus = z;
448
+ break;
449
+ }
450
+
451
+ z = z+1 == dragging.items.length ? 0:z+1;
452
+ }
453
+
454
+ } else {
455
+
456
+ diff = item.data('left') - Math.abs(xDiff);
457
+
458
+ for (i=0,z=store.focus;i<dragging.items.length;i++) {
459
+
460
+ itm = dragging.items.eq(z);
461
+
462
+ if (z != store.focus && itm.data('area') <= item.data('left') && itm.data('center') < diff) {
463
+ focus = z;
464
+ break;
465
+ }
466
+
467
+ z = z-1 == -1 ? dragging.items.length-1:z-1;
468
+ }
469
+ }
470
+
471
+ if (dragging.options.infinite && focus!=store._focus) {
472
+ dragging.infinite(focus, dir);
473
+ }
474
+
475
+ dragging.updatePos(pos);
476
+
477
+ store.dir = dir;
478
+ store._focus = focus;
479
+ store.touchx = parseInt(e.pageX, 10);
480
+ store.diff = diff;
481
+ });
482
+
483
+ UI.$doc.on('mouseup.uikit.slider touchend.uikit.slider', function(e) {
484
+
485
+ if (dragging) {
486
+
487
+ dragging.container.removeClass('uk-drag');
488
+
489
+ // TODO is this needed?
490
+ dragging.items.eq(store.focus);
491
+
492
+ var itm, focus = false, i, z;
493
+
494
+ if (store.dir == 1) {
495
+
496
+ for (i=0,z=store.focus;i<dragging.items.length;i++) {
497
+
498
+ itm = dragging.items.eq(z);
499
+
500
+ if (z != store.focus && itm.data('left') > store.diff) {
501
+ focus = z;
502
+ break;
503
+ }
504
+
505
+ z = z+1 == dragging.items.length ? 0:z+1;
506
+ }
507
+
508
+ } else {
509
+
510
+ for (i=0,z=store.focus;i<dragging.items.length;i++) {
511
+
512
+ itm = dragging.items.eq(z);
513
+
514
+ if (z != store.focus && itm.data('left') < store.diff) {
515
+ focus = z;
516
+ break;
517
+ }
518
+
519
+ z = z-1 == -1 ? dragging.items.length-1:z-1;
520
+ }
521
+ }
522
+
523
+ dragging.updateFocus(focus!==false ? focus:store._focus);
524
+
525
+ }
526
+
527
+ dragging = delayIdle = false;
528
+ });
529
+
530
+ return UI.slider;
531
+ });