uikit-rails 0.0.2 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
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){"use strict";function o(o,e,i,n){if(o=t.$(o),e=t.$(e),i=i||window.innerWidth,n=n||o.offset(),e.length){var r=e.outerWidth();if(o.css("min-width",r),"right"==t.langdirection){var s=i-(e.offset().left+r),d=i-(o.offset().left+o.outerWidth());o.css("margin-right",s-d)}else o.css("margin-left",e.offset().left-n.left)}}var e,i=!1,n={x:{"bottom-left":"bottom-right","bottom-right":"bottom-left","bottom-center":"bottom-right","top-left":"top-right","top-right":"top-left","top-center":"top-right","left-top":"right","left-bottom":"right-bottom","left-center":"right-center","right-top":"left","right-bottom":"left-bottom","right-center":"left-center"},y:{"bottom-left":"top-left","bottom-right":"top-right","bottom-center":"top-center","top-left":"bottom-left","top-right":"bottom-right","top-center":"bottom-center","left-top":"top-left","left-bottom":"left-bottom","left-center":"top-left","right-top":"top-left","right-bottom":"bottom-left","right-center":"top-left"},xy:{}};t.component("dropdown",{defaults:{mode:"hover",pos:"bottom-left",offset:0,remaintime:800,justify:!1,boundary:t.$win,delay:0,dropdownSelector:".uk-dropdown,.uk-dropdown-blank",hoverDelayIdle:250,preventflip:!1},remainIdle:!1,boot:function(){var o=t.support.touch?"click":"mouseenter";t.$html.on(o+".dropdown.uikit","[data-uk-dropdown]",function(e){var i=t.$(this);if(!i.data("dropdown")){var n=t.dropdown(i,t.Utils.options(i.attr("data-uk-dropdown")));("click"==o||"mouseenter"==o&&"hover"==n.options.mode)&&n.element.trigger(o),n.element.find(n.options.dropdownSelector).length&&e.preventDefault()}})},init:function(){var o=this;this.dropdown=this.find(this.options.dropdownSelector),this.offsetParent=this.dropdown.parents().filter(function(){return-1!==t.$.inArray(t.$(this).css("position"),["relative","fixed","absolute"])}).slice(0,1),this.centered=this.dropdown.hasClass("uk-dropdown-center"),this.justified=this.options.justify?t.$(this.options.justify):!1,this.boundary=t.$(this.options.boundary),this.boundary.length||(this.boundary=t.$win),this.dropdown.hasClass("uk-dropdown-up")&&(this.options.pos="top-left"),this.dropdown.hasClass("uk-dropdown-flip")&&(this.options.pos=this.options.pos.replace("left","right")),this.dropdown.hasClass("uk-dropdown-center")&&(this.options.pos=this.options.pos.replace(/(left|right)/,"center")),this.element.attr("aria-haspopup","true"),this.element.attr("aria-expanded",this.element.hasClass("uk-open")),"click"==this.options.mode||t.support.touch?this.on("click.uikit.dropdown",function(e){var i=t.$(e.target);i.parents(o.options.dropdownSelector).length||((i.is("a[href='#']")||i.parent().is("a[href='#']")||o.dropdown.length&&!o.dropdown.is(":visible"))&&e.preventDefault(),i.blur()),o.element.hasClass("uk-open")?(!o.dropdown.find(e.target).length||i.is(".uk-dropdown-close")||i.parents(".uk-dropdown-close").length)&&o.hide():o.show()}):this.on("mouseenter",function(){o.trigger("pointerenter.uk.dropdown",[o]),o.remainIdle&&clearTimeout(o.remainIdle),e&&clearTimeout(e),i&&i==o||(e=i&&i!=o?setTimeout(function(){e=setTimeout(o.show.bind(o),o.options.delay)},o.options.hoverDelayIdle):setTimeout(o.show.bind(o),o.options.delay))}).on("mouseleave",function(){e&&clearTimeout(e),o.remainIdle=setTimeout(function(){i&&i==o&&o.hide()},o.options.remaintime),o.trigger("pointerleave.uk.dropdown",[o])}).on("click",function(e){var n=t.$(e.target);return o.remainIdle&&clearTimeout(o.remainIdle),i&&i==o?((!o.dropdown.find(e.target).length||n.is(".uk-dropdown-close")||n.parents(".uk-dropdown-close").length)&&o.hide(),void 0):((n.is("a[href='#']")||n.parent().is("a[href='#']"))&&e.preventDefault(),o.show(),void 0)})},show:function(){t.$html.off("click.outer.dropdown"),i&&i!=this&&i.hide(!0),e&&clearTimeout(e),this.trigger("beforeshow.uk.dropdown",[this]),this.checkDimensions(),this.element.addClass("uk-open"),this.element.attr("aria-expanded","true"),this.trigger("show.uk.dropdown",[this]),t.Utils.checkDisplay(this.dropdown,!0),i=this,this.registerOuterClick()},hide:function(t){this.trigger("beforehide.uk.dropdown",[this,t]),this.element.removeClass("uk-open"),this.remainIdle&&clearTimeout(this.remainIdle),this.remainIdle=!1,this.element.attr("aria-expanded","false"),this.trigger("hide.uk.dropdown",[this,t]),i==this&&(i=!1)},registerOuterClick:function(){var o=this;t.$html.off("click.outer.dropdown"),setTimeout(function(){t.$html.on("click.outer.dropdown",function(n){e&&clearTimeout(e);t.$(n.target);i!=o||o.element.find(n.target).length||(o.hide(!0),t.$html.off("click.outer.dropdown"))})},10)},checkDimensions:function(){if(this.dropdown.length){this.dropdown.removeClass("uk-dropdown-top uk-dropdown-bottom uk-dropdown-left uk-dropdown-right uk-dropdown-stack").css({"top-left":"",left:"","margin-left":"","margin-right":""}),this.justified&&this.justified.length&&this.dropdown.css("min-width","");var e,i=t.$.extend({},this.offsetParent.offset(),{width:this.offsetParent[0].offsetWidth,height:this.offsetParent[0].offsetHeight}),r=this.options.offset,s=this.dropdown,d=(s.show().offset()||{left:0,top:0},s.outerWidth()),l=s.outerHeight(),h=this.boundary.width(),p=(this.boundary[0]!==window&&this.boundary.offset()?this.boundary.offset():{top:0,left:0},this.options.pos),a={"bottom-left":{top:0+i.height+r,left:0},"bottom-right":{top:0+i.height+r,left:0+i.width-d},"bottom-center":{top:0+i.height+r,left:0+i.width/2-d/2},"top-left":{top:0-l-r,left:0},"top-right":{top:0-l-r,left:0+i.width-d},"top-center":{top:0-l-r,left:0+i.width/2-d/2},"left-top":{top:0,left:0-d-r},"left-bottom":{top:0+i.height-l,left:0-d-r},"left-center":{top:0+i.height/2-l/2,left:0-d-r},"right-top":{top:0,left:0+i.width+r},"right-bottom":{top:0+i.height-l,left:0+i.width+r},"right-center":{top:0+i.height/2-l/2,left:0+i.width+r}},f={};if(e=p.split("-"),f=a[p]?a[p]:a["bottom-left"],this.justified&&this.justified.length)o(s.css({left:0}),this.justified,h);else if(this.options.preventflip!==!0){var u;switch(this.checkBoundary(i.left+f.left,i.top+f.top,d,l,h)){case"x":"x"!==this.options.preventflip&&(u=n.x[p]||"right-top");break;case"y":"y"!==this.options.preventflip&&(u=n.y[p]||"top-left");break;case"xy":this.options.preventflip||(u=n.xy[p]||"right-bottom")}u&&(e=u.split("-"),f=a[u]?a[u]:a["bottom-left"],this.checkBoundary(i.left+f.left,i.top+f.top,d,l,h)&&(e=p.split("-"),f=a[p]?a[p]:a["bottom-left"]))}d>h&&(s.addClass("uk-dropdown-stack"),this.trigger("stack.uk.dropdown",[this])),s.css(f).css("display","").addClass("uk-dropdown-"+e[0])}},checkBoundary:function(o,e,i,n,r){var s="";return(0>o||o-t.$win.scrollLeft()+i>r)&&(s+="x"),(e-t.$win.scrollTop()<0||e-t.$win.scrollTop()+n>window.innerHeight)&&(s+="y"),s}}),t.component("dropdownOverlay",{defaults:{justify:!1,cls:"",duration:200},boot:function(){t.ready(function(o){t.$("[data-uk-dropdown-overlay]",o).each(function(){var o=t.$(this);o.data("dropdownOverlay")||t.dropdownOverlay(o,t.Utils.options(o.attr("data-uk-dropdown-overlay")))})})},init:function(){var e=this;this.justified=this.options.justify?t.$(this.options.justify):!1,this.overlay=this.element.find("uk-dropdown-overlay"),this.overlay.length||(this.overlay=t.$('<div class="uk-dropdown-overlay"></div>').appendTo(this.element)),this.overlay.addClass(this.options.cls),this.on({"beforeshow.uk.dropdown":function(t,i){e.dropdown=i,e.justified&&e.justified.length&&o(e.overlay.css({display:"block","margin-left":"","margin-right":""}),e.justified,e.justified.outerWidth())},"show.uk.dropdown":function(){var o=e.dropdown.dropdown.outerHeight(!0);e.dropdown.element.removeClass("uk-open"),e.overlay.stop().css("display","block").animate({height:o},e.options.duration,function(){e.dropdown.dropdown.css("visibility",""),e.dropdown.element.addClass("uk-open"),t.Utils.checkDisplay(e.dropdown.dropdown,!0)}),e.pointerleave=!1},"hide.uk.dropdown":function(){e.overlay.stop().animate({height:0},e.options.duration)},"pointerenter.uk.dropdown":function(){clearTimeout(e.remainIdle)},"pointerleave.uk.dropdown":function(){e.pointerleave=!0}}),this.overlay.on({mouseenter:function(){e.remainIdle&&(clearTimeout(e.dropdown.remainIdle),clearTimeout(e.remainIdle))},mouseleave:function(){e.pointerleave&&i&&(e.remainIdle=setTimeout(function(){i&&i.hide()},i.options.remaintime))}})}})}(UIkit);
@@ -0,0 +1,114 @@
1
+ /*! UIkit 2.24.2 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
2
+ (function(UI) {
3
+
4
+ "use strict";
5
+
6
+ var grids = [];
7
+
8
+ UI.component('gridMatchHeight', {
9
+
10
+ defaults: {
11
+ "target" : false,
12
+ "row" : true,
13
+ "ignorestacked" : false
14
+ },
15
+
16
+ boot: function() {
17
+
18
+ // init code
19
+ UI.ready(function(context) {
20
+
21
+ UI.$("[data-uk-grid-match]", context).each(function() {
22
+ var grid = UI.$(this), obj;
23
+
24
+ if (!grid.data("gridMatchHeight")) {
25
+ obj = UI.gridMatchHeight(grid, UI.Utils.options(grid.attr("data-uk-grid-match")));
26
+ }
27
+ });
28
+ });
29
+ },
30
+
31
+ init: function() {
32
+
33
+ var $this = this;
34
+
35
+ this.columns = this.element.children();
36
+ this.elements = this.options.target ? this.find(this.options.target) : this.columns;
37
+
38
+ if (!this.columns.length) return;
39
+
40
+ UI.$win.on('load resize orientationchange', (function() {
41
+
42
+ var fn = function() {
43
+ $this.match();
44
+ };
45
+
46
+ UI.$(function() { fn(); });
47
+
48
+ return UI.Utils.debounce(fn, 50);
49
+ })());
50
+
51
+ UI.$html.on("changed.uk.dom", function(e) {
52
+ $this.columns = $this.element.children();
53
+ $this.elements = $this.options.target ? $this.find($this.options.target) : $this.columns;
54
+ $this.match();
55
+ });
56
+
57
+ this.on("display.uk.check", function(e) {
58
+ if(this.element.is(":visible")) this.match();
59
+ }.bind(this));
60
+
61
+ grids.push(this);
62
+ },
63
+
64
+ match: function() {
65
+
66
+ var firstvisible = this.columns.filter(":visible:first");
67
+
68
+ if (!firstvisible.length) return;
69
+
70
+ var stacked = Math.ceil(100 * parseFloat(firstvisible.css('width')) / parseFloat(firstvisible.parent().css('width'))) >= 100;
71
+
72
+ if (stacked && !this.options.ignorestacked) {
73
+ this.revert();
74
+ } else {
75
+ UI.Utils.matchHeights(this.elements, this.options);
76
+ }
77
+
78
+ return this;
79
+ },
80
+
81
+ revert: function() {
82
+ this.elements.css('min-height', '');
83
+ return this;
84
+ }
85
+ });
86
+
87
+ UI.component('gridMargin', {
88
+
89
+ defaults: {
90
+ "cls": "uk-grid-margin"
91
+ },
92
+
93
+ boot: function() {
94
+
95
+ // init code
96
+ UI.ready(function(context) {
97
+
98
+ UI.$("[data-uk-grid-margin]", context).each(function() {
99
+ var grid = UI.$(this), obj;
100
+
101
+ if (!grid.data("gridMargin")) {
102
+ obj = UI.gridMargin(grid, UI.Utils.options(grid.attr("data-uk-grid-margin")));
103
+ }
104
+ });
105
+ });
106
+ },
107
+
108
+ init: function() {
109
+
110
+ var stackMargin = UI.stackMargin(this.element, this.options);
111
+ }
112
+ });
113
+
114
+ })(UIkit);
@@ -0,0 +1,2 @@
1
+ /*! UIkit 2.24.2 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
2
+ !function(t){"use strict";var i=[];t.component("gridMatchHeight",{defaults:{target:!1,row:!0,ignorestacked:!1},boot:function(){t.ready(function(i){t.$("[data-uk-grid-match]",i).each(function(){var i,n=t.$(this);n.data("gridMatchHeight")||(i=t.gridMatchHeight(n,t.Utils.options(n.attr("data-uk-grid-match"))))})})},init:function(){var n=this;this.columns=this.element.children(),this.elements=this.options.target?this.find(this.options.target):this.columns,this.columns.length&&(t.$win.on("load resize orientationchange",function(){var i=function(){n.match()};return t.$(function(){i()}),t.Utils.debounce(i,50)}()),t.$html.on("changed.uk.dom",function(){n.columns=n.element.children(),n.elements=n.options.target?n.find(n.options.target):n.columns,n.match()}),this.on("display.uk.check",function(){this.element.is(":visible")&&this.match()}.bind(this)),i.push(this))},match:function(){var i=this.columns.filter(":visible:first");if(i.length){var n=Math.ceil(100*parseFloat(i.css("width"))/parseFloat(i.parent().css("width")))>=100;return n&&!this.options.ignorestacked?this.revert():t.Utils.matchHeights(this.elements,this.options),this}},revert:function(){return this.elements.css("min-height",""),this}}),t.component("gridMargin",{defaults:{cls:"uk-grid-margin"},boot:function(){t.ready(function(i){t.$("[data-uk-grid-margin]",i).each(function(){var i,n=t.$(this);n.data("gridMargin")||(i=t.gridMargin(n,t.Utils.options(n.attr("data-uk-grid-margin"))))})})},init:function(){t.stackMargin(this.element,this.options)}})}(UIkit);
@@ -0,0 +1,384 @@
1
+ /*! UIkit 2.24.2 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
2
+ (function(UI) {
3
+
4
+ "use strict";
5
+
6
+ var active = false, activeCount = 0, $html = UI.$html, body;
7
+
8
+ UI.component('modal', {
9
+
10
+ defaults: {
11
+ keyboard: true,
12
+ bgclose: true,
13
+ minScrollHeight: 150,
14
+ center: false,
15
+ modal: true
16
+ },
17
+
18
+ scrollable: false,
19
+ transition: false,
20
+ hasTransitioned: true,
21
+
22
+ init: function() {
23
+
24
+ if (!body) body = UI.$('body');
25
+
26
+ if (!this.element.length) return;
27
+
28
+ var $this = this;
29
+
30
+ this.paddingdir = "padding-" + (UI.langdirection == 'left' ? "right":"left");
31
+ this.dialog = this.find(".uk-modal-dialog");
32
+
33
+ this.active = false;
34
+
35
+ // Update ARIA
36
+ this.element.attr('aria-hidden', this.element.hasClass("uk-open"));
37
+
38
+ this.on("click", ".uk-modal-close", function(e) {
39
+ e.preventDefault();
40
+ $this.hide();
41
+ }).on("click", function(e) {
42
+
43
+ var target = UI.$(e.target);
44
+
45
+ if (target[0] == $this.element[0] && $this.options.bgclose) {
46
+ $this.hide();
47
+ }
48
+ });
49
+ },
50
+
51
+ toggle: function() {
52
+ return this[this.isActive() ? "hide" : "show"]();
53
+ },
54
+
55
+ show: function() {
56
+
57
+ if (!this.element.length) return;
58
+
59
+ var $this = this;
60
+
61
+ if (this.isActive()) return;
62
+
63
+ if (this.options.modal && active) {
64
+ active.hide(true);
65
+ }
66
+
67
+ this.element.removeClass("uk-open").show();
68
+ this.resize();
69
+
70
+ if (this.options.modal) {
71
+ active = this;
72
+ }
73
+
74
+ this.active = true;
75
+
76
+ activeCount++;
77
+
78
+ if (UI.support.transition) {
79
+ this.hasTransitioned = false;
80
+ this.element.one(UI.support.transition.end, function(){
81
+ $this.hasTransitioned = true;
82
+ }).addClass("uk-open");
83
+ } else {
84
+ this.element.addClass("uk-open");
85
+ }
86
+
87
+ $html.addClass("uk-modal-page").height(); // force browser engine redraw
88
+
89
+ // Update ARIA
90
+ this.element.attr('aria-hidden', 'false');
91
+
92
+ this.element.trigger("show.uk.modal");
93
+
94
+ UI.Utils.checkDisplay(this.dialog, true);
95
+
96
+ return this;
97
+ },
98
+
99
+ hide: function(force) {
100
+
101
+ if (!force && UI.support.transition && this.hasTransitioned) {
102
+
103
+ var $this = this;
104
+
105
+ this.one(UI.support.transition.end, function() {
106
+ $this._hide();
107
+ }).removeClass("uk-open");
108
+
109
+ } else {
110
+
111
+ this._hide();
112
+ }
113
+
114
+ return this;
115
+ },
116
+
117
+ resize: function() {
118
+
119
+ var bodywidth = body.width();
120
+
121
+ this.scrollbarwidth = window.innerWidth - bodywidth;
122
+
123
+ body.css(this.paddingdir, this.scrollbarwidth);
124
+
125
+ this.element.css('overflow-y', this.scrollbarwidth ? 'scroll' : 'auto');
126
+
127
+ if (!this.updateScrollable() && this.options.center) {
128
+
129
+ var dh = this.dialog.outerHeight(),
130
+ pad = parseInt(this.dialog.css('margin-top'), 10) + parseInt(this.dialog.css('margin-bottom'), 10);
131
+
132
+ if ((dh + pad) < window.innerHeight) {
133
+ this.dialog.css({'top': (window.innerHeight/2 - dh/2) - pad });
134
+ } else {
135
+ this.dialog.css({'top': ''});
136
+ }
137
+ }
138
+ },
139
+
140
+ updateScrollable: function() {
141
+
142
+ // has scrollable?
143
+ var scrollable = this.dialog.find('.uk-overflow-container:visible:first');
144
+
145
+ if (scrollable.length) {
146
+
147
+ scrollable.css('height', 0);
148
+
149
+ var offset = Math.abs(parseInt(this.dialog.css('margin-top'), 10)),
150
+ dh = this.dialog.outerHeight(),
151
+ wh = window.innerHeight,
152
+ h = wh - 2*(offset < 20 ? 20:offset) - dh;
153
+
154
+ scrollable.css({
155
+ 'max-height': (h < this.options.minScrollHeight ? '':h),
156
+ 'height':''
157
+ });
158
+
159
+ return true;
160
+ }
161
+
162
+ return false;
163
+ },
164
+
165
+ _hide: function() {
166
+
167
+ this.active = false;
168
+ if (activeCount > 0) activeCount--;
169
+ else activeCount = 0;
170
+
171
+ this.element.hide().removeClass('uk-open');
172
+
173
+ // Update ARIA
174
+ this.element.attr('aria-hidden', 'true');
175
+
176
+ if (!activeCount) {
177
+ $html.removeClass('uk-modal-page');
178
+ body.css(this.paddingdir, "");
179
+ }
180
+
181
+ if(active===this) active = false;
182
+
183
+ this.trigger('hide.uk.modal');
184
+ },
185
+
186
+ isActive: function() {
187
+ return this.active;
188
+ }
189
+
190
+ });
191
+
192
+ UI.component('modalTrigger', {
193
+
194
+ boot: function() {
195
+
196
+ // init code
197
+ UI.$html.on("click.modal.uikit", "[data-uk-modal]", function(e) {
198
+
199
+ var ele = UI.$(this);
200
+
201
+ if (ele.is("a")) {
202
+ e.preventDefault();
203
+ }
204
+
205
+ if (!ele.data("modalTrigger")) {
206
+ var modal = UI.modalTrigger(ele, UI.Utils.options(ele.attr("data-uk-modal")));
207
+ modal.show();
208
+ }
209
+
210
+ });
211
+
212
+ // close modal on esc button
213
+ UI.$html.on('keydown.modal.uikit', function (e) {
214
+
215
+ if (active && e.keyCode === 27 && active.options.keyboard) { // ESC
216
+ e.preventDefault();
217
+ active.hide();
218
+ }
219
+ });
220
+
221
+ UI.$win.on("resize orientationchange", UI.Utils.debounce(function(){
222
+ if (active) active.resize();
223
+ }, 150));
224
+ },
225
+
226
+ init: function() {
227
+
228
+ var $this = this;
229
+
230
+ this.options = UI.$.extend({
231
+ "target": $this.element.is("a") ? $this.element.attr("href") : false
232
+ }, this.options);
233
+
234
+ this.modal = UI.modal(this.options.target, this.options);
235
+
236
+ this.on("click", function(e) {
237
+ e.preventDefault();
238
+ $this.show();
239
+ });
240
+
241
+ //methods
242
+ this.proxy(this.modal, "show hide isActive");
243
+ }
244
+ });
245
+
246
+ UI.modal.dialog = function(content, options) {
247
+
248
+ var modal = UI.modal(UI.$(UI.modal.dialog.template).appendTo("body"), options);
249
+
250
+ modal.on("hide.uk.modal", function(){
251
+ if (modal.persist) {
252
+ modal.persist.appendTo(modal.persist.data("modalPersistParent"));
253
+ modal.persist = false;
254
+ }
255
+ modal.element.remove();
256
+ });
257
+
258
+ setContent(content, modal);
259
+
260
+ return modal;
261
+ };
262
+
263
+ UI.modal.dialog.template = '<div class="uk-modal"><div class="uk-modal-dialog" style="min-height:0;"></div></div>';
264
+
265
+ UI.modal.alert = function(content, options) {
266
+
267
+ options = UI.$.extend(true, {bgclose:false, keyboard:false, modal:false, labels:UI.modal.labels}, options);
268
+
269
+ var modal = UI.modal.dialog(([
270
+ '<div class="uk-margin uk-modal-content">'+String(content)+'</div>',
271
+ '<div class="uk-modal-footer uk-text-right"><button class="uk-button uk-button-primary uk-modal-close">'+options.labels.Ok+'</button></div>'
272
+ ]).join(""), options);
273
+
274
+ modal.on('show.uk.modal', function(){
275
+ setTimeout(function(){
276
+ modal.element.find('button:first').focus();
277
+ }, 50);
278
+ });
279
+
280
+ return modal.show();
281
+ };
282
+
283
+ UI.modal.confirm = function(content, onconfirm, options) {
284
+
285
+ onconfirm = UI.$.isFunction(onconfirm) ? onconfirm : function(){};
286
+ options = UI.$.extend(true, {bgclose:false, keyboard:false, modal:false, labels:UI.modal.labels}, options);
287
+
288
+ var modal = UI.modal.dialog(([
289
+ '<div class="uk-margin uk-modal-content">'+String(content)+'</div>',
290
+ '<div class="uk-modal-footer uk-text-right"><button class="uk-button uk-modal-close">'+options.labels.Cancel+'</button> <button class="uk-button uk-button-primary js-modal-confirm">'+options.labels.Ok+'</button></div>'
291
+ ]).join(""), options);
292
+
293
+ modal.element.find(".js-modal-confirm").on("click", function(){
294
+ onconfirm();
295
+ modal.hide();
296
+ });
297
+
298
+ modal.on('show.uk.modal', function(){
299
+ setTimeout(function(){
300
+ modal.element.find('.js-modal-confirm').focus();
301
+ }, 50);
302
+ });
303
+
304
+ return modal.show();
305
+ };
306
+
307
+ UI.modal.prompt = function(text, value, onsubmit, options) {
308
+
309
+ onsubmit = UI.$.isFunction(onsubmit) ? onsubmit : function(value){};
310
+ options = UI.$.extend(true, {bgclose:false, keyboard:false, modal:false, labels:UI.modal.labels}, options);
311
+
312
+ var modal = UI.modal.dialog(([
313
+ text ? '<div class="uk-modal-content uk-form">'+String(text)+'</div>':'',
314
+ '<div class="uk-margin-small-top uk-modal-content uk-form"><p><input type="text" class="uk-width-1-1"></p></div>',
315
+ '<div class="uk-modal-footer uk-text-right"><button class="uk-button uk-modal-close">'+options.labels.Cancel+'</button> <button class="uk-button uk-button-primary js-modal-ok">'+options.labels.Ok+'</button></div>'
316
+ ]).join(""), options),
317
+
318
+ input = modal.element.find("input[type='text']").val(value || '').on('keyup', function(e){
319
+ if (e.keyCode == 13) {
320
+ modal.element.find(".js-modal-ok").trigger('click');
321
+ }
322
+ });
323
+
324
+ modal.element.find(".js-modal-ok").on("click", function(){
325
+ if (onsubmit(input.val())!==false){
326
+ modal.hide();
327
+ }
328
+ });
329
+
330
+ modal.on('show.uk.modal', function(){
331
+ setTimeout(function(){
332
+ input.focus();
333
+ }, 50);
334
+ });
335
+
336
+ return modal.show();
337
+ };
338
+
339
+ UI.modal.blockUI = function(content, options) {
340
+
341
+ var modal = UI.modal.dialog(([
342
+ '<div class="uk-margin uk-modal-content">'+String(content || '<div class="uk-text-center">...</div>')+'</div>'
343
+ ]).join(""), UI.$.extend({bgclose:false, keyboard:false, modal:false}, options));
344
+
345
+ modal.content = modal.element.find('.uk-modal-content:first');
346
+
347
+ return modal.show();
348
+ };
349
+
350
+
351
+ UI.modal.labels = {
352
+ 'Ok': 'Ok',
353
+ 'Cancel': 'Cancel'
354
+ };
355
+
356
+
357
+ // helper functions
358
+ function setContent(content, modal){
359
+
360
+ if(!modal) return;
361
+
362
+ if (typeof content === 'object') {
363
+
364
+ // convert DOM object to a jQuery object
365
+ content = content instanceof jQuery ? content : UI.$(content);
366
+
367
+ if(content.parent().length) {
368
+ modal.persist = content;
369
+ modal.persist.data("modalPersistParent", content.parent());
370
+ }
371
+ }else if (typeof content === 'string' || typeof content === 'number') {
372
+ // just insert the data as innerHTML
373
+ content = UI.$('<div></div>').html(content);
374
+ }else {
375
+ // unsupported data type!
376
+ content = UI.$('<div></div>').html('UIkit.modal Error: Unsupported data type: ' + typeof content);
377
+ }
378
+
379
+ content.appendTo(modal.element.find('.uk-modal-dialog'));
380
+
381
+ return modal;
382
+ }
383
+
384
+ })(UIkit);