uikit2-rails 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (223) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +10 -0
  3. data/.travis.yml +4 -0
  4. data/Gemfile +4 -0
  5. data/README.md +66 -0
  6. data/Rakefile +1 -0
  7. data/bin/console +14 -0
  8. data/bin/setup +7 -0
  9. data/lib/uikit2/rails.rb +8 -0
  10. data/lib/uikit2/rails/version.rb +5 -0
  11. data/uikit2-rails.gemspec +25 -0
  12. data/vendor/assets/fonts/FontAwesome.otf +0 -0
  13. data/vendor/assets/fonts/fontawesome-webfont.eot +0 -0
  14. data/vendor/assets/fonts/fontawesome-webfont.ttf +0 -0
  15. data/vendor/assets/fonts/fontawesome-webfont.woff +0 -0
  16. data/vendor/assets/fonts/fontawesome-webfont.woff2 +0 -0
  17. data/vendor/assets/javascripts/uikit.js +3537 -0
  18. data/vendor/assets/javascripts/uikit/components/accordion.js +172 -0
  19. data/vendor/assets/javascripts/uikit/components/accordion.min.js +2 -0
  20. data/vendor/assets/javascripts/uikit/components/autocomplete.js +334 -0
  21. data/vendor/assets/javascripts/uikit/components/autocomplete.min.js +2 -0
  22. data/vendor/assets/javascripts/uikit/components/datepicker.js +3166 -0
  23. data/vendor/assets/javascripts/uikit/components/datepicker.min.js +3 -0
  24. data/vendor/assets/javascripts/uikit/components/form-password.js +67 -0
  25. data/vendor/assets/javascripts/uikit/components/form-password.min.js +2 -0
  26. data/vendor/assets/javascripts/uikit/components/form-select.js +70 -0
  27. data/vendor/assets/javascripts/uikit/components/form-select.min.js +2 -0
  28. data/vendor/assets/javascripts/uikit/components/grid.js +523 -0
  29. data/vendor/assets/javascripts/uikit/components/grid.min.js +2 -0
  30. data/vendor/assets/javascripts/uikit/components/htmleditor.js +623 -0
  31. data/vendor/assets/javascripts/uikit/components/htmleditor.min.js +2 -0
  32. data/vendor/assets/javascripts/uikit/components/lightbox.js +555 -0
  33. data/vendor/assets/javascripts/uikit/components/lightbox.min.js +2 -0
  34. data/vendor/assets/javascripts/uikit/components/nestable.js +638 -0
  35. data/vendor/assets/javascripts/uikit/components/nestable.min.js +2 -0
  36. data/vendor/assets/javascripts/uikit/components/notify.js +189 -0
  37. data/vendor/assets/javascripts/uikit/components/notify.min.js +2 -0
  38. data/vendor/assets/javascripts/uikit/components/pagination.js +147 -0
  39. data/vendor/assets/javascripts/uikit/components/pagination.min.js +2 -0
  40. data/vendor/assets/javascripts/uikit/components/parallax.js +417 -0
  41. data/vendor/assets/javascripts/uikit/components/parallax.min.js +2 -0
  42. data/vendor/assets/javascripts/uikit/components/search.js +92 -0
  43. data/vendor/assets/javascripts/uikit/components/search.min.js +2 -0
  44. data/vendor/assets/javascripts/uikit/components/slider.js +520 -0
  45. data/vendor/assets/javascripts/uikit/components/slider.min.js +2 -0
  46. data/vendor/assets/javascripts/uikit/components/slideset.js +502 -0
  47. data/vendor/assets/javascripts/uikit/components/slideset.min.js +2 -0
  48. data/vendor/assets/javascripts/uikit/components/slideshow-fx.js +375 -0
  49. data/vendor/assets/javascripts/uikit/components/slideshow-fx.min.js +2 -0
  50. data/vendor/assets/javascripts/uikit/components/slideshow.js +545 -0
  51. data/vendor/assets/javascripts/uikit/components/slideshow.min.js +2 -0
  52. data/vendor/assets/javascripts/uikit/components/sortable.js +664 -0
  53. data/vendor/assets/javascripts/uikit/components/sortable.min.js +2 -0
  54. data/vendor/assets/javascripts/uikit/components/sticky.js +349 -0
  55. data/vendor/assets/javascripts/uikit/components/sticky.min.js +2 -0
  56. data/vendor/assets/javascripts/uikit/components/timepicker.js +192 -0
  57. data/vendor/assets/javascripts/uikit/components/timepicker.min.js +2 -0
  58. data/vendor/assets/javascripts/uikit/components/tooltip.js +234 -0
  59. data/vendor/assets/javascripts/uikit/components/tooltip.min.js +2 -0
  60. data/vendor/assets/javascripts/uikit/components/upload.js +260 -0
  61. data/vendor/assets/javascripts/uikit/components/upload.min.js +2 -0
  62. data/vendor/assets/javascripts/uikit/core/alert.js +66 -0
  63. data/vendor/assets/javascripts/uikit/core/alert.min.js +2 -0
  64. data/vendor/assets/javascripts/uikit/core/button.js +157 -0
  65. data/vendor/assets/javascripts/uikit/core/button.min.js +2 -0
  66. data/vendor/assets/javascripts/uikit/core/core.js +725 -0
  67. data/vendor/assets/javascripts/uikit/core/core.min.js +2 -0
  68. data/vendor/assets/javascripts/uikit/core/cover.js +95 -0
  69. data/vendor/assets/javascripts/uikit/core/cover.min.js +2 -0
  70. data/vendor/assets/javascripts/uikit/core/dropdown.js +421 -0
  71. data/vendor/assets/javascripts/uikit/core/dropdown.min.js +2 -0
  72. data/vendor/assets/javascripts/uikit/core/grid.js +114 -0
  73. data/vendor/assets/javascripts/uikit/core/grid.min.js +2 -0
  74. data/vendor/assets/javascripts/uikit/core/modal.js +372 -0
  75. data/vendor/assets/javascripts/uikit/core/modal.min.js +2 -0
  76. data/vendor/assets/javascripts/uikit/core/nav.js +136 -0
  77. data/vendor/assets/javascripts/uikit/core/nav.min.js +2 -0
  78. data/vendor/assets/javascripts/uikit/core/offcanvas.js +180 -0
  79. data/vendor/assets/javascripts/uikit/core/offcanvas.min.js +2 -0
  80. data/vendor/assets/javascripts/uikit/core/scrollspy.js +208 -0
  81. data/vendor/assets/javascripts/uikit/core/scrollspy.min.js +2 -0
  82. data/vendor/assets/javascripts/uikit/core/smooth-scroll.js +62 -0
  83. data/vendor/assets/javascripts/uikit/core/smooth-scroll.min.js +2 -0
  84. data/vendor/assets/javascripts/uikit/core/switcher.js +304 -0
  85. data/vendor/assets/javascripts/uikit/core/switcher.min.js +2 -0
  86. data/vendor/assets/javascripts/uikit/core/tab.js +165 -0
  87. data/vendor/assets/javascripts/uikit/core/tab.min.js +2 -0
  88. data/vendor/assets/javascripts/uikit/core/toggle.js +120 -0
  89. data/vendor/assets/javascripts/uikit/core/toggle.min.js +2 -0
  90. data/vendor/assets/javascripts/uikit/core/touch.js +173 -0
  91. data/vendor/assets/javascripts/uikit/core/touch.min.js +2 -0
  92. data/vendor/assets/javascripts/uikit/core/utility.js +239 -0
  93. data/vendor/assets/javascripts/uikit/core/utility.min.js +2 -0
  94. data/vendor/assets/stylesheets/uikit.almost-flat.css +8551 -0
  95. data/vendor/assets/stylesheets/uikit.css +8252 -0
  96. data/vendor/assets/stylesheets/uikit.gradient.css +8614 -0
  97. data/vendor/assets/stylesheets/uikit/components/accordion.almost-flat.css +39 -0
  98. data/vendor/assets/stylesheets/uikit/components/accordion.almost-flat.min.css +2 -0
  99. data/vendor/assets/stylesheets/uikit/components/accordion.css +37 -0
  100. data/vendor/assets/stylesheets/uikit/components/accordion.gradient.css +39 -0
  101. data/vendor/assets/stylesheets/uikit/components/accordion.gradient.min.css +2 -0
  102. data/vendor/assets/stylesheets/uikit/components/accordion.min.css +2 -0
  103. data/vendor/assets/stylesheets/uikit/components/autocomplete.almost-flat.css +52 -0
  104. data/vendor/assets/stylesheets/uikit/components/autocomplete.almost-flat.min.css +2 -0
  105. data/vendor/assets/stylesheets/uikit/components/autocomplete.css +50 -0
  106. data/vendor/assets/stylesheets/uikit/components/autocomplete.gradient.css +52 -0
  107. data/vendor/assets/stylesheets/uikit/components/autocomplete.gradient.min.css +2 -0
  108. data/vendor/assets/stylesheets/uikit/components/autocomplete.min.css +2 -0
  109. data/vendor/assets/stylesheets/uikit/components/datepicker.almost-flat.css +129 -0
  110. data/vendor/assets/stylesheets/uikit/components/datepicker.almost-flat.min.css +2 -0
  111. data/vendor/assets/stylesheets/uikit/components/datepicker.css +123 -0
  112. data/vendor/assets/stylesheets/uikit/components/datepicker.gradient.css +139 -0
  113. data/vendor/assets/stylesheets/uikit/components/datepicker.gradient.min.css +2 -0
  114. data/vendor/assets/stylesheets/uikit/components/datepicker.min.css +2 -0
  115. data/vendor/assets/stylesheets/uikit/components/dotnav.almost-flat.css +128 -0
  116. data/vendor/assets/stylesheets/uikit/components/dotnav.almost-flat.min.css +2 -0
  117. data/vendor/assets/stylesheets/uikit/components/dotnav.css +124 -0
  118. data/vendor/assets/stylesheets/uikit/components/dotnav.gradient.css +128 -0
  119. data/vendor/assets/stylesheets/uikit/components/dotnav.gradient.min.css +2 -0
  120. data/vendor/assets/stylesheets/uikit/components/dotnav.min.css +2 -0
  121. data/vendor/assets/stylesheets/uikit/components/form-advanced.almost-flat.css +78 -0
  122. data/vendor/assets/stylesheets/uikit/components/form-advanced.almost-flat.min.css +2 -0
  123. data/vendor/assets/stylesheets/uikit/components/form-advanced.css +78 -0
  124. data/vendor/assets/stylesheets/uikit/components/form-advanced.gradient.css +78 -0
  125. data/vendor/assets/stylesheets/uikit/components/form-advanced.gradient.min.css +2 -0
  126. data/vendor/assets/stylesheets/uikit/components/form-advanced.min.css +2 -0
  127. data/vendor/assets/stylesheets/uikit/components/form-file.almost-flat.css +34 -0
  128. data/vendor/assets/stylesheets/uikit/components/form-file.almost-flat.min.css +2 -0
  129. data/vendor/assets/stylesheets/uikit/components/form-file.css +34 -0
  130. data/vendor/assets/stylesheets/uikit/components/form-file.gradient.css +34 -0
  131. data/vendor/assets/stylesheets/uikit/components/form-file.gradient.min.css +2 -0
  132. data/vendor/assets/stylesheets/uikit/components/form-file.min.css +2 -0
  133. data/vendor/assets/stylesheets/uikit/components/form-password.almost-flat.css +34 -0
  134. data/vendor/assets/stylesheets/uikit/components/form-password.almost-flat.min.css +2 -0
  135. data/vendor/assets/stylesheets/uikit/components/form-password.css +34 -0
  136. data/vendor/assets/stylesheets/uikit/components/form-password.gradient.css +34 -0
  137. data/vendor/assets/stylesheets/uikit/components/form-password.gradient.min.css +2 -0
  138. data/vendor/assets/stylesheets/uikit/components/form-password.min.css +2 -0
  139. data/vendor/assets/stylesheets/uikit/components/form-select.almost-flat.css +35 -0
  140. data/vendor/assets/stylesheets/uikit/components/form-select.almost-flat.min.css +2 -0
  141. data/vendor/assets/stylesheets/uikit/components/form-select.css +35 -0
  142. data/vendor/assets/stylesheets/uikit/components/form-select.gradient.css +35 -0
  143. data/vendor/assets/stylesheets/uikit/components/form-select.gradient.min.css +2 -0
  144. data/vendor/assets/stylesheets/uikit/components/form-select.min.css +2 -0
  145. data/vendor/assets/stylesheets/uikit/components/htmleditor.almost-flat.css +222 -0
  146. data/vendor/assets/stylesheets/uikit/components/htmleditor.almost-flat.min.css +2 -0
  147. data/vendor/assets/stylesheets/uikit/components/htmleditor.css +164 -0
  148. data/vendor/assets/stylesheets/uikit/components/htmleditor.gradient.css +229 -0
  149. data/vendor/assets/stylesheets/uikit/components/htmleditor.gradient.min.css +2 -0
  150. data/vendor/assets/stylesheets/uikit/components/htmleditor.min.css +2 -0
  151. data/vendor/assets/stylesheets/uikit/components/nestable.almost-flat.css +135 -0
  152. data/vendor/assets/stylesheets/uikit/components/nestable.almost-flat.min.css +2 -0
  153. data/vendor/assets/stylesheets/uikit/components/nestable.css +132 -0
  154. data/vendor/assets/stylesheets/uikit/components/nestable.gradient.css +139 -0
  155. data/vendor/assets/stylesheets/uikit/components/nestable.gradient.min.css +2 -0
  156. data/vendor/assets/stylesheets/uikit/components/nestable.min.css +2 -0
  157. data/vendor/assets/stylesheets/uikit/components/notify.almost-flat.css +98 -0
  158. data/vendor/assets/stylesheets/uikit/components/notify.almost-flat.min.css +2 -0
  159. data/vendor/assets/stylesheets/uikit/components/notify.css +92 -0
  160. data/vendor/assets/stylesheets/uikit/components/notify.gradient.css +98 -0
  161. data/vendor/assets/stylesheets/uikit/components/notify.gradient.min.css +2 -0
  162. data/vendor/assets/stylesheets/uikit/components/notify.min.css +2 -0
  163. data/vendor/assets/stylesheets/uikit/components/placeholder.almost-flat.css +29 -0
  164. data/vendor/assets/stylesheets/uikit/components/placeholder.almost-flat.min.css +2 -0
  165. data/vendor/assets/stylesheets/uikit/components/placeholder.css +29 -0
  166. data/vendor/assets/stylesheets/uikit/components/placeholder.gradient.css +29 -0
  167. data/vendor/assets/stylesheets/uikit/components/placeholder.gradient.min.css +2 -0
  168. data/vendor/assets/stylesheets/uikit/components/placeholder.min.css +2 -0
  169. data/vendor/assets/stylesheets/uikit/components/progress.almost-flat.css +104 -0
  170. data/vendor/assets/stylesheets/uikit/components/progress.almost-flat.min.css +2 -0
  171. data/vendor/assets/stylesheets/uikit/components/progress.css +94 -0
  172. data/vendor/assets/stylesheets/uikit/components/progress.gradient.css +112 -0
  173. data/vendor/assets/stylesheets/uikit/components/progress.gradient.min.css +2 -0
  174. data/vendor/assets/stylesheets/uikit/components/progress.min.css +2 -0
  175. data/vendor/assets/stylesheets/uikit/components/search.almost-flat.css +191 -0
  176. data/vendor/assets/stylesheets/uikit/components/search.almost-flat.min.css +2 -0
  177. data/vendor/assets/stylesheets/uikit/components/search.css +189 -0
  178. data/vendor/assets/stylesheets/uikit/components/search.gradient.css +191 -0
  179. data/vendor/assets/stylesheets/uikit/components/search.gradient.min.css +2 -0
  180. data/vendor/assets/stylesheets/uikit/components/search.min.css +2 -0
  181. data/vendor/assets/stylesheets/uikit/components/slidenav.almost-flat.css +98 -0
  182. data/vendor/assets/stylesheets/uikit/components/slidenav.almost-flat.min.css +2 -0
  183. data/vendor/assets/stylesheets/uikit/components/slidenav.css +98 -0
  184. data/vendor/assets/stylesheets/uikit/components/slidenav.gradient.css +98 -0
  185. data/vendor/assets/stylesheets/uikit/components/slidenav.gradient.min.css +2 -0
  186. data/vendor/assets/stylesheets/uikit/components/slidenav.min.css +2 -0
  187. data/vendor/assets/stylesheets/uikit/components/slider.almost-flat.css +85 -0
  188. data/vendor/assets/stylesheets/uikit/components/slider.almost-flat.min.css +2 -0
  189. data/vendor/assets/stylesheets/uikit/components/slider.css +85 -0
  190. data/vendor/assets/stylesheets/uikit/components/slider.gradient.css +85 -0
  191. data/vendor/assets/stylesheets/uikit/components/slider.gradient.min.css +2 -0
  192. data/vendor/assets/stylesheets/uikit/components/slider.min.css +2 -0
  193. data/vendor/assets/stylesheets/uikit/components/slideshow.almost-flat.css +140 -0
  194. data/vendor/assets/stylesheets/uikit/components/slideshow.almost-flat.min.css +2 -0
  195. data/vendor/assets/stylesheets/uikit/components/slideshow.css +140 -0
  196. data/vendor/assets/stylesheets/uikit/components/slideshow.gradient.css +140 -0
  197. data/vendor/assets/stylesheets/uikit/components/slideshow.gradient.min.css +2 -0
  198. data/vendor/assets/stylesheets/uikit/components/slideshow.min.css +2 -0
  199. data/vendor/assets/stylesheets/uikit/components/sortable.almost-flat.css +62 -0
  200. data/vendor/assets/stylesheets/uikit/components/sortable.almost-flat.min.css +2 -0
  201. data/vendor/assets/stylesheets/uikit/components/sortable.css +62 -0
  202. data/vendor/assets/stylesheets/uikit/components/sortable.gradient.css +62 -0
  203. data/vendor/assets/stylesheets/uikit/components/sortable.gradient.min.css +2 -0
  204. data/vendor/assets/stylesheets/uikit/components/sortable.min.css +2 -0
  205. data/vendor/assets/stylesheets/uikit/components/sticky.almost-flat.css +31 -0
  206. data/vendor/assets/stylesheets/uikit/components/sticky.almost-flat.min.css +2 -0
  207. data/vendor/assets/stylesheets/uikit/components/sticky.css +31 -0
  208. data/vendor/assets/stylesheets/uikit/components/sticky.gradient.css +31 -0
  209. data/vendor/assets/stylesheets/uikit/components/sticky.gradient.min.css +2 -0
  210. data/vendor/assets/stylesheets/uikit/components/sticky.min.css +2 -0
  211. data/vendor/assets/stylesheets/uikit/components/tooltip.almost-flat.css +118 -0
  212. data/vendor/assets/stylesheets/uikit/components/tooltip.almost-flat.min.css +2 -0
  213. data/vendor/assets/stylesheets/uikit/components/tooltip.css +116 -0
  214. data/vendor/assets/stylesheets/uikit/components/tooltip.gradient.css +118 -0
  215. data/vendor/assets/stylesheets/uikit/components/tooltip.gradient.min.css +2 -0
  216. data/vendor/assets/stylesheets/uikit/components/tooltip.min.css +2 -0
  217. data/vendor/assets/stylesheets/uikit/components/upload.almost-flat.css +10 -0
  218. data/vendor/assets/stylesheets/uikit/components/upload.almost-flat.min.css +2 -0
  219. data/vendor/assets/stylesheets/uikit/components/upload.css +10 -0
  220. data/vendor/assets/stylesheets/uikit/components/upload.gradient.css +10 -0
  221. data/vendor/assets/stylesheets/uikit/components/upload.gradient.min.css +2 -0
  222. data/vendor/assets/stylesheets/uikit/components/upload.min.css +2 -0
  223. metadata +295 -0
