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