uikit-rails 0.0.2 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -3
- data/Gemfile +2 -1
- data/LICENSE.txt +21 -0
- data/README.md +65 -0
- data/Rakefile +0 -1
- data/assets/fonts/FontAwesome.otf +0 -0
- data/assets/fonts/fontawesome-webfont.ttf +0 -0
- data/assets/fonts/fontawesome-webfont.woff +0 -0
- data/assets/fonts/fontawesome-webfont.woff2 +0 -0
- data/assets/javascripts/components/accordion.js +174 -0
- data/assets/javascripts/components/accordion.min.js +2 -0
- data/assets/javascripts/components/autocomplete.js +334 -0
- data/assets/javascripts/components/autocomplete.min.js +2 -0
- data/assets/javascripts/components/datepicker.js +3166 -0
- data/assets/javascripts/components/datepicker.min.js +3 -0
- data/assets/javascripts/components/form-password.js +67 -0
- data/assets/javascripts/components/form-password.min.js +2 -0
- data/assets/javascripts/components/form-select.js +70 -0
- data/assets/javascripts/components/form-select.min.js +2 -0
- data/assets/javascripts/components/grid.js +527 -0
- data/assets/javascripts/components/grid.min.js +2 -0
- data/assets/javascripts/components/htmleditor.js +623 -0
- data/assets/javascripts/components/htmleditor.min.js +2 -0
- data/assets/javascripts/components/lightbox.js +555 -0
- data/assets/javascripts/components/lightbox.min.js +2 -0
- data/assets/javascripts/components/nestable.js +638 -0
- data/assets/javascripts/components/nestable.min.js +2 -0
- data/assets/javascripts/components/notify.js +189 -0
- data/assets/javascripts/components/notify.min.js +2 -0
- data/assets/javascripts/components/pagination.js +147 -0
- data/assets/javascripts/components/pagination.min.js +2 -0
- data/assets/javascripts/components/parallax.js +435 -0
- data/assets/javascripts/components/parallax.min.js +2 -0
- data/assets/javascripts/components/search.js +92 -0
- data/assets/javascripts/components/search.min.js +2 -0
- data/assets/javascripts/components/slider.js +531 -0
- data/assets/javascripts/components/slider.min.js +2 -0
- data/assets/javascripts/components/slideset.js +506 -0
- data/assets/javascripts/components/slideset.min.js +2 -0
- data/assets/javascripts/components/slideshow-fx.js +375 -0
- data/assets/javascripts/components/slideshow-fx.min.js +2 -0
- data/assets/javascripts/components/slideshow.js +562 -0
- data/assets/javascripts/components/slideshow.min.js +2 -0
- data/assets/javascripts/components/sortable.js +688 -0
- data/assets/javascripts/components/sortable.min.js +2 -0
- data/assets/javascripts/components/sticky.js +359 -0
- data/assets/javascripts/components/sticky.min.js +2 -0
- data/assets/javascripts/components/timepicker.js +192 -0
- data/assets/javascripts/components/timepicker.min.js +2 -0
- data/assets/javascripts/components/tooltip.js +234 -0
- data/assets/javascripts/components/tooltip.min.js +2 -0
- data/assets/javascripts/components/upload.js +260 -0
- data/assets/javascripts/components/upload.min.js +2 -0
- data/assets/javascripts/core/alert.js +66 -0
- data/assets/javascripts/core/alert.min.js +2 -0
- data/assets/javascripts/core/button.js +157 -0
- data/assets/javascripts/core/button.min.js +2 -0
- data/assets/javascripts/core/core.js +730 -0
- data/assets/javascripts/core/core.min.js +2 -0
- data/assets/javascripts/core/cover.js +95 -0
- data/assets/javascripts/core/cover.min.js +2 -0
- data/assets/javascripts/core/dropdown.js +514 -0
- data/assets/javascripts/core/dropdown.min.js +2 -0
- data/assets/javascripts/core/grid.js +114 -0
- data/assets/javascripts/core/grid.min.js +2 -0
- data/assets/javascripts/core/modal.js +384 -0
- data/assets/javascripts/core/modal.min.js +2 -0
- data/assets/javascripts/core/nav.js +136 -0
- data/assets/javascripts/core/nav.min.js +2 -0
- data/assets/javascripts/core/offcanvas.js +180 -0
- data/assets/javascripts/core/offcanvas.min.js +2 -0
- data/assets/javascripts/core/scrollspy.js +208 -0
- data/assets/javascripts/core/scrollspy.min.js +2 -0
- data/assets/javascripts/core/smooth-scroll.js +62 -0
- data/assets/javascripts/core/smooth-scroll.min.js +2 -0
- data/assets/javascripts/core/switcher.js +309 -0
- data/assets/javascripts/core/switcher.min.js +2 -0
- data/assets/javascripts/core/tab.js +167 -0
- data/assets/javascripts/core/tab.min.js +2 -0
- data/assets/javascripts/core/toggle.js +120 -0
- data/assets/javascripts/core/toggle.min.js +2 -0
- data/assets/javascripts/core/touch.js +175 -0
- data/assets/javascripts/core/touch.min.js +2 -0
- data/assets/javascripts/core/utility.js +289 -0
- data/assets/javascripts/core/utility.min.js +2 -0
- data/assets/javascripts/uikit-components.js +23 -0
- data/assets/javascripts/uikit.js +3706 -0
- data/assets/javascripts/uikit.min.js +3 -0
- data/assets/stylesheets/components/accordion.scss +94 -0
- data/assets/stylesheets/components/autocomplete.scss +102 -0
- data/assets/stylesheets/components/datepicker.scss +197 -0
- data/assets/stylesheets/components/dotnav.scss +212 -0
- data/assets/stylesheets/components/form-advanced.scss +128 -0
- data/assets/stylesheets/components/form-file.scss +63 -0
- data/assets/stylesheets/components/form-password.scss +74 -0
- data/assets/stylesheets/components/form-select.scss +66 -0
- data/assets/stylesheets/components/htmleditor.scss +269 -0
- data/assets/stylesheets/components/nestable.scss +229 -0
- data/assets/stylesheets/components/notify.scss +190 -0
- data/assets/stylesheets/components/placeholder.scss +66 -0
- data/assets/stylesheets/components/progress.scss +173 -0
- data/assets/stylesheets/components/search.scss +309 -0
- data/assets/stylesheets/components/slidenav.scss +183 -0
- data/assets/stylesheets/components/slider.scss +131 -0
- data/assets/stylesheets/components/slideshow.scss +208 -0
- data/assets/stylesheets/components/sortable.scss +122 -0
- data/assets/stylesheets/components/sticky.scss +64 -0
- data/assets/stylesheets/components/tooltip.scss +177 -0
- data/assets/stylesheets/components/upload.scss +34 -0
- data/assets/stylesheets/core/alert.scss +141 -0
- data/assets/stylesheets/core/animation.scss +599 -0
- data/assets/stylesheets/core/article.scss +139 -0
- data/assets/stylesheets/core/badge.scss +110 -0
- data/assets/stylesheets/core/base-noconflict.scss +397 -0
- data/assets/stylesheets/core/base.scss +541 -0
- data/assets/stylesheets/core/block.scss +153 -0
- data/assets/stylesheets/core/breadcrumb.scss +86 -0
- data/assets/stylesheets/core/button.scss +406 -0
- data/assets/stylesheets/core/close.scss +132 -0
- data/assets/stylesheets/core/column.scss +209 -0
- data/assets/stylesheets/core/comment.scss +172 -0
- data/assets/stylesheets/core/contrast.scss +493 -0
- data/assets/stylesheets/core/cover.scss +70 -0
- data/assets/stylesheets/core/description-list.scss +71 -0
- data/assets/stylesheets/core/dropdown.scss +280 -0
- data/assets/stylesheets/core/flex.scss +320 -0
- data/assets/stylesheets/core/form.scss +627 -0
- data/assets/stylesheets/core/grid.scss +688 -0
- data/assets/stylesheets/core/icon.scss +897 -0
- data/assets/stylesheets/core/list.scss +102 -0
- data/assets/stylesheets/core/modal.scss +341 -0
- data/assets/stylesheets/core/nav.scss +468 -0
- data/assets/stylesheets/core/navbar.scss +325 -0
- data/assets/stylesheets/core/offcanvas.scss +168 -0
- data/assets/stylesheets/core/overlay.scss +534 -0
- data/assets/stylesheets/core/pagination.scss +197 -0
- data/assets/stylesheets/core/panel.scss +332 -0
- data/assets/stylesheets/core/print.scss +59 -0
- data/assets/stylesheets/core/subnav.scss +213 -0
- data/assets/stylesheets/core/switcher.scss +38 -0
- data/assets/stylesheets/core/tab.scss +368 -0
- data/assets/stylesheets/core/table.scss +147 -0
- data/assets/stylesheets/core/text.scss +128 -0
- data/assets/stylesheets/core/thumbnail.scss +122 -0
- data/assets/stylesheets/core/thumbnav.scss +122 -0
- data/assets/stylesheets/core/utility.scss +606 -0
- data/assets/stylesheets/core/variables.scss +23 -0
- data/assets/stylesheets/uikit-components.scss +22 -0
- data/assets/stylesheets/uikit-mixins.scss +327 -0
- data/assets/stylesheets/uikit-variables.scss +817 -0
- data/assets/stylesheets/uikit.scss +56 -0
- data/lib/uikit-rails.rb +2 -2
- data/lib/uikit-rails/engine.rb +11 -1
- data/lib/uikit-rails/version.rb +1 -3
- data/uikit-rails.gemspec +15 -16
- metadata +169 -44
- data/README.rb +0 -1
- data/vendor/assets/javascripts/ui.card.js +0 -115
- data/vendor/assets/javascripts/ui.color-picker.js +0 -351
- data/vendor/assets/javascripts/ui.confirmation.js +0 -133
- data/vendor/assets/javascripts/ui.dialog.js +0 -252
- data/vendor/assets/javascripts/ui.emitter.js +0 -99
- data/vendor/assets/javascripts/ui.js +0 -1641
- data/vendor/assets/javascripts/ui.menu.js +0 -238
- data/vendor/assets/javascripts/ui.notification.js +0 -240
- data/vendor/assets/javascripts/ui.overlay.js +0 -79
- data/vendor/assets/javascripts/ui.split-button.js +0 -108
- data/vendor/assets/stylesheets/ui.card.css +0 -55
- data/vendor/assets/stylesheets/ui.color-picker.css +0 -6
- data/vendor/assets/stylesheets/ui.confirmation.css +0 -7
- data/vendor/assets/stylesheets/ui.css +0 -337
- data/vendor/assets/stylesheets/ui.dialog.css +0 -92
- data/vendor/assets/stylesheets/ui.menu.css +0 -32
- data/vendor/assets/stylesheets/ui.notification.css +0 -107
- data/vendor/assets/stylesheets/ui.overlay.css +0 -16
- data/vendor/assets/stylesheets/ui.split-button.css +0 -27
@@ -0,0 +1,2 @@
|
|
1
|
+
/*! UIkit 2.24.2 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
2
|
+
!function(t){"use strict";var s=t.$win,o=t.$doc,i=[],e=function(){for(var t=0;t<i.length;t++)window.requestAnimationFrame.apply(window,[i[t].check])};t.component("scrollspy",{defaults:{target:!1,cls:"uk-scrollspy-inview",initcls:"uk-scrollspy-init-inview",topoffset:0,leftoffset:0,repeat:!1,delay:0},boot:function(){o.on("scrolling.uk.document",e),s.on("load resize orientationchange",t.Utils.debounce(e,50)),t.ready(function(s){t.$("[data-uk-scrollspy]",s).each(function(){var s=t.$(this);if(!s.data("scrollspy")){t.scrollspy(s,t.Utils.options(s.attr("data-uk-scrollspy")))}})})},init:function(){var s,o=this,e=this.options.cls.split(/,/),l=function(){var i=o.options.target?o.element.find(o.options.target):o.element,l=1===i.length?1:0,n=0;i.each(function(){var i=t.$(this),a=i.data("inviewstate"),r=t.Utils.isInView(i,o.options),c=i.data("ukScrollspyCls")||e[n].trim();!r||a||i.data("scrollspy-idle")||(s||(i.addClass(o.options.initcls),o.offset=i.offset(),s=!0,i.trigger("init.uk.scrollspy")),i.data("scrollspy-idle",setTimeout(function(){i.addClass("uk-scrollspy-inview").toggleClass(c).width(),i.trigger("inview.uk.scrollspy"),i.data("scrollspy-idle",!1),i.data("inviewstate",!0)},o.options.delay*l)),l++),!r&&a&&o.options.repeat&&(i.data("scrollspy-idle")&&clearTimeout(i.data("scrollspy-idle")),i.removeClass("uk-scrollspy-inview").toggleClass(c),i.data("inviewstate",!1),i.trigger("outview.uk.scrollspy")),n=e[n+1]?n+1:0})};l(),this.check=l,i.push(this)}});var l=[],n=function(){for(var t=0;t<l.length;t++)window.requestAnimationFrame.apply(window,[l[t].check])};t.component("scrollspynav",{defaults:{cls:"uk-active",closest:!1,topoffset:0,leftoffset:0,smoothscroll:!1},boot:function(){o.on("scrolling.uk.document",n),s.on("resize orientationchange",t.Utils.debounce(n,50)),t.ready(function(s){t.$("[data-uk-scrollspy-nav]",s).each(function(){var s=t.$(this);if(!s.data("scrollspynav")){t.scrollspynav(s,t.Utils.options(s.attr("data-uk-scrollspy-nav")))}})})},init:function(){var o,i=[],e=this.find("a[href^='#']").each(function(){"#"!==this.getAttribute("href").trim()&&i.push(this.getAttribute("href"))}),n=t.$(i.join(",")),a=this.options.cls,r=this.options.closest||this.options.closest,c=this,p=function(){o=[];for(var i=0;i<n.length;i++)t.Utils.isInView(n.eq(i),c.options)&&o.push(n.eq(i));if(o.length){var l,p=s.scrollTop(),u=function(){for(var t=0;t<o.length;t++)if(o[t].offset().top>=p)return o[t]}();if(!u)return;c.options.closest?(e.blur().closest(r).removeClass(a),l=e.filter("a[href='#"+u.attr("id")+"']").closest(r).addClass(a)):l=e.removeClass(a).filter("a[href='#"+u.attr("id")+"']").addClass(a),c.element.trigger("inview.uk.scrollspynav",[u,l])}};this.options.smoothscroll&&t.smoothScroll&&e.each(function(){t.smoothScroll(this,c.options.smoothscroll)}),p(),this.element.data("scrollspynav",this),this.check=p,l.push(this)}})}(UIkit);
|
@@ -0,0 +1,62 @@
|
|
1
|
+
/*! UIkit 2.24.2 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
2
|
+
(function(UI) {
|
3
|
+
|
4
|
+
"use strict";
|
5
|
+
|
6
|
+
UI.component('smoothScroll', {
|
7
|
+
|
8
|
+
boot: function() {
|
9
|
+
|
10
|
+
// init code
|
11
|
+
UI.$html.on("click.smooth-scroll.uikit", "[data-uk-smooth-scroll]", function(e) {
|
12
|
+
var ele = UI.$(this);
|
13
|
+
|
14
|
+
if (!ele.data("smoothScroll")) {
|
15
|
+
var obj = UI.smoothScroll(ele, UI.Utils.options(ele.attr("data-uk-smooth-scroll")));
|
16
|
+
ele.trigger("click");
|
17
|
+
}
|
18
|
+
|
19
|
+
return false;
|
20
|
+
});
|
21
|
+
},
|
22
|
+
|
23
|
+
init: function() {
|
24
|
+
|
25
|
+
var $this = this;
|
26
|
+
|
27
|
+
this.on("click", function(e) {
|
28
|
+
e.preventDefault();
|
29
|
+
scrollToElement(UI.$(this.hash).length ? UI.$(this.hash) : UI.$("body"), $this.options);
|
30
|
+
});
|
31
|
+
}
|
32
|
+
});
|
33
|
+
|
34
|
+
function scrollToElement(ele, options) {
|
35
|
+
|
36
|
+
options = UI.$.extend({
|
37
|
+
duration: 1000,
|
38
|
+
transition: 'easeOutExpo',
|
39
|
+
offset: 0,
|
40
|
+
complete: function(){}
|
41
|
+
}, options);
|
42
|
+
|
43
|
+
// get / set parameters
|
44
|
+
var target = ele.offset().top - options.offset,
|
45
|
+
docheight = UI.$doc.height(),
|
46
|
+
winheight = window.innerHeight;
|
47
|
+
|
48
|
+
if ((target + winheight) > docheight) {
|
49
|
+
target = docheight - winheight;
|
50
|
+
}
|
51
|
+
|
52
|
+
// animate to target, fire callback when done
|
53
|
+
UI.$("html,body").stop().animate({scrollTop: target}, options.duration, options.transition).promise().done(options.complete);
|
54
|
+
}
|
55
|
+
|
56
|
+
UI.Utils.scrollToElement = scrollToElement;
|
57
|
+
|
58
|
+
if (!UI.$.easing.easeOutExpo) {
|
59
|
+
UI.$.easing.easeOutExpo = function(x, t, b, c, d) { return (t == d) ? b + c : c * (-Math.pow(2, -10 * t / d) + 1) + b; };
|
60
|
+
}
|
61
|
+
|
62
|
+
})(UIkit);
|
@@ -0,0 +1,2 @@
|
|
1
|
+
/*! UIkit 2.24.2 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
2
|
+
!function(t){"use strict";function o(o,i){i=t.$.extend({duration:1e3,transition:"easeOutExpo",offset:0,complete:function(){}},i);var n=o.offset().top-i.offset,s=t.$doc.height(),e=window.innerHeight;n+e>s&&(n=s-e),t.$("html,body").stop().animate({scrollTop:n},i.duration,i.transition).promise().done(i.complete)}t.component("smoothScroll",{boot:function(){t.$html.on("click.smooth-scroll.uikit","[data-uk-smooth-scroll]",function(){var o=t.$(this);if(!o.data("smoothScroll")){{t.smoothScroll(o,t.Utils.options(o.attr("data-uk-smooth-scroll")))}o.trigger("click")}return!1})},init:function(){var i=this;this.on("click",function(n){n.preventDefault(),o(t.$(this.hash).length?t.$(this.hash):t.$("body"),i.options)})}}),t.Utils.scrollToElement=o,t.$.easing.easeOutExpo||(t.$.easing.easeOutExpo=function(t,o,i,n,s){return o==s?i+n:n*(-Math.pow(2,-10*o/s)+1)+i})}(UIkit);
|
@@ -0,0 +1,309 @@
|
|
1
|
+
/*! UIkit 2.24.2 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
2
|
+
(function(UI) {
|
3
|
+
|
4
|
+
"use strict";
|
5
|
+
|
6
|
+
var Animations;
|
7
|
+
|
8
|
+
UI.component('switcher', {
|
9
|
+
|
10
|
+
defaults: {
|
11
|
+
connect : false,
|
12
|
+
toggle : ">*",
|
13
|
+
active : 0,
|
14
|
+
animation : false,
|
15
|
+
duration : 200,
|
16
|
+
swiping : true
|
17
|
+
},
|
18
|
+
|
19
|
+
animating: false,
|
20
|
+
|
21
|
+
boot: function() {
|
22
|
+
|
23
|
+
// init code
|
24
|
+
UI.ready(function(context) {
|
25
|
+
|
26
|
+
UI.$("[data-uk-switcher]", context).each(function() {
|
27
|
+
var switcher = UI.$(this);
|
28
|
+
|
29
|
+
if (!switcher.data("switcher")) {
|
30
|
+
var obj = UI.switcher(switcher, UI.Utils.options(switcher.attr("data-uk-switcher")));
|
31
|
+
}
|
32
|
+
});
|
33
|
+
});
|
34
|
+
},
|
35
|
+
|
36
|
+
init: function() {
|
37
|
+
|
38
|
+
var $this = this;
|
39
|
+
|
40
|
+
this.on("click.uikit.switcher", this.options.toggle, function(e) {
|
41
|
+
e.preventDefault();
|
42
|
+
$this.show(this);
|
43
|
+
});
|
44
|
+
|
45
|
+
if (this.options.connect) {
|
46
|
+
|
47
|
+
this.connect = UI.$(this.options.connect);
|
48
|
+
|
49
|
+
this.connect.find(".uk-active").removeClass(".uk-active");
|
50
|
+
|
51
|
+
// delegate switch commands within container content
|
52
|
+
if (this.connect.length) {
|
53
|
+
|
54
|
+
// Init ARIA for connect
|
55
|
+
this.connect.children().attr('aria-hidden', 'true');
|
56
|
+
|
57
|
+
this.connect.on("click", '[data-uk-switcher-item]', function(e) {
|
58
|
+
|
59
|
+
e.preventDefault();
|
60
|
+
|
61
|
+
var item = UI.$(this).attr('data-uk-switcher-item');
|
62
|
+
|
63
|
+
if ($this.index == item) return;
|
64
|
+
|
65
|
+
switch(item) {
|
66
|
+
case 'next':
|
67
|
+
case 'previous':
|
68
|
+
$this.show($this.index + (item=='next' ? 1:-1));
|
69
|
+
break;
|
70
|
+
default:
|
71
|
+
$this.show(parseInt(item, 10));
|
72
|
+
}
|
73
|
+
});
|
74
|
+
|
75
|
+
if (this.options.swiping) {
|
76
|
+
|
77
|
+
this.connect.on('swipeRight swipeLeft', function(e) {
|
78
|
+
e.preventDefault();
|
79
|
+
if(!window.getSelection().toString()) {
|
80
|
+
$this.show($this.index + (e.type == 'swipeLeft' ? 1 : -1));
|
81
|
+
}
|
82
|
+
});
|
83
|
+
}
|
84
|
+
}
|
85
|
+
|
86
|
+
var toggles = this.find(this.options.toggle),
|
87
|
+
active = toggles.filter(".uk-active");
|
88
|
+
|
89
|
+
if (active.length) {
|
90
|
+
this.show(active, false);
|
91
|
+
} else {
|
92
|
+
|
93
|
+
if (this.options.active===false) return;
|
94
|
+
|
95
|
+
active = toggles.eq(this.options.active);
|
96
|
+
this.show(active.length ? active : toggles.eq(0), false);
|
97
|
+
}
|
98
|
+
|
99
|
+
// Init ARIA for toggles
|
100
|
+
toggles.not(active).attr('aria-expanded', 'false');
|
101
|
+
active.attr('aria-expanded', 'true');
|
102
|
+
|
103
|
+
this.on('changed.uk.dom', function() {
|
104
|
+
$this.connect = UI.$($this.options.connect);
|
105
|
+
});
|
106
|
+
}
|
107
|
+
|
108
|
+
},
|
109
|
+
|
110
|
+
show: function(tab, animate) {
|
111
|
+
|
112
|
+
if (this.animating) {
|
113
|
+
return;
|
114
|
+
}
|
115
|
+
|
116
|
+
if (isNaN(tab)) {
|
117
|
+
tab = UI.$(tab);
|
118
|
+
} else {
|
119
|
+
|
120
|
+
var toggles = this.find(this.options.toggle);
|
121
|
+
|
122
|
+
tab = tab < 0 ? toggles.length-1 : tab;
|
123
|
+
tab = toggles.eq(toggles[tab] ? tab : 0);
|
124
|
+
}
|
125
|
+
|
126
|
+
var $this = this,
|
127
|
+
toggles = this.find(this.options.toggle),
|
128
|
+
active = UI.$(tab),
|
129
|
+
animation = Animations[this.options.animation] || function(current, next) {
|
130
|
+
|
131
|
+
if (!$this.options.animation) {
|
132
|
+
return Animations.none.apply($this);
|
133
|
+
}
|
134
|
+
|
135
|
+
var anim = $this.options.animation.split(',');
|
136
|
+
|
137
|
+
if (anim.length == 1) {
|
138
|
+
anim[1] = anim[0];
|
139
|
+
}
|
140
|
+
|
141
|
+
anim[0] = anim[0].trim();
|
142
|
+
anim[1] = anim[1].trim();
|
143
|
+
|
144
|
+
return coreAnimation.apply($this, [anim, current, next]);
|
145
|
+
};
|
146
|
+
|
147
|
+
if (animate===false || !UI.support.animation) {
|
148
|
+
animation = Animations.none;
|
149
|
+
}
|
150
|
+
|
151
|
+
if (active.hasClass("uk-disabled")) return;
|
152
|
+
|
153
|
+
// Update ARIA for Toggles
|
154
|
+
toggles.attr('aria-expanded', 'false');
|
155
|
+
active.attr('aria-expanded', 'true');
|
156
|
+
|
157
|
+
toggles.filter(".uk-active").removeClass("uk-active");
|
158
|
+
active.addClass("uk-active");
|
159
|
+
|
160
|
+
if (this.options.connect && this.connect.length) {
|
161
|
+
|
162
|
+
this.index = this.find(this.options.toggle).index(active);
|
163
|
+
|
164
|
+
if (this.index == -1 ) {
|
165
|
+
this.index = 0;
|
166
|
+
}
|
167
|
+
|
168
|
+
this.connect.each(function() {
|
169
|
+
|
170
|
+
var container = UI.$(this),
|
171
|
+
children = UI.$(container.children()),
|
172
|
+
current = UI.$(children.filter('.uk-active')),
|
173
|
+
next = UI.$(children.eq($this.index));
|
174
|
+
|
175
|
+
$this.animating = true;
|
176
|
+
|
177
|
+
animation.apply($this, [current, next]).then(function(){
|
178
|
+
|
179
|
+
current.removeClass("uk-active");
|
180
|
+
next.addClass("uk-active");
|
181
|
+
|
182
|
+
// Update ARIA for connect
|
183
|
+
current.attr('aria-hidden', 'true');
|
184
|
+
next.attr('aria-hidden', 'false');
|
185
|
+
|
186
|
+
UI.Utils.checkDisplay(next, true);
|
187
|
+
|
188
|
+
$this.animating = false;
|
189
|
+
|
190
|
+
});
|
191
|
+
});
|
192
|
+
}
|
193
|
+
|
194
|
+
this.trigger("show.uk.switcher", [active]);
|
195
|
+
}
|
196
|
+
});
|
197
|
+
|
198
|
+
Animations = {
|
199
|
+
|
200
|
+
'none': function() {
|
201
|
+
var d = UI.$.Deferred();
|
202
|
+
d.resolve();
|
203
|
+
return d.promise();
|
204
|
+
},
|
205
|
+
|
206
|
+
'fade': function(current, next) {
|
207
|
+
return coreAnimation.apply(this, ['uk-animation-fade', current, next]);
|
208
|
+
},
|
209
|
+
|
210
|
+
'slide-bottom': function(current, next) {
|
211
|
+
return coreAnimation.apply(this, ['uk-animation-slide-bottom', current, next]);
|
212
|
+
},
|
213
|
+
|
214
|
+
'slide-top': function(current, next) {
|
215
|
+
return coreAnimation.apply(this, ['uk-animation-slide-top', current, next]);
|
216
|
+
},
|
217
|
+
|
218
|
+
'slide-vertical': function(current, next, dir) {
|
219
|
+
|
220
|
+
var anim = ['uk-animation-slide-top', 'uk-animation-slide-bottom'];
|
221
|
+
|
222
|
+
if (current && current.index() > next.index()) {
|
223
|
+
anim.reverse();
|
224
|
+
}
|
225
|
+
|
226
|
+
return coreAnimation.apply(this, [anim, current, next]);
|
227
|
+
},
|
228
|
+
|
229
|
+
'slide-left': function(current, next) {
|
230
|
+
return coreAnimation.apply(this, ['uk-animation-slide-left', current, next]);
|
231
|
+
},
|
232
|
+
|
233
|
+
'slide-right': function(current, next) {
|
234
|
+
return coreAnimation.apply(this, ['uk-animation-slide-right', current, next]);
|
235
|
+
},
|
236
|
+
|
237
|
+
'slide-horizontal': function(current, next, dir) {
|
238
|
+
|
239
|
+
var anim = ['uk-animation-slide-right', 'uk-animation-slide-left'];
|
240
|
+
|
241
|
+
if (current && current.index() > next.index()) {
|
242
|
+
anim.reverse();
|
243
|
+
}
|
244
|
+
|
245
|
+
return coreAnimation.apply(this, [anim, current, next]);
|
246
|
+
},
|
247
|
+
|
248
|
+
'scale': function(current, next) {
|
249
|
+
return coreAnimation.apply(this, ['uk-animation-scale-up', current, next]);
|
250
|
+
}
|
251
|
+
};
|
252
|
+
|
253
|
+
UI.switcher.animations = Animations;
|
254
|
+
|
255
|
+
|
256
|
+
// helpers
|
257
|
+
|
258
|
+
function coreAnimation(cls, current, next) {
|
259
|
+
|
260
|
+
var d = UI.$.Deferred(), clsIn = cls, clsOut = cls, release;
|
261
|
+
|
262
|
+
if (next[0]===current[0]) {
|
263
|
+
d.resolve();
|
264
|
+
return d.promise();
|
265
|
+
}
|
266
|
+
|
267
|
+
if (typeof(cls) == 'object') {
|
268
|
+
clsIn = cls[0];
|
269
|
+
clsOut = cls[1] || cls[0];
|
270
|
+
}
|
271
|
+
|
272
|
+
UI.$body.css('overflow-x', 'hidden'); // fix scroll jumping in iOS
|
273
|
+
|
274
|
+
release = function() {
|
275
|
+
|
276
|
+
if (current) current.hide().removeClass('uk-active '+clsOut+' uk-animation-reverse');
|
277
|
+
|
278
|
+
next.addClass(clsIn).one(UI.support.animation.end, function() {
|
279
|
+
|
280
|
+
next.removeClass(''+clsIn+'').css({opacity:'', display:''});
|
281
|
+
|
282
|
+
d.resolve();
|
283
|
+
|
284
|
+
UI.$body.css('overflow-x', '');
|
285
|
+
|
286
|
+
if (current) current.css({opacity:'', display:''});
|
287
|
+
|
288
|
+
}.bind(this)).show();
|
289
|
+
};
|
290
|
+
|
291
|
+
next.css('animation-duration', this.options.duration+'ms');
|
292
|
+
|
293
|
+
if (current && current.length) {
|
294
|
+
|
295
|
+
current.css('animation-duration', this.options.duration+'ms');
|
296
|
+
|
297
|
+
current.css('display', 'none').addClass(clsOut+' uk-animation-reverse').one(UI.support.animation.end, function() {
|
298
|
+
release();
|
299
|
+
}.bind(this)).css('display', '');
|
300
|
+
|
301
|
+
} else {
|
302
|
+
next.addClass('uk-active');
|
303
|
+
release();
|
304
|
+
}
|
305
|
+
|
306
|
+
return d.promise();
|
307
|
+
}
|
308
|
+
|
309
|
+
})(UIkit);
|
@@ -0,0 +1,2 @@
|
|
1
|
+
/*! UIkit 2.24.2 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
2
|
+
!function(t){"use strict";function i(i,n,e){var s,a=t.$.Deferred(),o=i,r=i;return e[0]===n[0]?(a.resolve(),a.promise()):("object"==typeof i&&(o=i[0],r=i[1]||i[0]),t.$body.css("overflow-x","hidden"),s=function(){n&&n.hide().removeClass("uk-active "+r+" uk-animation-reverse"),e.addClass(o).one(t.support.animation.end,function(){e.removeClass(""+o).css({opacity:"",display:""}),a.resolve(),t.$body.css("overflow-x",""),n&&n.css({opacity:"",display:""})}.bind(this)).show()},e.css("animation-duration",this.options.duration+"ms"),n&&n.length?(n.css("animation-duration",this.options.duration+"ms"),n.css("display","none").addClass(r+" uk-animation-reverse").one(t.support.animation.end,function(){s()}.bind(this)).css("display","")):(e.addClass("uk-active"),s()),a.promise())}var n;t.component("switcher",{defaults:{connect:!1,toggle:">*",active:0,animation:!1,duration:200,swiping:!0},animating:!1,boot:function(){t.ready(function(i){t.$("[data-uk-switcher]",i).each(function(){var i=t.$(this);if(!i.data("switcher")){t.switcher(i,t.Utils.options(i.attr("data-uk-switcher")))}})})},init:function(){var i=this;if(this.on("click.uikit.switcher",this.options.toggle,function(t){t.preventDefault(),i.show(this)}),this.options.connect){this.connect=t.$(this.options.connect),this.connect.find(".uk-active").removeClass(".uk-active"),this.connect.length&&(this.connect.children().attr("aria-hidden","true"),this.connect.on("click","[data-uk-switcher-item]",function(n){n.preventDefault();var e=t.$(this).attr("data-uk-switcher-item");if(i.index!=e)switch(e){case"next":case"previous":i.show(i.index+("next"==e?1:-1));break;default:i.show(parseInt(e,10))}}),this.options.swiping&&this.connect.on("swipeRight swipeLeft",function(t){t.preventDefault(),window.getSelection().toString()||i.show(i.index+("swipeLeft"==t.type?1:-1))}));var n=this.find(this.options.toggle),e=n.filter(".uk-active");if(e.length)this.show(e,!1);else{if(this.options.active===!1)return;e=n.eq(this.options.active),this.show(e.length?e:n.eq(0),!1)}n.not(e).attr("aria-expanded","false"),e.attr("aria-expanded","true"),this.on("changed.uk.dom",function(){i.connect=t.$(i.options.connect)})}},show:function(e,s){if(!this.animating){if(isNaN(e))e=t.$(e);else{var a=this.find(this.options.toggle);e=0>e?a.length-1:e,e=a.eq(a[e]?e:0)}var o=this,a=this.find(this.options.toggle),r=t.$(e),c=n[this.options.animation]||function(t,e){if(!o.options.animation)return n.none.apply(o);var s=o.options.animation.split(",");return 1==s.length&&(s[1]=s[0]),s[0]=s[0].trim(),s[1]=s[1].trim(),i.apply(o,[s,t,e])};s!==!1&&t.support.animation||(c=n.none),r.hasClass("uk-disabled")||(a.attr("aria-expanded","false"),r.attr("aria-expanded","true"),a.filter(".uk-active").removeClass("uk-active"),r.addClass("uk-active"),this.options.connect&&this.connect.length&&(this.index=this.find(this.options.toggle).index(r),-1==this.index&&(this.index=0),this.connect.each(function(){var i=t.$(this),n=t.$(i.children()),e=t.$(n.filter(".uk-active")),s=t.$(n.eq(o.index));o.animating=!0,c.apply(o,[e,s]).then(function(){e.removeClass("uk-active"),s.addClass("uk-active"),e.attr("aria-hidden","true"),s.attr("aria-hidden","false"),t.Utils.checkDisplay(s,!0),o.animating=!1})})),this.trigger("show.uk.switcher",[r]))}}}),n={none:function(){var i=t.$.Deferred();return i.resolve(),i.promise()},fade:function(t,n){return i.apply(this,["uk-animation-fade",t,n])},"slide-bottom":function(t,n){return i.apply(this,["uk-animation-slide-bottom",t,n])},"slide-top":function(t,n){return i.apply(this,["uk-animation-slide-top",t,n])},"slide-vertical":function(t,n){var e=["uk-animation-slide-top","uk-animation-slide-bottom"];return t&&t.index()>n.index()&&e.reverse(),i.apply(this,[e,t,n])},"slide-left":function(t,n){return i.apply(this,["uk-animation-slide-left",t,n])},"slide-right":function(t,n){return i.apply(this,["uk-animation-slide-right",t,n])},"slide-horizontal":function(t,n){var e=["uk-animation-slide-right","uk-animation-slide-left"];return t&&t.index()>n.index()&&e.reverse(),i.apply(this,[e,t,n])},scale:function(t,n){return i.apply(this,["uk-animation-scale-up",t,n])}},t.switcher.animations=n}(UIkit);
|
@@ -0,0 +1,167 @@
|
|
1
|
+
/*! UIkit 2.24.2 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
2
|
+
(function(UI) {
|
3
|
+
|
4
|
+
"use strict";
|
5
|
+
|
6
|
+
UI.component('tab', {
|
7
|
+
|
8
|
+
defaults: {
|
9
|
+
'target' : '>li:not(.uk-tab-responsive, .uk-disabled)',
|
10
|
+
'connect' : false,
|
11
|
+
'active' : 0,
|
12
|
+
'animation' : false,
|
13
|
+
'duration' : 200,
|
14
|
+
'swiping' : true
|
15
|
+
},
|
16
|
+
|
17
|
+
boot: function() {
|
18
|
+
|
19
|
+
// init code
|
20
|
+
UI.ready(function(context) {
|
21
|
+
|
22
|
+
UI.$("[data-uk-tab]", context).each(function() {
|
23
|
+
|
24
|
+
var tab = UI.$(this);
|
25
|
+
|
26
|
+
if (!tab.data("tab")) {
|
27
|
+
var obj = UI.tab(tab, UI.Utils.options(tab.attr("data-uk-tab")));
|
28
|
+
}
|
29
|
+
});
|
30
|
+
});
|
31
|
+
},
|
32
|
+
|
33
|
+
init: function() {
|
34
|
+
|
35
|
+
var $this = this;
|
36
|
+
|
37
|
+
this.current = false;
|
38
|
+
|
39
|
+
this.on("click.uikit.tab", this.options.target, function(e) {
|
40
|
+
|
41
|
+
e.preventDefault();
|
42
|
+
|
43
|
+
if ($this.switcher && $this.switcher.animating) {
|
44
|
+
return;
|
45
|
+
}
|
46
|
+
|
47
|
+
var current = $this.find($this.options.target).not(this);
|
48
|
+
|
49
|
+
current.removeClass("uk-active").blur();
|
50
|
+
|
51
|
+
$this.trigger("change.uk.tab", [UI.$(this).addClass("uk-active"), $this.current]);
|
52
|
+
|
53
|
+
$this.current = UI.$(this);
|
54
|
+
|
55
|
+
// Update ARIA
|
56
|
+
if (!$this.options.connect) {
|
57
|
+
current.attr('aria-expanded', 'false');
|
58
|
+
UI.$(this).attr('aria-expanded', 'true');
|
59
|
+
}
|
60
|
+
});
|
61
|
+
|
62
|
+
if (this.options.connect) {
|
63
|
+
this.connect = UI.$(this.options.connect);
|
64
|
+
}
|
65
|
+
|
66
|
+
// init responsive tab
|
67
|
+
this.responsivetab = UI.$('<li class="uk-tab-responsive uk-active"><a></a></li>').append('<div class="uk-dropdown uk-dropdown-small"><ul class="uk-nav uk-nav-dropdown"></ul><div>');
|
68
|
+
|
69
|
+
this.responsivetab.dropdown = this.responsivetab.find('.uk-dropdown');
|
70
|
+
this.responsivetab.lst = this.responsivetab.dropdown.find('ul');
|
71
|
+
this.responsivetab.caption = this.responsivetab.find('a:first');
|
72
|
+
|
73
|
+
if (this.element.hasClass("uk-tab-bottom")) this.responsivetab.dropdown.addClass("uk-dropdown-up");
|
74
|
+
|
75
|
+
// handle click
|
76
|
+
this.responsivetab.lst.on('click.uikit.tab', 'a', function(e) {
|
77
|
+
|
78
|
+
e.preventDefault();
|
79
|
+
e.stopPropagation();
|
80
|
+
|
81
|
+
var link = UI.$(this);
|
82
|
+
|
83
|
+
$this.element.children('li:not(.uk-tab-responsive)').eq(link.data('index')).trigger('click');
|
84
|
+
});
|
85
|
+
|
86
|
+
this.on('show.uk.switcher change.uk.tab', function(e, tab) {
|
87
|
+
$this.responsivetab.caption.html(tab.text());
|
88
|
+
});
|
89
|
+
|
90
|
+
this.element.append(this.responsivetab);
|
91
|
+
|
92
|
+
// init UIkit components
|
93
|
+
if (this.options.connect) {
|
94
|
+
this.switcher = UI.switcher(this.element, {
|
95
|
+
'toggle' : '>li:not(.uk-tab-responsive)',
|
96
|
+
'connect' : this.options.connect,
|
97
|
+
'active' : this.options.active,
|
98
|
+
'animation' : this.options.animation,
|
99
|
+
'duration' : this.options.duration,
|
100
|
+
'swiping' : this.options.swiping
|
101
|
+
});
|
102
|
+
}
|
103
|
+
|
104
|
+
UI.dropdown(this.responsivetab, {"mode": "click"});
|
105
|
+
|
106
|
+
// init
|
107
|
+
$this.trigger("change.uk.tab", [this.element.find(this.options.target).not('.uk-tab-responsive').filter('.uk-active')]);
|
108
|
+
|
109
|
+
this.check();
|
110
|
+
|
111
|
+
UI.$win.on('resize orientationchange', UI.Utils.debounce(function(){
|
112
|
+
if ($this.element.is(":visible")) $this.check();
|
113
|
+
}, 100));
|
114
|
+
|
115
|
+
this.on('display.uk.check', function(){
|
116
|
+
if ($this.element.is(":visible")) $this.check();
|
117
|
+
});
|
118
|
+
},
|
119
|
+
|
120
|
+
check: function() {
|
121
|
+
|
122
|
+
var children = this.element.children('li:not(.uk-tab-responsive)').removeClass('uk-hidden');
|
123
|
+
|
124
|
+
if (!children.length) {
|
125
|
+
this.responsivetab.addClass('uk-hidden');
|
126
|
+
return;
|
127
|
+
}
|
128
|
+
|
129
|
+
var top = (children.eq(0).offset().top + Math.ceil(children.eq(0).height()/2)),
|
130
|
+
doresponsive = false,
|
131
|
+
item, link, clone;
|
132
|
+
|
133
|
+
this.responsivetab.lst.empty();
|
134
|
+
|
135
|
+
children.each(function(){
|
136
|
+
|
137
|
+
if (UI.$(this).offset().top > top) {
|
138
|
+
doresponsive = true;
|
139
|
+
}
|
140
|
+
});
|
141
|
+
|
142
|
+
if (doresponsive) {
|
143
|
+
|
144
|
+
for (var i = 0; i < children.length; i++) {
|
145
|
+
|
146
|
+
item = UI.$(children.eq(i));
|
147
|
+
link = item.find('a');
|
148
|
+
|
149
|
+
if (item.css('float') != 'none' && !item.attr('uk-dropdown')) {
|
150
|
+
|
151
|
+
if (!item.hasClass('uk-disabled')) {
|
152
|
+
|
153
|
+
clone = item[0].outerHTML.replace('<a ', '<a data-index="'+i+'" ');
|
154
|
+
|
155
|
+
this.responsivetab.lst.append(clone);
|
156
|
+
}
|
157
|
+
|
158
|
+
item.addClass('uk-hidden');
|
159
|
+
}
|
160
|
+
}
|
161
|
+
}
|
162
|
+
|
163
|
+
this.responsivetab[this.responsivetab.lst.children('li').length ? 'removeClass':'addClass']('uk-hidden');
|
164
|
+
}
|
165
|
+
});
|
166
|
+
|
167
|
+
})(UIkit);
|