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-sortable",["uikit"],function(){return e||t(UIkit)})}(function(t){"use strict";function e(e){e=t.$(e);do{if(e.data("sortable"))return e;e=t.$(e).parent()}while(e.length);return e}function o(t,e){var o=t.parentNode;if(e.parentNode!=o)return!1;for(var n=t.previousSibling;n&&9!==n.nodeType;){if(n===e)return!0;n=n.previousSibling}return!1}function n(t,e){var o=e;if(o==t)return null;for(;o;){if(o.parentNode===t)return o;if(o=o.parentNode,!o||!o.ownerDocument||11===o.nodeType)break}return null}function a(t){t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault(),t.returnValue=!1}var s,r,i,l,d,u,h,p,c,g,f="ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch;return t.component("sortable",{defaults:{animation:150,threshold:10,childClass:"uk-sortable-item",placeholderClass:"uk-sortable-placeholder",overClass:"uk-sortable-over",draggingClass:"uk-sortable-dragged",dragMovingClass:"uk-sortable-moving",baseClass:"uk-sortable",noDragClass:"uk-sortable-nodrag",emptyClass:"uk-sortable-empty",dragCustomClass:"",handleClass:!1,group:!1,stop:function(){},start:function(){},change:function(){}},boot:function(){t.ready(function(e){t.$("[data-uk-sortable]",e).each(function(){var e=t.$(this);e.data("sortable")||t.sortable(e,t.Utils.options(e.attr("data-uk-sortable")))})}),t.$html.on("mousemove touchmove",function(e){if(h){var o=e.originalEvent.targetTouches?e.originalEvent.targetTouches[0]:e;(Math.abs(o.pageX-h.pos.x)>h.threshold||Math.abs(o.pageY-h.pos.y)>h.threshold)&&h.apply(o)}if(s){d||(d=!0,s.show(),s.$current.addClass(s.$sortable.options.placeholderClass),s.$sortable.element.children().addClass(s.$sortable.options.childClass),t.$html.addClass(s.$sortable.options.dragMovingClass));var n=s.data("mouse-offset"),a=parseInt(e.originalEvent.pageX,10)+n.left,r=parseInt(e.originalEvent.pageY,10)+n.top;if(s.css({left:a,top:r}),r+s.height()/3>document.body.offsetHeight)return;r<t.$win.scrollTop()?t.$win.scrollTop(t.$win.scrollTop()-Math.ceil(s.height()/3)):r+s.height()/3>window.innerHeight+t.$win.scrollTop()&&t.$win.scrollTop(t.$win.scrollTop()+Math.ceil(s.height()/3))}}),t.$html.on("mouseup touchend",function(t){if(h=u=!1,!r||!s)return r=s=null,void 0;var o=e(t.target),n=s.$sortable,a={type:t.type};o[0]&&n.dragDrop(a,n.element),n.dragEnd(a,n.element)})},init:function(){function e(){f?u.addEventListener("touchmove",b,!1):(u.addEventListener("mouseover",m,!1),u.addEventListener("mouseout",v,!1))}function o(){f?u.removeEventListener("touchmove",b,!1):(u.removeEventListener("mouseover",m,!1),u.removeEventListener("mouseout",v,!1))}function s(t){r&&d.dragMove(t,d)}function l(e){return function(o){var a,s,r;o&&(a=f&&o.touches&&o.touches[0]||{},s=a.target||o.target,f&&document.elementFromPoint&&(s=document.elementFromPoint(o.pageX-document.body.scrollLeft,o.pageY-document.body.scrollTop)),g=t.$(s)),t.$(s).hasClass(d.options.childClass)?e.apply(s,[o]):s!==u&&(r=n(u,s),r&&e.apply(r,[o]))}}var d=this,u=this.element[0];p=[],this.checkEmptyList(),this.element.data("sortable-group",this.options.group?this.options.group:t.Utils.uid("sortable-group"));var h=l(function(e){if(!e.data||!e.data.sortable){var o=t.$(e.target),n=o.is("a[href]")?o:o.parents("a[href]");if(!o.is(":input"))return e.preventDefault(),!f&&n.length&&n.one("click",function(t){t.preventDefault()}).one("mouseup",function(){c||n.trigger("click")}),e.data=e.data||{},e.data.sortable=u,d.dragStart(e,this)}}),m=(l(function(t){return r?(t.preventDefault&&t.preventDefault(),!1):!0}),l(t.Utils.debounce(function(t){return d.dragEnter(t,this)}),40)),v=l(function(){var e=d.dragenterData(this);d.dragenterData(this,e-1),d.dragenterData(this)||(t.$(this).removeClass(d.options.overClass),d.dragenterData(this,!1))}),b=l(function(t){return r&&r!==this&&i!==this?(d.element.children().removeClass(d.options.overClass),i=this,d.moveElementNextTo(r,this),a(t)):!0});this.addDragHandlers=e,this.removeDragHandlers=o,window.addEventListener(f?"touchmove":"mousemove",s,!1),u.addEventListener(f?"touchstart":"mousedown",h,!1)},dragStart:function(e,o){c=!1,d=!1,l=!1;var n=this,a=t.$(e.target);if(f||2!=e.button){if(n.options.handleClass){var i=a.hasClass(n.options.handleClass)?a:a.closest("."+n.options.handleClass,n.element);if(!i.length)return}if(!a.is("."+n.options.noDragClass)&&!a.closest("."+n.options._noDragClass).length&&!a.is(":input")){r=o,s&&s.remove();var u=t.$(r),p=u.offset();h={pos:{x:e.pageX,y:e.pageY},threshold:n.options.threshold,apply:function(e){s=t.$('<div class="'+[n.options.draggingClass,n.options.dragCustomClass].join(" ")+'"></div>').css({display:"none",top:p.top,left:p.left,width:u.width(),height:u.height(),padding:u.css("padding")}).data({"mouse-offset":{left:p.left-parseInt(e.pageX,10),top:p.top-parseInt(e.pageY,10)},origin:n.element,index:u.index()}).append(u.html()).appendTo("body"),s.$current=u,s.$sortable=n,u.data({"start-list":u.parent(),"start-index":u.index(),"sortable-group":n.options.group}),n.addDragHandlers(),n.options.start(this,r),n.trigger("start.uk.sortable",[n,r]),c=!0,h=!1}}}}},dragMove:function(e){g=t.$(document.elementFromPoint(e.pageX-(document.body.scrollLeft||document.scrollLeft||0),e.pageY-(document.body.scrollTop||document.documentElement.scrollTop||0)));var o,n=g.closest("."+this.options.baseClass),a=n.data("sortable-group"),s=t.$(r),i=s.parent(),l=s.data("sortable-group");n[0]!==i[0]&&void 0!==l&&a===l&&(n.data("sortable").addDragHandlers(),p.push(n),n.children().addClass(this.options.childClass),n.children().length>0?(o=g.closest("."+this.options.childClass),o.length?o.before(s):n.append(s)):g.append(s),UIkit.$doc.trigger("mouseover")),this.checkEmptyList(),this.checkEmptyList(i)},dragEnter:function(e,o){if(!r||r===o)return!0;var n=this.dragenterData(o);if(this.dragenterData(o,n+1),0===n){var a=t.$(o).parent(),s=t.$(r).data("start-list");if(a[0]!==s[0]){var i=a.data("sortable-group"),l=t.$(r).data("sortable-group");if((i||l)&&i!=l)return!1}t.$(o).addClass(this.options.overClass),this.moveElementNextTo(r,o)}return!1},dragEnd:function(e,o){var n=this;r&&(this.options.stop(o),this.trigger("stop.uk.sortable",[this])),r=null,i=null,p.push(this.element),p.forEach(function(e){t.$(e).children().each(function(){1===this.nodeType&&(t.$(this).removeClass(n.options.overClass).removeClass(n.options.placeholderClass).removeClass(n.options.childClass),n.dragenterData(this,!1))})}),p=[],t.$html.removeClass(this.options.dragMovingClass),this.removeDragHandlers(),s&&(s.remove(),s=null)},dragDrop:function(t){"drop"===t.type&&(t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault()),this.triggerChangeEvents()},triggerChangeEvents:function(){if(r){var e=t.$(r),o=s.data("origin"),n=e.closest("."+this.options.baseClass),a=[],i=t.$(r);o[0]===n[0]&&s.data("index")!=e.index()?a.push({sortable:this,mode:"moved"}):o[0]!=n[0]&&a.push({sortable:t.$(n).data("sortable"),mode:"added"},{sortable:t.$(o).data("sortable"),mode:"removed"}),a.forEach(function(t){t.sortable.element.trigger("change.uk.sortable",[t.sortable,i,t.mode])})}},dragenterData:function(e,o){return e=t.$(e),1==arguments.length?parseInt(e.data("child-dragenter"),10)||0:(o?e.data("child-dragenter",Math.max(0,o)):e.removeData("child-dragenter"),void 0)},moveElementNextTo:function(e,n){l=!0;var a=this,s=t.$(e).parent().css("min-height",""),r=o(e,n)?n:n.nextSibling,i=s.children(),d=i.length;return a.options.animation?(s.css("min-height",s.height()),i.stop().each(function(){var e=t.$(this),o=e.position();o.width=e.width(),e.data("offset-before",o)}),n.parentNode.insertBefore(e,r),t.Utils.checkDisplay(a.element.parent()),i=s.children().each(function(){var e=t.$(this);e.data("offset-after",e.position())}).each(function(){var e=t.$(this),o=e.data("offset-before");e.css({position:"absolute",top:o.top,left:o.left,"min-width":o.width})}),i.each(function(){var e=t.$(this),o=(e.data("offset-before"),e.data("offset-after"));e.css("pointer-events","none").width(),setTimeout(function(){e.animate({top:o.top,left:o.left},a.options.animation,function(){e.css({position:"",top:"",left:"","min-width":"","pointer-events":""}).removeClass(a.options.overClass).removeData("child-dragenter"),d--,d||(s.css("min-height",""),t.Utils.checkDisplay(a.element.parent()))})},0)}),void 0):(n.parentNode.insertBefore(e,r),t.Utils.checkDisplay(a.element.parent()),void 0)},serialize:function(){var e,o,n=[];return this.element.children().each(function(a,s){e={};for(var r=0;r<s.attributes.length;r++)o=s.attributes[r],0===o.name.indexOf("data-")&&(e[o.name.substr(5)]=t.Utils.str2json(o.value));n.push(e)}),n},checkEmptyList:function(e){e=e?t.$(e):this.element,this.options.emptyClass&&e[e.children().length?"removeClass":"addClass"](this.options.emptyClass)}}),t.sortable});
@@ -0,0 +1,359 @@
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-sticky", ["uikit"], function(){
12
+ return component || addon(UIkit);
13
+ });
14
+ }
15
+
16
+ })(function(UI){
17
+
18
+ "use strict";
19
+
20
+ var $win = UI.$win,
21
+ $doc = UI.$doc,
22
+ sticked = [],
23
+ direction = 1;
24
+
25
+ UI.component('sticky', {
26
+
27
+ defaults: {
28
+ top : 0,
29
+ bottom : 0,
30
+ animation : '',
31
+ clsinit : 'uk-sticky-init',
32
+ clsactive : 'uk-active',
33
+ clsinactive : '',
34
+ getWidthFrom : '',
35
+ showup : false,
36
+ boundary : false,
37
+ media : false,
38
+ target : false,
39
+ disabled : false
40
+ },
41
+
42
+ boot: function() {
43
+
44
+ // should be more efficient than using $win.scroll(checkscrollposition):
45
+ UI.$doc.on('scrolling.uk.document', function(e, data) {
46
+ if (!data || !data.dir) return;
47
+ direction = data.dir.y;
48
+ checkscrollposition();
49
+ });
50
+
51
+ UI.$win.on('resize orientationchange', UI.Utils.debounce(function() {
52
+
53
+ if (!sticked.length) return;
54
+
55
+ for (var i = 0; i < sticked.length; i++) {
56
+ sticked[i].reset(true);
57
+ //sticked[i].self.computeWrapper();
58
+ }
59
+
60
+ checkscrollposition();
61
+ }, 100));
62
+
63
+ // init code
64
+ UI.ready(function(context) {
65
+
66
+ setTimeout(function(){
67
+
68
+ UI.$("[data-uk-sticky]", context).each(function(){
69
+
70
+ var $ele = UI.$(this);
71
+
72
+ if(!$ele.data("sticky")) {
73
+ UI.sticky($ele, UI.Utils.options($ele.attr('data-uk-sticky')));
74
+ }
75
+ });
76
+
77
+ checkscrollposition();
78
+ }, 0);
79
+ });
80
+ },
81
+
82
+ init: function() {
83
+
84
+ var wrapper = UI.$('<div class="uk-sticky-placeholder"></div>'), boundary = this.options.boundary, boundtoparent;
85
+
86
+ this.wrapper = this.element.css('margin', 0).wrap(wrapper).parent();
87
+
88
+ this.computeWrapper();
89
+
90
+ if (boundary) {
91
+
92
+ if (boundary === true || boundary[0] === '!') {
93
+
94
+ boundary = boundary === true ? this.wrapper.parent() : this.wrapper.closest(boundary.substr(1));
95
+ boundtoparent = true;
96
+
97
+ } else if (typeof boundary === "string") {
98
+ boundary = UI.$(boundary);
99
+ }
100
+ }
101
+
102
+ this.sticky = {
103
+ self : this,
104
+ options : this.options,
105
+ element : this.element,
106
+ currentTop : null,
107
+ wrapper : this.wrapper,
108
+ init : false,
109
+ getWidthFrom : UI.$(this.options.getWidthFrom || this.wrapper),
110
+ boundary : boundary,
111
+ boundtoparent : boundtoparent,
112
+ top : 0,
113
+ calcTop : function() {
114
+
115
+ var top = this.options.top;
116
+
117
+ // dynamic top parameter
118
+ if (this.options.top && typeof(this.options.top) == 'string') {
119
+
120
+ // e.g. 50vh
121
+ if (this.options.top.match(/^(-|)(\d+)vh$/)) {
122
+ top = window.innerHeight * parseInt(this.options.top, 10)/100;
123
+ // e.g. #elementId, or .class-1,class-2,.class-3 (first found is used)
124
+ } else {
125
+
126
+ var topElement = UI.$(this.options.top).first();
127
+
128
+ if (topElement.length && topElement.is(':visible')) {
129
+ top = -1 * ((topElement.offset().top + topElement.outerHeight()) - this.wrapper.offset().top);
130
+ }
131
+ }
132
+
133
+ }
134
+
135
+ this.top = top;
136
+ },
137
+
138
+ reset: function(force) {
139
+
140
+ this.calcTop();
141
+
142
+ var finalize = function() {
143
+ this.element.css({"position":"", "top":"", "width":"", "left":"", "margin":"0"});
144
+ this.element.removeClass([this.options.animation, 'uk-animation-reverse', this.options.clsactive].join(' '));
145
+ this.element.addClass(this.options.clsinactive);
146
+ this.element.trigger('inactive.uk.sticky');
147
+
148
+ this.currentTop = null;
149
+ this.animate = false;
150
+ }.bind(this);
151
+
152
+
153
+ if (!force && this.options.animation && UI.support.animation && !UI.Utils.isInView(this.wrapper)) {
154
+
155
+ this.animate = true;
156
+
157
+ this.element.removeClass(this.options.animation).one(UI.support.animation.end, function(){
158
+ finalize();
159
+ }).width(); // force redraw
160
+
161
+ this.element.addClass(this.options.animation+' '+'uk-animation-reverse');
162
+ } else {
163
+ finalize();
164
+ }
165
+ },
166
+
167
+ check: function() {
168
+
169
+ if (this.options.disabled) {
170
+ return false;
171
+ }
172
+
173
+ if (this.options.media) {
174
+
175
+ switch(typeof(this.options.media)) {
176
+ case 'number':
177
+ if (window.innerWidth < this.options.media) {
178
+ return false;
179
+ }
180
+ break;
181
+ case 'string':
182
+ if (window.matchMedia && !window.matchMedia(this.options.media).matches) {
183
+ return false;
184
+ }
185
+ break;
186
+ }
187
+ }
188
+
189
+ var scrollTop = $win.scrollTop(),
190
+ documentHeight = $doc.height(),
191
+ dwh = documentHeight - window.innerHeight,
192
+ extra = (scrollTop > dwh) ? dwh - scrollTop : 0,
193
+ elementTop = this.wrapper.offset().top,
194
+ etse = elementTop - this.top - extra,
195
+ active = (scrollTop >= etse);
196
+
197
+ if (active && this.options.showup) {
198
+
199
+ // set inactiv if scrolling down
200
+ if (direction == 1) {
201
+ active = false;
202
+ }
203
+
204
+ // set inactive when wrapper is still in view
205
+ if (direction == -1 && !this.element.hasClass(this.options.clsactive) && UI.Utils.isInView(this.wrapper)) {
206
+ active = false;
207
+ }
208
+ }
209
+
210
+ return active;
211
+ }
212
+ };
213
+
214
+ this.sticky.calcTop();
215
+
216
+ sticked.push(this.sticky);
217
+ },
218
+
219
+ update: function() {
220
+ checkscrollposition(this.sticky);
221
+ },
222
+
223
+ enable: function() {
224
+ this.options.disabled = false;
225
+ this.update();
226
+ },
227
+
228
+ disable: function(force) {
229
+ this.options.disabled = true;
230
+ this.sticky.reset(force);
231
+ },
232
+
233
+ computeWrapper: function() {
234
+
235
+ this.wrapper.css({
236
+ 'height' : ['absolute','fixed'].indexOf(this.element.css('position')) == -1 ? this.element.outerHeight() : '',
237
+ 'float' : this.element.css('float') != 'none' ? this.element.css('float') : '',
238
+ 'margin' : this.element.css('margin')
239
+ });
240
+
241
+ if (this.element.css('position') == 'fixed') {
242
+ this.element.css({
243
+ width: this.sticky.getWidthFrom.length ? this.sticky.getWidthFrom.width() : this.element.width()
244
+ });
245
+ }
246
+ }
247
+ });
248
+
249
+ function checkscrollposition(direction) {
250
+
251
+ var stickies = arguments.length ? arguments : sticked;
252
+
253
+ if (!stickies.length || $win.scrollTop() < 0) return;
254
+
255
+ var scrollTop = $win.scrollTop(),
256
+ documentHeight = $doc.height(),
257
+ windowHeight = $win.height(),
258
+ dwh = documentHeight - windowHeight,
259
+ extra = (scrollTop > dwh) ? dwh - scrollTop : 0,
260
+ newTop, containerBottom, stickyHeight, sticky;
261
+
262
+ for (var i = 0; i < stickies.length; i++) {
263
+
264
+ sticky = stickies[i];
265
+
266
+ if (!sticky.element.is(":visible") || sticky.animate) {
267
+ continue;
268
+ }
269
+
270
+ if (!sticky.check()) {
271
+
272
+ if (sticky.currentTop !== null) {
273
+ sticky.reset();
274
+ }
275
+
276
+ } else {
277
+
278
+ if (sticky.top < 0) {
279
+ newTop = 0;
280
+ } else {
281
+ stickyHeight = sticky.element.outerHeight();
282
+ newTop = documentHeight - stickyHeight - sticky.top - sticky.options.bottom - scrollTop - extra;
283
+ newTop = newTop < 0 ? newTop + sticky.top : sticky.top;
284
+ }
285
+
286
+ if (sticky.boundary && sticky.boundary.length) {
287
+
288
+ var bTop = sticky.boundary.offset().top;
289
+
290
+ if (sticky.boundtoparent) {
291
+ containerBottom = documentHeight - (bTop + sticky.boundary.outerHeight()) + parseInt(sticky.boundary.css('padding-bottom'));
292
+ } else {
293
+ containerBottom = documentHeight - bTop - parseInt(sticky.boundary.css('margin-top'));
294
+ }
295
+
296
+ newTop = (scrollTop + stickyHeight) > (documentHeight - containerBottom - (sticky.top < 0 ? 0 : sticky.top)) ? (documentHeight - containerBottom) - (scrollTop + stickyHeight) : newTop;
297
+ }
298
+
299
+
300
+ if (sticky.currentTop != newTop) {
301
+
302
+ sticky.element.css({
303
+ position : "fixed",
304
+ top : newTop,
305
+ width : sticky.getWidthFrom.length ? sticky.getWidthFrom.width() : sticky.element.width(),
306
+ left : sticky.wrapper.offset().left
307
+ });
308
+
309
+ if (!sticky.init) {
310
+
311
+ sticky.element.addClass(sticky.options.clsinit);
312
+
313
+ if (location.hash && scrollTop > 0 && sticky.options.target) {
314
+
315
+ var $target = UI.$(location.hash);
316
+
317
+ if ($target.length) {
318
+
319
+ setTimeout((function($target, sticky){
320
+
321
+ return function() {
322
+
323
+ sticky.element.width(); // force redraw
324
+
325
+ var offset = $target.offset(),
326
+ maxoffset = offset.top + $target.outerHeight(),
327
+ stickyOffset = sticky.element.offset(),
328
+ stickyHeight = sticky.element.outerHeight(),
329
+ stickyMaxOffset = stickyOffset.top + stickyHeight;
330
+
331
+ if (stickyOffset.top < maxoffset && offset.top < stickyMaxOffset) {
332
+ scrollTop = offset.top - stickyHeight - sticky.options.target;
333
+ window.scrollTo(0, scrollTop);
334
+ }
335
+ };
336
+
337
+ })($target, sticky), 0);
338
+ }
339
+ }
340
+ }
341
+
342
+ sticky.element.addClass(sticky.options.clsactive).removeClass(sticky.options.clsinactive);
343
+ sticky.element.trigger('active.uk.sticky');
344
+ sticky.element.css('margin', '');
345
+
346
+ if (sticky.options.animation && sticky.init && !UI.Utils.isInView(sticky.wrapper)) {
347
+ sticky.element.addClass(sticky.options.animation);
348
+ }
349
+
350
+ sticky.currentTop = newTop;
351
+ }
352
+ }
353
+
354
+ sticky.init = true;
355
+ }
356
+ }
357
+
358
+ return UI.sticky;
359
+ });
@@ -0,0 +1,2 @@
1
+ /*! UIkit 2.24.2 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
2
+ !function(t){var i;window.UIkit&&(i=t(UIkit)),"function"==typeof define&&define.amd&&define("uikit-sticky",["uikit"],function(){return i||t(UIkit)})}(function(t){"use strict";function i(){var i=arguments.length?arguments:n;if(i.length&&!(e.scrollTop()<0))for(var o,a,r,p,h=e.scrollTop(),c=s.height(),l=e.height(),d=c-l,u=h>d?d-h:0,m=0;m<i.length;m++)if(p=i[m],p.element.is(":visible")&&!p.animate){if(p.check()){if(p.top<0?o=0:(r=p.element.outerHeight(),o=c-r-p.top-p.options.bottom-h-u,o=0>o?o+p.top:p.top),p.boundary&&p.boundary.length){var f=p.boundary.offset().top;a=p.boundtoparent?c-(f+p.boundary.outerHeight())+parseInt(p.boundary.css("padding-bottom")):c-f-parseInt(p.boundary.css("margin-top")),o=h+r>c-a-(p.top<0?0:p.top)?c-a-(h+r):o}if(p.currentTop!=o){if(p.element.css({position:"fixed",top:o,width:p.getWidthFrom.length?p.getWidthFrom.width():p.element.width(),left:p.wrapper.offset().left}),!p.init&&(p.element.addClass(p.options.clsinit),location.hash&&h>0&&p.options.target)){var g=t.$(location.hash);g.length&&setTimeout(function(t,i){return function(){i.element.width();var e=t.offset(),s=e.top+t.outerHeight(),n=i.element.offset(),o=i.element.outerHeight(),a=n.top+o;n.top<s&&e.top<a&&(h=e.top-o-i.options.target,window.scrollTo(0,h))}}(g,p),0)}p.element.addClass(p.options.clsactive).removeClass(p.options.clsinactive),p.element.trigger("active.uk.sticky"),p.element.css("margin",""),p.options.animation&&p.init&&!t.Utils.isInView(p.wrapper)&&p.element.addClass(p.options.animation),p.currentTop=o}}else null!==p.currentTop&&p.reset();p.init=!0}}var e=t.$win,s=t.$doc,n=[],o=1;return t.component("sticky",{defaults:{top:0,bottom:0,animation:"",clsinit:"uk-sticky-init",clsactive:"uk-active",clsinactive:"",getWidthFrom:"",showup:!1,boundary:!1,media:!1,target:!1,disabled:!1},boot:function(){t.$doc.on("scrolling.uk.document",function(t,e){e&&e.dir&&(o=e.dir.y,i())}),t.$win.on("resize orientationchange",t.Utils.debounce(function(){if(n.length){for(var t=0;t<n.length;t++)n[t].reset(!0);i()}},100)),t.ready(function(e){setTimeout(function(){t.$("[data-uk-sticky]",e).each(function(){var i=t.$(this);i.data("sticky")||t.sticky(i,t.Utils.options(i.attr("data-uk-sticky")))}),i()},0)})},init:function(){var i,a=t.$('<div class="uk-sticky-placeholder"></div>'),r=this.options.boundary;this.wrapper=this.element.css("margin",0).wrap(a).parent(),this.computeWrapper(),r&&(r===!0||"!"===r[0]?(r=r===!0?this.wrapper.parent():this.wrapper.closest(r.substr(1)),i=!0):"string"==typeof r&&(r=t.$(r))),this.sticky={self:this,options:this.options,element:this.element,currentTop:null,wrapper:this.wrapper,init:!1,getWidthFrom:t.$(this.options.getWidthFrom||this.wrapper),boundary:r,boundtoparent:i,top:0,calcTop:function(){var i=this.options.top;if(this.options.top&&"string"==typeof this.options.top)if(this.options.top.match(/^(-|)(\d+)vh$/))i=window.innerHeight*parseInt(this.options.top,10)/100;else{var e=t.$(this.options.top).first();e.length&&e.is(":visible")&&(i=-1*(e.offset().top+e.outerHeight()-this.wrapper.offset().top))}this.top=i},reset:function(i){this.calcTop();var e=function(){this.element.css({position:"",top:"",width:"",left:"",margin:"0"}),this.element.removeClass([this.options.animation,"uk-animation-reverse",this.options.clsactive].join(" ")),this.element.addClass(this.options.clsinactive),this.element.trigger("inactive.uk.sticky"),this.currentTop=null,this.animate=!1}.bind(this);!i&&this.options.animation&&t.support.animation&&!t.Utils.isInView(this.wrapper)?(this.animate=!0,this.element.removeClass(this.options.animation).one(t.support.animation.end,function(){e()}).width(),this.element.addClass(this.options.animation+" uk-animation-reverse")):e()},check:function(){if(this.options.disabled)return!1;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 i=e.scrollTop(),n=s.height(),a=n-window.innerHeight,r=i>a?a-i:0,p=this.wrapper.offset().top,h=p-this.top-r,c=i>=h;return c&&this.options.showup&&(1==o&&(c=!1),-1==o&&!this.element.hasClass(this.options.clsactive)&&t.Utils.isInView(this.wrapper)&&(c=!1)),c}},this.sticky.calcTop(),n.push(this.sticky)},update:function(){i(this.sticky)},enable:function(){this.options.disabled=!1,this.update()},disable:function(t){this.options.disabled=!0,this.sticky.reset(t)},computeWrapper:function(){this.wrapper.css({height:-1==["absolute","fixed"].indexOf(this.element.css("position"))?this.element.outerHeight():"","float":"none"!=this.element.css("float")?this.element.css("float"):"",margin:this.element.css("margin")}),"fixed"==this.element.css("position")&&this.element.css({width:this.sticky.getWidthFrom.length?this.sticky.getWidthFrom.width():this.element.width()})}}),t.sticky});
@@ -0,0 +1,192 @@
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-timepicker", ["uikit"], function(){
12
+ return component || addon(UIkit);
13
+ });
14
+ }
15
+
16
+ })(function(UI){
17
+
18
+ "use strict";
19
+
20
+
21
+ UI.component('timepicker', {
22
+
23
+ defaults: {
24
+ format : '24h',
25
+ delay : 0,
26
+ start : 0,
27
+ end : 24
28
+ },
29
+
30
+ boot: function() {
31
+
32
+ // init code
33
+ UI.$html.on("focus.timepicker.uikit", "[data-uk-timepicker]", function(e) {
34
+
35
+ var ele = UI.$(this);
36
+
37
+ if (!ele.data("timepicker")) {
38
+ var obj = UI.timepicker(ele, UI.Utils.options(ele.attr("data-uk-timepicker")));
39
+
40
+ setTimeout(function(){
41
+ obj.autocomplete.input.focus();
42
+ }, 40);
43
+ }
44
+ });
45
+ },
46
+
47
+ init: function() {
48
+
49
+ var $this = this, times = getTimeRange(this.options.start, this.options.end), container;
50
+
51
+ this.options.minLength = 0;
52
+ this.options.template = '<ul class="uk-nav uk-nav-autocomplete uk-autocomplete-results">{{~items}}<li data-value="{{$item.value}}"><a>{{$item.value}}</a></li>{{/items}}</ul>';
53
+
54
+ this.options.source = function(release) {
55
+ release(times[$this.options.format] || times['12h']);
56
+ };
57
+
58
+ if (this.element.is('input')) {
59
+ this.element.wrap('<div class="uk-autocomplete"></div>');
60
+ container = this.element.parent();
61
+ } else {
62
+ container = this.element.addClass('uk-autocomplete');
63
+ }
64
+
65
+ this.autocomplete = UI.autocomplete(container, this.options);
66
+ this.autocomplete.dropdown.addClass('uk-dropdown-small uk-dropdown-scrollable');
67
+
68
+ this.autocomplete.on('show.uk.autocomplete', function() {
69
+
70
+ var selected = $this.autocomplete.dropdown.find('[data-value="'+$this.autocomplete.input.val()+'"]');
71
+
72
+ setTimeout(function(){
73
+ $this.autocomplete.pick(selected, true);
74
+ }, 10);
75
+ });
76
+
77
+ this.autocomplete.input.on('focus', function(){
78
+
79
+ $this.autocomplete.value = Math.random();
80
+ $this.autocomplete.triggercomplete();
81
+
82
+ }).on('blur', UI.Utils.debounce(function() {
83
+ $this.checkTime();
84
+ }, 100));
85
+
86
+ this.element.data("timepicker", this);
87
+ },
88
+
89
+ checkTime: function() {
90
+
91
+ var arr, timeArray, meridian = 'AM', hour, minute, time = this.autocomplete.input.val();
92
+
93
+ if (this.options.format == '12h') {
94
+ arr = time.split(' ');
95
+ timeArray = arr[0].split(':');
96
+ meridian = arr[1];
97
+ } else {
98
+ timeArray = time.split(':');
99
+ }
100
+
101
+ hour = parseInt(timeArray[0], 10);
102
+ minute = parseInt(timeArray[1], 10);
103
+
104
+ if (isNaN(hour)) hour = 0;
105
+ if (isNaN(minute)) minute = 0;
106
+
107
+ if (this.options.format == '12h') {
108
+ if (hour > 12) {
109
+ hour = 12;
110
+ } else if (hour < 0) {
111
+ hour = 12;
112
+ }
113
+
114
+ if (meridian === 'am' || meridian === 'a') {
115
+ meridian = 'AM';
116
+ } else if (meridian === 'pm' || meridian === 'p') {
117
+ meridian = 'PM';
118
+ }
119
+
120
+ if (meridian !== 'AM' && meridian !== 'PM') {
121
+ meridian = 'AM';
122
+ }
123
+
124
+ } else {
125
+
126
+ if (hour >= 24) {
127
+ hour = 23;
128
+ } else if (hour < 0) {
129
+ hour = 0;
130
+ }
131
+ }
132
+
133
+ if (minute < 0) {
134
+ minute = 0;
135
+ } else if (minute >= 60) {
136
+ minute = 0;
137
+ }
138
+
139
+ this.autocomplete.input.val(this.formatTime(hour, minute, meridian)).trigger('change');
140
+ },
141
+
142
+ formatTime: function(hour, minute, meridian) {
143
+ hour = hour < 10 ? '0' + hour : hour;
144
+ minute = minute < 10 ? '0' + minute : minute;
145
+ return hour + ':' + minute + (this.options.format == '12h' ? ' ' + meridian : '');
146
+ }
147
+ });
148
+
149
+ // helper
150
+
151
+ function getTimeRange(start, end) {
152
+
153
+ start = start || 0;
154
+ end = end || 24;
155
+
156
+ var times = {'12h':[], '24h':[]}, i, h;
157
+
158
+ for (i = start, h=''; i<end; i++) {
159
+
160
+ h = ''+i;
161
+
162
+ if (i<10) h = '0'+h;
163
+
164
+ times['24h'].push({value: (h+':00')});
165
+ times['24h'].push({value: (h+':30')});
166
+
167
+ if (i === 0) {
168
+ h = 12;
169
+ times['12h'].push({value: (h+':00 AM')});
170
+ times['12h'].push({value: (h+':30 AM')});
171
+ }
172
+
173
+ if (i > 0 && i<13 && i!==12) {
174
+ times['12h'].push({value: (h+':00 AM')});
175
+ times['12h'].push({value: (h+':30 AM')});
176
+ }
177
+
178
+ if (i >= 12) {
179
+
180
+ h = h-12;
181
+ if (h === 0) h = 12;
182
+ if (h < 10) h = '0'+String(h);
183
+
184
+ times['12h'].push({value: (h+':00 PM')});
185
+ times['12h'].push({value: (h+':30 PM')});
186
+ }
187
+ }
188
+
189
+ return times;
190
+ }
191
+
192
+ });