@@ -0,0 +1,2 @@
1
+ /*! UIkit 2.22.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
2
+ !function(t){var s;window.UIkit&&(s=t(UIkit)),"function"==typeof define&&define.amd&&define("uikit-nestable",["uikit"],function(){return s||t(UIkit)})}(function(t){"use strict";var s,e="ontouchstart"in window,i=t.$html,l=[],a=t.$win,n=e?"touchstart":"mousedown",o=e?"touchmove":"mousemove",h=e?"touchend":"mouseup",r=e?"touchcancel":"mouseup";return t.component("nestable",{defaults:{listBaseClass:"uk-nestable",listClass:"uk-nestable-list",listItemClass:"uk-nestable-item",dragClass:"uk-nestable-dragged",movingClass:"uk-nestable-moving",emptyClass:"uk-nestable-empty",handleClass:"",collapsedClass:"uk-collapsed",placeholderClass:"uk-nestable-placeholder",noDragClass:"uk-nestable-nodrag",group:!1,maxDepth:10,threshold:20,idlethreshold:10},boot:function(){t.$html.on("mousemove touchmove",function(){if(s){var e=s.offset().top;e<t.$win.scrollTop()?t.$win.scrollTop(t.$win.scrollTop()-Math.ceil(s.height()/2)):e+s.height()>window.innerHeight+t.$win.scrollTop()&&t.$win.scrollTop(t.$win.scrollTop()+Math.ceil(s.height()/2))}}),t.ready(function(s){t.$("[data-uk-nestable]",s).each(function(){var s=t.$(this);s.data("nestable")||t.nestable(s,t.Utils.options(s.attr("data-uk-nestable")))})})},init:function(){var i=this;Object.keys(this.options).forEach(function(t){-1!=String(t).indexOf("Class")&&(i.options["_"+t]="."+i.options[t])}),this.find(this.options._listItemClass).find(">ul").addClass(this.options.listClass),this.checkEmptyList(),this.reset(),this.element.data("nestable-group",this.options.group||t.Utils.uid("nestable-group")),this.find(this.options._listItemClass).each(function(){i.setParent(t.$(this))}),this.on("click","[data-nestable-action]",function(s){if(!i.dragEl&&(e||0===s.button)){s.preventDefault();var l=t.$(s.currentTarget),a=l.data("nestableAction"),n=l.closest(i.options._listItemClass);"collapse"===a&&i.collapseItem(n),"expand"===a&&i.expandItem(n),"toggle"===a&&i.toggleItem(n)}});var l=function(s){var l=t.$(s.target);s.target!==i.element[0]&&(l.is(i.options._noDragClass)||l.closest(i.options._noDragClass).length||l.is("[data-nestable-action]")||l.closest("[data-nestable-action]").length||(i.options.handleClass&&!l.hasClass(i.options.handleClass)&&i.options.handleClass&&(l=l.closest(i.options._handleClass)),!l.length||i.dragEl||!e&&0!==s.button||e&&1!==s.touches.length||(s.originalEvent&&s.originalEvent.touches&&(s=evt.originalEvent.touches[0]),i.delayMove=function(t){t.preventDefault(),i.dragStart(s),i.trigger("start.uk.nestable",[i]),i.delayMove=!1},i.delayMove.x=parseInt(s.pageX,10),i.delayMove.y=parseInt(s.pageY,10),i.delayMove.threshold=i.options.idlethreshold,s.preventDefault())))},d=function(t){t.originalEvent&&t.originalEvent.touches&&(t=t.originalEvent.touches[0]),i.delayMove&&(Math.abs(t.pageX-i.delayMove.x)>i.delayMove.threshold||Math.abs(t.pageY-i.delayMove.y)>i.delayMove.threshold)&&(window.getSelection().toString()?i.delayMove=!1:i.delayMove(t)),i.dragEl&&(t.preventDefault(),i.dragMove(t),i.trigger("move.uk.nestable",[i]))},p=function(t){i.dragEl&&(t.preventDefault(),i.dragStop(e?t.touches[0]:t)),s=!1,i.delayMove=!1};e?(this.element[0].addEventListener(n,l,!1),window.addEventListener(o,d,!1),window.addEventListener(h,p,!1),window.addEventListener(r,p,!1)):(this.on(n,l),a.on(o,d),a.on(h,p))},serialize:function(){var s,e=0,i=this,l=function(s,e){var a=[],n=s.children(i.options._listItemClass);return n.each(function(){for(var s,n=t.$(this),o={},h=n.children(i.options._listClass),r=0;r<n[0].attributes.length;r++)s=n[0].attributes[r],0===s.name.indexOf("data-")&&(o[s.name.substr(5)]=t.Utils.str2json(s.value));h.length&&(o.children=l(h,e+1)),a.push(o)}),a};return s=l(i.element,e)},list:function(s){var e=[],i=this,l=0,a=function(i,l,n){var o=i.children(s._listItemClass);o.each(function(i){var o=t.$(this),h=t.$.extend({parent_id:n?n:null,depth:l,order:i},o.data()),r=o.children(s._listClass);e.push(h),r.length&&a(r,l+1,o.data(s.idProperty||"id"))})};return s=t.$.extend({},i.options,s),a(i.element,l),e},reset:function(){this.mouse={offsetX:0,offsetY:0,startX:0,startY:0,lastX:0,lastY:0,nowX:0,nowY:0,distX:0,distY:0,dirAx:0,dirX:0,dirY:0,lastDirX:0,lastDirY:0,distAxX:0,distAxY:0},this.moving=!1,this.dragEl=null,this.dragRootEl=null,this.dragDepth=0,this.hasNewRoot=!1,this.pointEl=null;for(var t=0;t<l.length;t++)this.checkEmptyList(l[t]);l=[]},toggleItem:function(t){this[t.hasClass(this.options.collapsedClass)?"expandItem":"collapseItem"](t)},expandItem:function(t){t.removeClass(this.options.collapsedClass)},collapseItem:function(t){var s=t.children(this.options._listClass);s.length&&t.addClass(this.options.collapsedClass)},expandAll:function(){var s=this;this.find(s.options._listItemClass).each(function(){s.expandItem(t.$(this))})},collapseAll:function(){var s=this;this.find(s.options._listItemClass).each(function(){s.collapseItem(t.$(this))})},setParent:function(t){t.children(this.options._listClass).length&&t.addClass("uk-parent")},unsetParent:function(t){t.removeClass("uk-parent "+this.options.collapsedClass),t.children(this.options._listClass).remove()},dragStart:function(e){var l=this.mouse,a=t.$(e.target),n=a.closest(this.options._listItemClass),o=n.offset();this.placeEl=n,l.offsetX=e.pageX-o.left,l.offsetY=e.pageY-o.top,l.startX=l.lastX=o.left,l.startY=l.lastY=o.top,this.dragRootEl=this.element,this.dragEl=t.$("<ul></ul>").addClass(this.options.listClass+" "+this.options.dragClass).append(n.clone()),this.dragEl.css("width",n.width()),this.placeEl.addClass(this.options.placeholderClass),s=this.dragEl,this.tmpDragOnSiblings=[n[0].previousSibling,n[0].nextSibling],t.$body.append(this.dragEl),this.dragEl.css({left:o.left,top:o.top});var h,r,d=this.dragEl.find(this.options._listItemClass);for(h=0;h<d.length;h++)r=t.$(d[h]).parents(this.options._listClass+","+this.options._listBaseClass).length,r>this.dragDepth&&(this.dragDepth=r);i.addClass(this.options.movingClass)},dragStop:function(){var s=t.$(this.placeEl),e=this.placeEl.parents(this.options._listBaseClass+":first");this.placeEl.removeClass(this.options.placeholderClass),this.dragEl.remove(),this.element[0]!==e[0]?(e.trigger("change.uk.nestable",[e.data("nestable"),s,"added"]),this.element.trigger("change.uk.nestable",[this,s,"removed"])):this.element.trigger("change.uk.nestable",[this,s,"moved"]),this.trigger("stop.uk.nestable",[this,s]),this.reset(),i.removeClass(this.options.movingClass)},dragMove:function(s){var e,i,a,n,o,h=this.options,r=this.mouse,d=this.dragRootEl?this.dragRootEl.data("nestable").options.maxDepth:h.maxDepth;this.dragEl.css({left:s.pageX-r.offsetX,top:s.pageY-r.offsetY}),r.lastX=r.nowX,r.lastY=r.nowY,r.nowX=s.pageX,r.nowY=s.pageY,r.distX=r.nowX-r.lastX,r.distY=r.nowY-r.lastY,r.lastDirX=r.dirX,r.lastDirY=r.dirY,r.dirX=0===r.distX?0:r.distX>0?1:-1,r.dirY=0===r.distY?0:r.distY>0?1:-1;var p=Math.abs(r.distX)>Math.abs(r.distY)?1:0;if(!r.moving)return r.dirAx=p,r.moving=!0,void 0;if(r.dirAx!==p?(r.distAxX=0,r.distAxY=0):(r.distAxX+=Math.abs(r.distX),0!==r.dirX&&r.dirX!==r.lastDirX&&(r.distAxX=0),r.distAxY+=Math.abs(r.distY),0!==r.dirY&&r.dirY!==r.lastDirY&&(r.distAxY=0)),r.dirAx=p,r.dirAx&&r.distAxX>=h.threshold&&(r.distAxX=0,a=this.placeEl.prev("li"),r.distX>0&&a.length&&!a.hasClass(h.collapsedClass)&&(e=a.find(h._listClass).last(),o=this.placeEl.parents(h._listClass+","+h._listBaseClass).length,o+this.dragDepth<=d&&(e.length?(e=a.children(h._listClass).last(),e.append(this.placeEl)):(e=t.$("<ul/>").addClass(h.listClass),e.append(this.placeEl),a.append(e),this.setParent(a)))),r.distX<0&&(n=this.placeEl.next(h._listItemClass),!n.length))){var c=this.placeEl.closest([h._listBaseClass,h._listClass].join(",")),g=c.closest(h._listItemClass);g.length&&(g.after(this.placeEl),c.children().length||this.unsetParent(g))}var u=!1,f=s.pageX-(window.pageXOffset||document.scrollLeft||0),m=s.pageY-(window.pageYOffset||document.documentElement.scrollTop);if(this.pointEl=t.$(document.elementFromPoint(f,m)),h.handleClass&&this.pointEl.hasClass(h.handleClass))this.pointEl=this.pointEl.closest(h._listItemClass);else{var v=this.pointEl.closest(h._listItemClass);v.length&&(this.pointEl=v)}if(!this.placeEl.find(this.pointEl).length){if(this.pointEl.data("nestable")&&!this.pointEl.children().length)u=!0,this.checkEmptyList(this.pointEl);else if(!this.pointEl.length||!this.pointEl.hasClass(h.listItemClass))return;var C=this.element,E=this.pointEl.closest(this.options._listBaseClass),b=C[0]!=E[0];if(!r.dirAx||b||u){if(b&&h.group!==E.data("nestable-group"))return;if(l.push(C),o=this.dragDepth-1+this.pointEl.parents(h._listClass+","+h._listBaseClass).length,o>d)return;var X=s.pageY<this.pointEl.offset().top+this.pointEl.height()/2;i=this.placeEl.parent(),u?this.pointEl.append(this.placeEl):X?this.pointEl.before(this.placeEl):this.pointEl.after(this.placeEl),i.children().length||i.data("nestable")||this.unsetParent(i.parent()),this.checkEmptyList(this.dragRootEl),this.checkEmptyList(C),b&&(this.dragRootEl=E,this.hasNewRoot=this.element[0]!==this.dragRootEl[0])}}},checkEmptyList:function(s){s=s?t.$(s):this.element,this.options.emptyClass&&s[s.children().length?"removeClass":"addClass"](this.options.emptyClass)}}),t.nestable});
@@ -0,0 +1,189 @@
1
+ /*! UIkit 2.22.0 | 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-notify", ["uikit"], function(){
12
+ return component || addon(UIkit);
13
+ });
14
+ }
15
+
16
+ })(function(UI){
17
+
18
+ "use strict";
19
+
20
+ var containers = {},
21
+ messages = {},
22
+
23
+ notify = function(options){
24
+
25
+ if (UI.$.type(options) == 'string') {
26
+ options = { message: options };
27
+ }
28
+
29
+ if (arguments[1]) {
30
+ options = UI.$.extend(options, UI.$.type(arguments[1]) == 'string' ? {status:arguments[1]} : arguments[1]);
31
+ }
32
+
33
+ return (new Message(options)).show();
34
+ },
35
+ closeAll = function(group, instantly){
36
+
37
+ var id;
38
+
39
+ if (group) {
40
+ for(id in messages) { if(group===messages[id].group) messages[id].close(instantly); }
41
+ } else {
42
+ for(id in messages) { messages[id].close(instantly); }
43
+ }
44
+ };
45
+
46
+ var Message = function(options){
47
+
48
+ this.options = UI.$.extend({}, Message.defaults, options);
49
+
50
+ this.uuid = UI.Utils.uid("notifymsg");
51
+ this.element = UI.$([
52
+
53
+ '<div class="uk-notify-message">',
54
+ '<a class="uk-close"></a>',
55
+ '<div></div>',
56
+ '</div>'
57
+
58
+ ].join('')).data("notifyMessage", this);
59
+
60
+ this.content(this.options.message);
61
+
62
+ // status
63
+ if (this.options.status) {
64
+ this.element.addClass('uk-notify-message-'+this.options.status);
65
+ this.currentstatus = this.options.status;
66
+ }
67
+
68
+ this.group = this.options.group;
69
+
70
+ messages[this.uuid] = this;
71
+
72
+ if(!containers[this.options.pos]) {
73
+ containers[this.options.pos] = UI.$('<div class="uk-notify uk-notify-'+this.options.pos+'"></div>').appendTo('body').on("click", ".uk-notify-message", function(){
74
+
75
+ var message = UI.$(this).data("notifyMessage");
76
+
77
+ message.element.trigger('manualclose.uk.notify', [message]);
78
+ message.close();
79
+ });
80
+ }
81
+ };
82
+
83
+
84
+ UI.$.extend(Message.prototype, {
85
+
86
+ uuid: false,
87
+ element: false,
88
+ timout: false,
89
+ currentstatus: "",
90
+ group: false,
91
+
92
+ show: function() {
93
+
94
+ if (this.element.is(":visible")) return;
95
+
96
+ var $this = this;
97
+
98
+ containers[this.options.pos].show().prepend(this.element);
99
+
100
+ var marginbottom = parseInt(this.element.css("margin-bottom"), 10);
101
+
102
+ this.element.css({"opacity":0, "margin-top": -1*this.element.outerHeight(), "margin-bottom":0}).animate({"opacity":1, "margin-top": 0, "margin-bottom":marginbottom}, function(){
103
+
104
+ if ($this.options.timeout) {
105
+
106
+ var closefn = function(){ $this.close(); };
107
+
108
+ $this.timeout = setTimeout(closefn, $this.options.timeout);
109
+
110
+ $this.element.hover(
111
+ function() { clearTimeout($this.timeout); },
112
+ function() { $this.timeout = setTimeout(closefn, $this.options.timeout); }
113
+ );
114
+ }
115
+
116
+ });
117
+
118
+ return this;
119
+ },
120
+
121
+ close: function(instantly) {
122
+
123
+ var $this = this,
124
+ finalize = function(){
125
+ $this.element.remove();
126
+
127
+ if (!containers[$this.options.pos].children().length) {
128
+ containers[$this.options.pos].hide();
129
+ }
130
+
131
+ $this.options.onClose.apply($this, []);
132
+ $this.element.trigger('close.uk.notify', [$this]);
133
+
134
+ delete messages[$this.uuid];
135
+ };
136
+
137
+ if (this.timeout) clearTimeout(this.timeout);
138
+
139
+ if (instantly) {
140
+ finalize();
141
+ } else {
142
+ this.element.animate({"opacity":0, "margin-top": -1* this.element.outerHeight(), "margin-bottom":0}, function(){
143
+ finalize();
144
+ });
145
+ }
146
+ },
147
+
148
+ content: function(html){
149
+
150
+ var container = this.element.find(">div");
151
+
152
+ if(!html) {
153
+ return container.html();
154
+ }
155
+
156
+ container.html(html);
157
+
158
+ return this;
159
+ },
160
+
161
+ status: function(status) {
162
+
163
+ if (!status) {
164
+ return this.currentstatus;
165
+ }
166
+
167
+ this.element.removeClass('uk-notify-message-'+this.currentstatus).addClass('uk-notify-message-'+status);
168
+
169
+ this.currentstatus = status;
170
+
171
+ return this;
172
+ }
173
+ });
174
+
175
+ Message.defaults = {
176
+ message: "",
177
+ status: "",
178
+ timeout: 5000,
179
+ group: null,
180
+ pos: 'top-center',
181
+ onClose: function() {}
182
+ };
183
+
184
+ UI.notify = notify;
185
+ UI.notify.message = Message;
186
+ UI.notify.closeAll = closeAll;
187
+
188
+ return notify;
189
+ });
@@ -0,0 +1,2 @@
1
+ /*! UIkit 2.22.0 | 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-notify",["uikit"],function(){return e||t(UIkit)})}(function(t){"use strict";var e={},i={},s=function(e){return"string"==t.$.type(e)&&(e={message:e}),arguments[1]&&(e=t.$.extend(e,"string"==t.$.type(arguments[1])?{status:arguments[1]}:arguments[1])),new n(e).show()},o=function(t,e){var s;if(t)for(s in i)t===i[s].group&&i[s].close(e);else for(s in i)i[s].close(e)},n=function(s){this.options=t.$.extend({},n.defaults,s),this.uuid=t.Utils.uid("notifymsg"),this.element=t.$(['<div class="uk-notify-message">','<a class="uk-close"></a>',"<div></div>","</div>"].join("")).data("notifyMessage",this),this.content(this.options.message),this.options.status&&(this.element.addClass("uk-notify-message-"+this.options.status),this.currentstatus=this.options.status),this.group=this.options.group,i[this.uuid]=this,e[this.options.pos]||(e[this.options.pos]=t.$('<div class="uk-notify uk-notify-'+this.options.pos+'"></div>').appendTo("body").on("click",".uk-notify-message",function(){var e=t.$(this).data("notifyMessage");e.element.trigger("manualclose.uk.notify",[e]),e.close()}))};return t.$.extend(n.prototype,{uuid:!1,element:!1,timout:!1,currentstatus:"",group:!1,show:function(){if(!this.element.is(":visible")){var t=this;e[this.options.pos].show().prepend(this.element);var i=parseInt(this.element.css("margin-bottom"),10);return this.element.css({opacity:0,"margin-top":-1*this.element.outerHeight(),"margin-bottom":0}).animate({opacity:1,"margin-top":0,"margin-bottom":i},function(){if(t.options.timeout){var e=function(){t.close()};t.timeout=setTimeout(e,t.options.timeout),t.element.hover(function(){clearTimeout(t.timeout)},function(){t.timeout=setTimeout(e,t.options.timeout)})}}),this}},close:function(t){var s=this,o=function(){s.element.remove(),e[s.options.pos].children().length||e[s.options.pos].hide(),s.options.onClose.apply(s,[]),s.element.trigger("close.uk.notify",[s]),delete i[s.uuid]};this.timeout&&clearTimeout(this.timeout),t?o():this.element.animate({opacity:0,"margin-top":-1*this.element.outerHeight(),"margin-bottom":0},function(){o()})},content:function(t){var e=this.element.find(">div");return t?(e.html(t),this):e.html()},status:function(t){return t?(this.element.removeClass("uk-notify-message-"+this.currentstatus).addClass("uk-notify-message-"+t),this.currentstatus=t,this):this.currentstatus}}),n.defaults={message:"",status:"",timeout:5e3,group:null,pos:"top-center",onClose:function(){}},t.notify=s,t.notify.message=n,t.notify.closeAll=o,s});
@@ -0,0 +1,147 @@
1
+ /*! UIkit 2.22.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
2
+ /*
3
+ * Based on simplePagination - Copyright (c) 2012 Flavius Matis - http://flaviusmatis.github.com/simplePagination.js/ (MIT)
4
+ */
5
+ (function(addon) {
6
+
7
+ var component;
8
+
9
+ if (window.UIkit) {
10
+ component = addon(UIkit);
11
+ }
12
+
13
+ if (typeof define == "function" && define.amd) {
14
+ define("uikit-pagination", ["uikit"], function(){
15
+ return component || addon(UIkit);
16
+ });
17
+ }
18
+
19
+ })(function(UI){
20
+
21
+ "use strict";
22
+
23
+ UI.component('pagination', {
24
+
25
+ defaults: {
26
+ items : 1,
27
+ itemsOnPage : 1,
28
+ pages : 0,
29
+ displayedPages : 3,
30
+ edges : 3,
31
+ currentPage : 0,
32
+ lblPrev : false,
33
+ lblNext : false,
34
+ onSelectPage : function() {}
35
+ },
36
+
37
+ boot: function() {
38
+
39
+ // init code
40
+ UI.ready(function(context) {
41
+
42
+ UI.$("[data-uk-pagination]", context).each(function(){
43
+ var ele = UI.$(this);
44
+
45
+ if (!ele.data("pagination")) {
46
+ UI.pagination(ele, UI.Utils.options(ele.attr("data-uk-pagination")));
47
+ }
48
+ });
49
+ });
50
+ },
51
+
52
+ init: function() {
53
+
54
+ var $this = this;
55
+
56
+ this.pages = this.options.pages ? this.options.pages : Math.ceil(this.options.items / this.options.itemsOnPage) ? Math.ceil(this.options.items / this.options.itemsOnPage) : 1;
57
+ this.currentPage = this.options.currentPage;
58
+ this.halfDisplayed = this.options.displayedPages / 2;
59
+
60
+ this.on("click", "a[data-page]", function(e){
61
+ e.preventDefault();
62
+ $this.selectPage(UI.$(this).data("page"));
63
+ });
64
+
65
+ this._render();
66
+ },
67
+
68
+ _getInterval: function() {
69
+
70
+ return {
71
+ start: Math.ceil(this.currentPage > this.halfDisplayed ? Math.max(Math.min(this.currentPage - this.halfDisplayed, (this.pages - this.options.displayedPages)), 0) : 0),
72
+ end : Math.ceil(this.currentPage > this.halfDisplayed ? Math.min(this.currentPage + this.halfDisplayed, this.pages) : Math.min(this.options.displayedPages, this.pages))
73
+ };
74
+ },
75
+
76
+ render: function(pages) {
77
+ this.pages = pages ? pages : this.pages;
78
+ this._render();
79
+ },
80
+
81
+ selectPage: function(pageIndex, pages) {
82
+ this.currentPage = pageIndex;
83
+ this.render(pages);
84
+
85
+ this.options.onSelectPage.apply(this, [pageIndex]);
86
+ this.trigger('select.uk.pagination', [pageIndex, this]);
87
+ },
88
+
89
+ _render: function() {
90
+
91
+ var o = this.options, interval = this._getInterval(), i;
92
+
93
+ this.element.empty();
94
+
95
+ // Generate Prev link
96
+ if (o.lblPrev) this._append(o.currentPage - 1, {text: o.lblPrev});
97
+
98
+ // Generate start edges
99
+ if (interval.start > 0 && o.edges > 0) {
100
+
101
+ var end = Math.min(o.edges, interval.start);
102
+
103
+ for (i = 0; i < end; i++) this._append(i);
104
+
105
+ if (o.edges < interval.start && (interval.start - o.edges != 1)) {
106
+ this.element.append('<li><span>...</span></li>');
107
+ } else if (interval.start - o.edges == 1) {
108
+ this._append(o.edges);
109
+ }
110
+ }
111
+
112
+ // Generate interval links
113
+ for (i = interval.start; i < interval.end; i++) this._append(i);
114
+
115
+ // Generate end edges
116
+ if (interval.end < this.pages && o.edges > 0) {
117
+
118
+ if (this.pages - o.edges > interval.end && (this.pages - o.edges - interval.end != 1)) {
119
+ this.element.append('<li><span>...</span></li>');
120
+ } else if (this.pages - o.edges - interval.end == 1) {
121
+ this._append(interval.end++);
122
+ }
123
+
124
+ var begin = Math.max(this.pages - o.edges, interval.end);
125
+
126
+ for (i = begin; i < this.pages; i++) this._append(i);
127
+ }
128
+
129
+ // Generate Next link (unless option is set for at front)
130
+ if (o.lblNext) this._append(o.currentPage + 1, {text: o.lblNext});
131
+ },
132
+
133
+ _append: function(pageIndex, opts) {
134
+
135
+ var item, options;
136
+
137
+ pageIndex = pageIndex < 0 ? 0 : (pageIndex < this.pages ? pageIndex : this.pages - 1);
138
+ options = UI.$.extend({ text: pageIndex + 1 }, opts);
139
+
140
+ item = (pageIndex == this.currentPage) ? '<li class="uk-active"><span>' + (options.text) + '</span></li>' : '<li><a href="#page-'+(pageIndex+1)+'" data-page="'+pageIndex+'">'+options.text+'</a></li>';
141
+
142
+ this.element.append(item);
143
+ }
144
+ });
145
+
146
+ return UI.pagination;
147
+ });
@@ -0,0 +1,2 @@
1
+ /*! UIkit 2.22.0 | 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-pagination",["uikit"],function(){return e||t(UIkit)})}(function(t){"use strict";return t.component("pagination",{defaults:{items:1,itemsOnPage:1,pages:0,displayedPages:3,edges:3,currentPage:0,lblPrev:!1,lblNext:!1,onSelectPage:function(){}},boot:function(){t.ready(function(e){t.$("[data-uk-pagination]",e).each(function(){var e=t.$(this);e.data("pagination")||t.pagination(e,t.Utils.options(e.attr("data-uk-pagination")))})})},init:function(){var e=this;this.pages=this.options.pages?this.options.pages:Math.ceil(this.options.items/this.options.itemsOnPage)?Math.ceil(this.options.items/this.options.itemsOnPage):1,this.currentPage=this.options.currentPage,this.halfDisplayed=this.options.displayedPages/2,this.on("click","a[data-page]",function(i){i.preventDefault(),e.selectPage(t.$(this).data("page"))}),this._render()},_getInterval:function(){return{start:Math.ceil(this.currentPage>this.halfDisplayed?Math.max(Math.min(this.currentPage-this.halfDisplayed,this.pages-this.options.displayedPages),0):0),end:Math.ceil(this.currentPage>this.halfDisplayed?Math.min(this.currentPage+this.halfDisplayed,this.pages):Math.min(this.options.displayedPages,this.pages))}},render:function(t){this.pages=t?t:this.pages,this._render()},selectPage:function(t,e){this.currentPage=t,this.render(e),this.options.onSelectPage.apply(this,[t]),this.trigger("select.uk.pagination",[t,this])},_render:function(){var t,e=this.options,i=this._getInterval();if(this.element.empty(),e.lblPrev&&this._append(e.currentPage-1,{text:e.lblPrev}),i.start>0&&e.edges>0){var s=Math.min(e.edges,i.start);for(t=0;s>t;t++)this._append(t);e.edges<i.start&&i.start-e.edges!=1?this.element.append("<li><span>...</span></li>"):i.start-e.edges==1&&this._append(e.edges)}for(t=i.start;t<i.end;t++)this._append(t);if(i.end<this.pages&&e.edges>0){this.pages-e.edges>i.end&&this.pages-e.edges-i.end!=1?this.element.append("<li><span>...</span></li>"):this.pages-e.edges-i.end==1&&this._append(i.end++);var a=Math.max(this.pages-e.edges,i.end);for(t=a;t<this.pages;t++)this._append(t)}e.lblNext&&this._append(e.currentPage+1,{text:e.lblNext})},_append:function(e,i){var s,a;e=0>e?0:e<this.pages?e:this.pages-1,a=t.$.extend({text:e+1},i),s=e==this.currentPage?'<li class="uk-active"><span>'+a.text+"</span></li>":'<li><a href="#page-'+(e+1)+'" data-page="'+e+'">'+a.text+"</a></li>",this.element.append(s)}}),t.pagination});
@@ -0,0 +1,417 @@
1
+ /*! UIkit 2.22.0 | 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-parallax", ["uikit"], function(){
12
+ return component || addon(UIkit);
13
+ });
14
+ }
15
+
16
+ })(function(UI){
17
+
18
+ "use strict";
19
+
20
+ var parallaxes = [],
21
+ supports3d = false,
22
+ scrolltop = 0,
23
+ wh = window.innerHeight,
24
+ checkParallaxes = function() {
25
+
26
+ scrolltop = UI.$win.scrollTop();
27
+
28
+ window.requestAnimationFrame.apply(window, [function(){
29
+ for (var i=0; i < parallaxes.length; i++) {
30
+ parallaxes[i].process();
31
+ }
32
+ }]);
33
+ };
34
+
35
+
36
+ UI.component('parallax', {
37
+
38
+ defaults: {
39
+ velocity : 0.5,
40
+ target : false,
41
+ viewport : false,
42
+ media : false
43
+ },
44
+
45
+ boot: function() {
46
+
47
+ supports3d = (function(){
48
+
49
+ var el = document.createElement('div'),
50
+ has3d,
51
+ transforms = {
52
+ 'WebkitTransform':'-webkit-transform',
53
+ 'MSTransform':'-ms-transform',
54
+ 'MozTransform':'-moz-transform',
55
+ 'Transform':'transform'
56
+ };
57
+
58
+ // Add it to the body to get the computed style.
59
+ document.body.insertBefore(el, null);
60
+
61
+ for (var t in transforms) {
62
+ if (el.style[t] !== undefined) {
63
+ el.style[t] = "translate3d(1px,1px,1px)";
64
+ has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]);
65
+ }
66
+ }
67
+
68
+ document.body.removeChild(el);
69
+
70
+ return (has3d !== undefined && has3d.length > 0 && has3d !== "none");
71
+ })();
72
+
73
+ // listen to scroll and resize
74
+ UI.$doc.on("scrolling.uk.document", checkParallaxes);
75
+ UI.$win.on("load resize orientationchange", UI.Utils.debounce(function(){
76
+ wh = window.innerHeight;
77
+ checkParallaxes();
78
+ }, 50));
79
+
80
+ // init code
81
+ UI.ready(function(context) {
82
+
83
+ UI.$('[data-uk-parallax]', context).each(function() {
84
+
85
+ var parallax = UI.$(this);
86
+
87
+ if (!parallax.data("parallax")) {
88
+ UI.parallax(parallax, UI.Utils.options(parallax.attr("data-uk-parallax")));
89
+ }
90
+ });
91
+ });
92
+ },
93
+
94
+ init: function() {
95
+
96
+ this.base = this.options.target ? UI.$(this.options.target) : this.element;
97
+ this.props = {};
98
+ this.velocity = (this.options.velocity || 1);
99
+
100
+ var reserved = ['target','velocity','viewport','plugins','media'];
101
+
102
+ Object.keys(this.options).forEach(function(prop){
103
+
104
+ if (reserved.indexOf(prop) !== -1) {
105
+ return;
106
+ }
107
+
108
+ var start, end, dir, diff, startend = String(this.options[prop]).split(',');
109
+
110
+ if (prop.match(/color/i)) {
111
+ start = startend[1] ? startend[0] : this._getStartValue(prop),
112
+ end = startend[1] ? startend[1] : startend[0];
113
+
114
+ if (!start) {
115
+ start = 'rgba(255,255,255,0)';
116
+ }
117
+
118
+ } else {
119
+ start = parseFloat(startend[1] ? startend[0] : this._getStartValue(prop)),
120
+ end = parseFloat(startend[1] ? startend[1] : startend[0]);
121
+ diff = (start < end ? (end-start):(start-end));
122
+ dir = (start < end ? 1:-1);
123
+ }
124
+
125
+ this.props[prop] = { 'start': start, 'end': end, 'dir': dir, 'diff': diff };
126
+
127
+ }.bind(this));
128
+
129
+ parallaxes.push(this);
130
+ },
131
+
132
+ process: function() {
133
+
134
+ if (this.options.media) {
135
+
136
+ switch(typeof(this.options.media)) {
137
+ case 'number':
138
+ if (window.innerWidth < this.options.media) {
139
+ return false;
140
+ }
141
+ break;
142
+ case 'string':
143
+ if (window.matchMedia && !window.matchMedia(this.options.media).matches) {
144
+ return false;
145
+ }
146
+ break;
147
+ }
148
+ }
149
+
150
+ var percent = this.percentageInViewport();
151
+
152
+ if (this.options.viewport !== false) {
153
+ percent = (this.options.viewport === 0) ? 1 : percent / this.options.viewport;
154
+ }
155
+
156
+ this.update(percent);
157
+ },
158
+
159
+ percentageInViewport: function() {
160
+
161
+ var top = this.base.offset().top,
162
+ height = this.base.outerHeight(),
163
+ distance, percentage, percent;
164
+
165
+ if (top > (scrolltop + wh)) {
166
+ percent = 0;
167
+ } else if ((top + height) < scrolltop) {
168
+ percent = 1;
169
+ } else {
170
+
171
+ if ((top + height) < wh) {
172
+
173
+ percent = (scrolltop < wh ? scrolltop : scrolltop - wh) / (top+height);
174
+
175
+ } else {
176
+
177
+ distance = (scrolltop + wh) - top;
178
+ percentage = Math.round(distance / ((wh + height) / 100));
179
+ percent = percentage/100;
180
+ }
181
+ }
182
+
183
+ return percent;
184
+ },
185
+
186
+ update: function(percent) {
187
+
188
+ var css = {'transform':''},
189
+ compercent = percent * (1 - (this.velocity - (this.velocity * percent))),
190
+ opts, val;
191
+
192
+ if (compercent < 0) compercent = 0;
193
+ if (compercent > 1) compercent = 1;
194
+
195
+ if (this._percent !== undefined && this._percent == compercent) {
196
+ return;
197
+ }
198
+
199
+ Object.keys(this.props).forEach(function(prop) {
200
+
201
+ opts = this.props[prop];
202
+
203
+ if (percent === 0) {
204
+ val = opts.start;
205
+ } else if(percent === 1) {
206
+ val = opts.end;
207
+ } else if(opts.diff !== undefined) {
208
+ val = opts.start + (opts.diff * compercent * opts.dir);
209
+ }
210
+
211
+ if ((prop == 'bg' || prop == 'bgp') && !this._bgcover) {
212
+ this._bgcover = initBgImageParallax(this, prop, opts);
213
+ }
214
+
215
+ switch(prop) {
216
+
217
+ // transforms
218
+ case "x":
219
+ css.transform += supports3d ? ' translate3d('+val+'px, 0, 0)':' translateX('+val+'px)';
220
+ break;
221
+ case "xp":
222
+ css.transform += supports3d ? ' translate3d('+val+'%, 0, 0)':' translateX('+val+'%)';
223
+ break;
224
+ case "y":
225
+ css.transform += supports3d ? ' translate3d(0, '+val+'px, 0)':' translateY('+val+'px)';
226
+ break;
227
+ case "yp":
228
+ css.transform += supports3d ? ' translate3d(0, '+val+'%, 0)':' translateY('+val+'%)';
229
+ break;
230
+ case "rotate":
231
+ css.transform += ' rotate('+val+'deg)';
232
+ break;
233
+ case "scale":
234
+ css.transform += ' scale('+val+')';
235
+ break;
236
+
237
+ // bg image
238
+ case "bg":
239
+ css['background-position'] = '50% '+val+'px';
240
+ break;
241
+ case "bgp":
242
+ css['background-position'] = '50% '+val+'%';
243
+ break;
244
+
245
+ // color
246
+ case "color":
247
+ case "background-color":
248
+ case "border-color":
249
+ css[prop] = calcColor(opts.start, opts.end, compercent);
250
+ break;
251
+
252
+ default:
253
+ css[prop] = val;
254
+ break;
255
+ }
256
+
257
+ }.bind(this));
258
+
259
+ this.element.css(css);
260
+
261
+ this._percent = compercent;
262
+ },
263
+
264
+ _getStartValue: function(prop) {
265
+
266
+ var value = 0;
267
+
268
+ switch(prop) {
269
+ case 'scale':
270
+ value = 1;
271
+ break;
272
+ default:
273
+ value = this.element.css(prop);
274
+ }
275
+
276
+ return (value || 0);
277
+ }
278
+
279
+ });
280
+
281
+
282
+ // helper
283
+
284
+ function initBgImageParallax(obj, prop, opts) {
285
+
286
+ var img = new Image(), url, element, size, check, ratio, width, height;
287
+
288
+ element = obj.element.css({'background-size': 'cover', 'background-repeat': 'no-repeat'});
289
+ url = element.css('background-image').replace(/^url\(/g, '').replace(/\)$/g, '').replace(/("|')/g, '');
290
+ check = function() {
291
+
292
+ var w = element.width(), h = element.height(), extra = (prop=='bg') ? opts.diff : (opts.diff/100) * h;
293
+
294
+ h += extra;
295
+ w += Math.ceil(extra * ratio);
296
+
297
+ // if element height < parent height (gap underneath)
298
+ if ((w / ratio) < h) {
299
+ width = Math.ceil(h * ratio);
300
+ height = h;
301
+
302
+ // element width < parent width (gap to right)
303
+ } else {
304
+ width = w;
305
+ height = Math.ceil(w / ratio);
306
+ }
307
+
308
+ obj.element.css({'background-size': (width+'px '+height+'px')});
309
+ };
310
+
311
+ img.onerror = function(){
312
+ // image url doesn't exist
313
+ };
314
+
315
+ img.onload = function(){
316
+ size = {w:img.width, height:img.height};
317
+ ratio = img.width / img.height;
318
+
319
+ UI.$win.on("load resize orientationchange", UI.Utils.debounce(function(){
320
+ check();
321
+ }, 50));
322
+
323
+ check();
324
+ };
325
+
326
+ img.src = url;
327
+
328
+ return true;
329
+ }
330
+
331
+
332
+ // Some named colors to work with, added by Bradley Ayers
333
+ // From Interface by Stefan Petre
334
+ // http://interface.eyecon.ro/
335
+ var colors = {
336
+ 'black': [0,0,0,1],
337
+ 'blue': [0,0,255,1],
338
+ 'brown': [165,42,42,1],
339
+ 'cyan': [0,255,255,1],
340
+ 'fuchsia': [255,0,255,1],
341
+ 'gold': [255,215,0,1],
342
+ 'green': [0,128,0,1],
343
+ 'indigo': [75,0,130,1],
344
+ 'khaki': [240,230,140,1],
345
+ 'lime': [0,255,0,1],
346
+ 'magenta': [255,0,255,1],
347
+ 'maroon': [128,0,0,1],
348
+ 'navy': [0,0,128,1],
349
+ 'olive': [128,128,0,1],
350
+ 'orange': [255,165,0,1],
351
+ 'pink': [255,192,203,1],
352
+ 'purple': [128,0,128,1],
353
+ 'violet': [128,0,128,1],
354
+ 'red': [255,0,0,1],
355
+ 'silver': [192,192,192,1],
356
+ 'white': [255,255,255,1],
357
+ 'yellow': [255,255,0,1],
358
+ 'transparent': [255,255,255,0]
359
+ };
360
+
361
+ function calcColor(start, end, pos) {
362
+
363
+ start = parseColor(start);
364
+ end = parseColor(end);
365
+ pos = pos || 0;
366
+
367
+ return calculateColor(start, end, pos);
368
+ }
369
+
370
+ /**!
371
+ * @preserve Color animation 1.6.0
372
+ * http://www.bitstorm.org/jquery/color-animation/
373
+ * Copyright 2011, 2013 Edwin Martin <edwin@bitstorm.org>
374
+ * Released under the MIT and GPL licenses.
375
+ */
376
+
377
+ // Calculate an in-between color. Returns "#aabbcc"-like string.
378
+ function calculateColor(begin, end, pos) {
379
+ var color = 'rgba('
380
+ + parseInt((begin[0] + pos * (end[0] - begin[0])), 10) + ','
381
+ + parseInt((begin[1] + pos * (end[1] - begin[1])), 10) + ','
382
+ + parseInt((begin[2] + pos * (end[2] - begin[2])), 10) + ','
383
+ + (begin && end ? parseFloat(begin[3] + pos * (end[3] - begin[3])) : 1);
384
+
385
+ color += ')';
386
+ return color;
387
+ }
388
+
389
+ // Parse an CSS-syntax color. Outputs an array [r, g, b]
390
+ function parseColor(color) {
391
+
392
+ var match, quadruplet;
393
+
394
+ // Match #aabbcc
395
+ if (match = /#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})/.exec(color)) {
396
+ quadruplet = [parseInt(match[1], 16), parseInt(match[2], 16), parseInt(match[3], 16), 1];
397
+
398
+ // Match #abc
399
+ } else if (match = /#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])/.exec(color)) {
400
+ quadruplet = [parseInt(match[1], 16) * 17, parseInt(match[2], 16) * 17, parseInt(match[3], 16) * 17, 1];
401
+
402
+ // Match rgb(n, n, n)
403
+ } else if (match = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color)) {
404
+ quadruplet = [parseInt(match[1]), parseInt(match[2]), parseInt(match[3]), 1];
405
+
406
+ } else if (match = /rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9\.]*)\s*\)/.exec(color)) {
407
+ quadruplet = [parseInt(match[1], 10), parseInt(match[2], 10), parseInt(match[3], 10),parseFloat(match[4])];
408
+
409
+ // No browser returns rgb(n%, n%, n%), so little reason to support this format.
410
+ } else {
411
+ quadruplet = colors[color] || [255,255,255,0];
412
+ }
413
+ return quadruplet;
414
+ }
415
+
416
+ return UI.parallax;
417
+ });