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(t){"use strict";t.component("tab",{defaults:{target:">li:not(.uk-tab-responsive, .uk-disabled)",connect:!1,active:0,animation:!1,duration:200,swiping:!0},boot:function(){t.ready(function(i){t.$("[data-uk-tab]",i).each(function(){var i=t.$(this);if(!i.data("tab")){t.tab(i,t.Utils.options(i.attr("data-uk-tab")))}})})},init:function(){var i=this;this.current=!1,this.on("click.uk.tab",this.options.target,function(e){if(e.preventDefault(),!i.switcher||!i.switcher.animating){var n=i.find(i.options.target).not(this);n.removeClass("uk-active").blur(),i.trigger("change.uk.tab",[t.$(this).addClass("uk-active"),i.current]),i.current=t.$(this),i.options.connect||(n.attr("aria-expanded","false"),t.$(this).attr("aria-expanded","true"))}}),this.options.connect&&(this.connect=t.$(this.options.connect)),this.responsivetab=t.$('<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>'),this.responsivetab.dropdown=this.responsivetab.find(".uk-dropdown"),this.responsivetab.lst=this.responsivetab.dropdown.find("ul"),this.responsivetab.caption=this.responsivetab.find("a:first"),this.element.hasClass("uk-tab-bottom")&&this.responsivetab.dropdown.addClass("uk-dropdown-up"),this.responsivetab.lst.on("click.uk.tab","a",function(e){e.preventDefault(),e.stopPropagation();var n=t.$(this);i.element.children("li:not(.uk-tab-responsive)").eq(n.data("index")).trigger("click")}),this.on("show.uk.switcher change.uk.tab",function(t,e){i.responsivetab.caption.html(e.text())}),this.element.append(this.responsivetab),this.options.connect&&(this.switcher=t.switcher(this.element,{toggle:">li:not(.uk-tab-responsive)",connect:this.options.connect,active:this.options.active,animation:this.options.animation,duration:this.options.duration,swiping:this.options.swiping})),t.dropdown(this.responsivetab,{mode:"click",preventflip:"y"}),i.trigger("change.uk.tab",[this.element.find(this.options.target).not(".uk-tab-responsive").filter(".uk-active")]),this.check(),t.$win.on("resize orientationchange",t.Utils.debounce(function(){i.element.is(":visible")&&i.check()},100)),this.on("display.uk.check",function(){i.element.is(":visible")&&i.check()})},check:function(){var i=this.element.children("li:not(.uk-tab-responsive)").removeClass("uk-hidden");if(!i.length)return this.responsivetab.addClass("uk-hidden"),void 0;var e,n,s,a=i.eq(0).offset().top+Math.ceil(i.eq(0).height()/2),o=!1;if(this.responsivetab.lst.empty(),i.each(function(){t.$(this).offset().top>a&&(o=!0)}),o)for(var r=0;r<i.length;r++)e=t.$(i.eq(r)),n=e.find("a"),"none"==e.css("float")||e.attr("uk-dropdown")||(e.hasClass("uk-disabled")||(s=t.$(e[0].outerHTML),s.find("a").data("index",r),this.responsivetab.lst.append(s)),e.addClass("uk-hidden"));this.responsivetab[this.responsivetab.lst.children("li").length?"removeClass":"addClass"]("uk-hidden")}})}(UIkit);
|
@@ -0,0 +1,124 @@
|
|
1
|
+
/*! UIkit 2.27.2 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
2
|
+
(function(UI){
|
3
|
+
|
4
|
+
"use strict";
|
5
|
+
|
6
|
+
var toggles = [];
|
7
|
+
|
8
|
+
UI.component('toggle', {
|
9
|
+
|
10
|
+
defaults: {
|
11
|
+
target : false,
|
12
|
+
cls : 'uk-hidden',
|
13
|
+
animation : false,
|
14
|
+
duration : 200
|
15
|
+
},
|
16
|
+
|
17
|
+
boot: function(){
|
18
|
+
|
19
|
+
// init code
|
20
|
+
UI.ready(function(context) {
|
21
|
+
|
22
|
+
UI.$('[data-uk-toggle]', context).each(function() {
|
23
|
+
var ele = UI.$(this);
|
24
|
+
|
25
|
+
if (!ele.data('toggle')) {
|
26
|
+
var obj = UI.toggle(ele, UI.Utils.options(ele.attr('data-uk-toggle')));
|
27
|
+
}
|
28
|
+
});
|
29
|
+
|
30
|
+
setTimeout(function(){
|
31
|
+
|
32
|
+
toggles.forEach(function(toggle){
|
33
|
+
toggle.getToggles();
|
34
|
+
});
|
35
|
+
|
36
|
+
}, 0);
|
37
|
+
});
|
38
|
+
},
|
39
|
+
|
40
|
+
init: function() {
|
41
|
+
|
42
|
+
var $this = this;
|
43
|
+
|
44
|
+
this.aria = (this.options.cls.indexOf('uk-hidden') !== -1);
|
45
|
+
|
46
|
+
this.on('click', function(e) {
|
47
|
+
|
48
|
+
if ($this.element.is('a[href="#"]')) {
|
49
|
+
e.preventDefault();
|
50
|
+
}
|
51
|
+
|
52
|
+
$this.toggle();
|
53
|
+
});
|
54
|
+
|
55
|
+
toggles.push(this);
|
56
|
+
},
|
57
|
+
|
58
|
+
toggle: function() {
|
59
|
+
|
60
|
+
this.getToggles();
|
61
|
+
|
62
|
+
if(!this.totoggle.length) return;
|
63
|
+
|
64
|
+
if (this.options.animation && UI.support.animation) {
|
65
|
+
|
66
|
+
var $this = this, animations = this.options.animation.split(',');
|
67
|
+
|
68
|
+
if (animations.length == 1) {
|
69
|
+
animations[1] = animations[0];
|
70
|
+
}
|
71
|
+
|
72
|
+
animations[0] = animations[0].trim();
|
73
|
+
animations[1] = animations[1].trim();
|
74
|
+
|
75
|
+
this.totoggle.css('animation-duration', this.options.duration+'ms');
|
76
|
+
|
77
|
+
this.totoggle.each(function(){
|
78
|
+
|
79
|
+
var ele = UI.$(this);
|
80
|
+
|
81
|
+
if (ele.hasClass($this.options.cls)) {
|
82
|
+
|
83
|
+
ele.toggleClass($this.options.cls);
|
84
|
+
|
85
|
+
UI.Utils.animate(ele, animations[0]).then(function(){
|
86
|
+
ele.css('animation-duration', '');
|
87
|
+
UI.Utils.checkDisplay(ele);
|
88
|
+
});
|
89
|
+
|
90
|
+
} else {
|
91
|
+
|
92
|
+
UI.Utils.animate(this, animations[1]+' uk-animation-reverse').then(function(){
|
93
|
+
ele.toggleClass($this.options.cls).css('animation-duration', '');
|
94
|
+
UI.Utils.checkDisplay(ele);
|
95
|
+
});
|
96
|
+
|
97
|
+
}
|
98
|
+
|
99
|
+
});
|
100
|
+
|
101
|
+
} else {
|
102
|
+
this.totoggle.toggleClass(this.options.cls);
|
103
|
+
UI.Utils.checkDisplay(this.totoggle);
|
104
|
+
}
|
105
|
+
|
106
|
+
this.updateAria();
|
107
|
+
|
108
|
+
},
|
109
|
+
|
110
|
+
getToggles: function() {
|
111
|
+
this.totoggle = this.options.target ? UI.$(this.options.target):[];
|
112
|
+
this.updateAria();
|
113
|
+
},
|
114
|
+
|
115
|
+
updateAria: function() {
|
116
|
+
if (this.aria && this.totoggle.length) {
|
117
|
+
this.totoggle.not('[aria-hidden]').each(function(){
|
118
|
+
UI.$(this).attr('aria-hidden', UI.$(this).hasClass('uk-hidden'));
|
119
|
+
});
|
120
|
+
}
|
121
|
+
}
|
122
|
+
});
|
123
|
+
|
124
|
+
})(UIkit);
|
@@ -0,0 +1,2 @@
|
|
1
|
+
/*! UIkit 2.27.2 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
2
|
+
!function(t){"use strict";var i=[];t.component("toggle",{defaults:{target:!1,cls:"uk-hidden",animation:!1,duration:200},boot:function(){t.ready(function(o){t.$("[data-uk-toggle]",o).each(function(){var i=t.$(this);if(!i.data("toggle")){t.toggle(i,t.Utils.options(i.attr("data-uk-toggle")))}}),setTimeout(function(){i.forEach(function(t){t.getToggles()})},0)})},init:function(){var t=this;this.aria=-1!==this.options.cls.indexOf("uk-hidden"),this.on("click",function(i){t.element.is('a[href="#"]')&&i.preventDefault(),t.toggle()}),i.push(this)},toggle:function(){if(this.getToggles(),this.totoggle.length){if(this.options.animation&&t.support.animation){var i=this,o=this.options.animation.split(",");1==o.length&&(o[1]=o[0]),o[0]=o[0].trim(),o[1]=o[1].trim(),this.totoggle.css("animation-duration",this.options.duration+"ms"),this.totoggle.each(function(){var s=t.$(this);s.hasClass(i.options.cls)?(s.toggleClass(i.options.cls),t.Utils.animate(s,o[0]).then(function(){s.css("animation-duration",""),t.Utils.checkDisplay(s)})):t.Utils.animate(this,o[1]+" uk-animation-reverse").then(function(){s.toggleClass(i.options.cls).css("animation-duration",""),t.Utils.checkDisplay(s)})})}else this.totoggle.toggleClass(this.options.cls),t.Utils.checkDisplay(this.totoggle);this.updateAria()}},getToggles:function(){this.totoggle=this.options.target?t.$(this.options.target):[],this.updateAria()},updateAria:function(){this.aria&&this.totoggle.length&&this.totoggle.not("[aria-hidden]").each(function(){t.$(this).attr("aria-hidden",t.$(this).hasClass("uk-hidden"))})}})}(UIkit);
|
@@ -0,0 +1,175 @@
|
|
1
|
+
/*! UIkit 2.27.2 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
2
|
+
// Based on Zeptos touch.js
|
3
|
+
// https://raw.github.com/madrobby/zepto/master/src/touch.js
|
4
|
+
// Zepto.js may be freely distributed under the MIT license.
|
5
|
+
|
6
|
+
;(function($){
|
7
|
+
|
8
|
+
if ($.fn.swipeLeft) {
|
9
|
+
return;
|
10
|
+
}
|
11
|
+
|
12
|
+
|
13
|
+
var touch = {}, touchTimeout, tapTimeout, swipeTimeout, longTapTimeout, longTapDelay = 750, gesture;
|
14
|
+
|
15
|
+
function swipeDirection(x1, x2, y1, y2) {
|
16
|
+
return Math.abs(x1 - x2) >= Math.abs(y1 - y2) ? (x1 - x2 > 0 ? 'Left' : 'Right') : (y1 - y2 > 0 ? 'Up' : 'Down');
|
17
|
+
}
|
18
|
+
|
19
|
+
function longTap() {
|
20
|
+
longTapTimeout = null;
|
21
|
+
if (touch.last) {
|
22
|
+
if ( touch.el !== undefined ) touch.el.trigger('longTap');
|
23
|
+
touch = {};
|
24
|
+
}
|
25
|
+
}
|
26
|
+
|
27
|
+
function cancelLongTap() {
|
28
|
+
if (longTapTimeout) clearTimeout(longTapTimeout);
|
29
|
+
longTapTimeout = null;
|
30
|
+
}
|
31
|
+
|
32
|
+
function cancelAll() {
|
33
|
+
if (touchTimeout) clearTimeout(touchTimeout);
|
34
|
+
if (tapTimeout) clearTimeout(tapTimeout);
|
35
|
+
if (swipeTimeout) clearTimeout(swipeTimeout);
|
36
|
+
if (longTapTimeout) clearTimeout(longTapTimeout);
|
37
|
+
touchTimeout = tapTimeout = swipeTimeout = longTapTimeout = null;
|
38
|
+
touch = {};
|
39
|
+
}
|
40
|
+
|
41
|
+
function isPrimaryTouch(event){
|
42
|
+
return event.pointerType == event.MSPOINTER_TYPE_TOUCH && event.isPrimary;
|
43
|
+
}
|
44
|
+
|
45
|
+
$(function(){
|
46
|
+
var now, delta, deltaX = 0, deltaY = 0, firstTouch;
|
47
|
+
|
48
|
+
if ('MSGesture' in window) {
|
49
|
+
gesture = new MSGesture();
|
50
|
+
gesture.target = document.body;
|
51
|
+
}
|
52
|
+
|
53
|
+
$(document)
|
54
|
+
.on('MSGestureEnd gestureend', function(e){
|
55
|
+
|
56
|
+
var swipeDirectionFromVelocity = e.originalEvent.velocityX > 1 ? 'Right' : e.originalEvent.velocityX < -1 ? 'Left' : e.originalEvent.velocityY > 1 ? 'Down' : e.originalEvent.velocityY < -1 ? 'Up' : null;
|
57
|
+
|
58
|
+
if (swipeDirectionFromVelocity && touch.el !== undefined) {
|
59
|
+
touch.el.trigger('swipe');
|
60
|
+
touch.el.trigger('swipe'+ swipeDirectionFromVelocity);
|
61
|
+
}
|
62
|
+
})
|
63
|
+
// MSPointerDown: for IE10
|
64
|
+
// pointerdown: for IE11
|
65
|
+
.on('touchstart MSPointerDown pointerdown', function(e){
|
66
|
+
|
67
|
+
if(e.type == 'MSPointerDown' && !isPrimaryTouch(e.originalEvent)) return;
|
68
|
+
|
69
|
+
firstTouch = (e.type == 'MSPointerDown' || e.type == 'pointerdown') ? e : e.originalEvent.touches[0];
|
70
|
+
|
71
|
+
now = Date.now();
|
72
|
+
delta = now - (touch.last || now);
|
73
|
+
touch.el = $('tagName' in firstTouch.target ? firstTouch.target : firstTouch.target.parentNode);
|
74
|
+
|
75
|
+
if(touchTimeout) clearTimeout(touchTimeout);
|
76
|
+
|
77
|
+
touch.x1 = firstTouch.pageX;
|
78
|
+
touch.y1 = firstTouch.pageY;
|
79
|
+
|
80
|
+
if (delta > 0 && delta <= 250) touch.isDoubleTap = true;
|
81
|
+
|
82
|
+
touch.last = now;
|
83
|
+
longTapTimeout = setTimeout(longTap, longTapDelay);
|
84
|
+
|
85
|
+
// adds the current touch contact for IE gesture recognition
|
86
|
+
if (e.originalEvent && e.originalEvent.pointerId && gesture && ( e.type == 'MSPointerDown' || e.type == 'pointerdown' || e.type == 'touchstart' ) ) {
|
87
|
+
gesture.addPointer(e.originalEvent.pointerId);
|
88
|
+
}
|
89
|
+
|
90
|
+
})
|
91
|
+
// MSPointerMove: for IE10
|
92
|
+
// pointermove: for IE11
|
93
|
+
.on('touchmove MSPointerMove pointermove', function(e){
|
94
|
+
|
95
|
+
if (e.type == 'MSPointerMove' && !isPrimaryTouch(e.originalEvent)) return;
|
96
|
+
|
97
|
+
firstTouch = (e.type == 'MSPointerMove' || e.type == 'pointermove') ? e : e.originalEvent.touches[0];
|
98
|
+
|
99
|
+
cancelLongTap();
|
100
|
+
touch.x2 = firstTouch.pageX;
|
101
|
+
touch.y2 = firstTouch.pageY;
|
102
|
+
|
103
|
+
deltaX += Math.abs(touch.x1 - touch.x2);
|
104
|
+
deltaY += Math.abs(touch.y1 - touch.y2);
|
105
|
+
})
|
106
|
+
// MSPointerUp: for IE10
|
107
|
+
// pointerup: for IE11
|
108
|
+
.on('touchend MSPointerUp pointerup', function(e){
|
109
|
+
|
110
|
+
if (e.type == 'MSPointerUp' && !isPrimaryTouch(e.originalEvent)) return;
|
111
|
+
|
112
|
+
cancelLongTap();
|
113
|
+
|
114
|
+
// swipe
|
115
|
+
if ((touch.x2 && Math.abs(touch.x1 - touch.x2) > 30) || (touch.y2 && Math.abs(touch.y1 - touch.y2) > 30)){
|
116
|
+
|
117
|
+
swipeTimeout = setTimeout(function() {
|
118
|
+
if ( touch.el !== undefined ) {
|
119
|
+
touch.el.trigger('swipe');
|
120
|
+
touch.el.trigger('swipe' + (swipeDirection(touch.x1, touch.x2, touch.y1, touch.y2)));
|
121
|
+
}
|
122
|
+
touch = {};
|
123
|
+
}, 0);
|
124
|
+
|
125
|
+
// normal tap
|
126
|
+
} else if ('last' in touch) {
|
127
|
+
|
128
|
+
// don't fire tap when delta position changed by more than 30 pixels,
|
129
|
+
// for instance when moving to a point and back to origin
|
130
|
+
if (isNaN(deltaX) || (deltaX < 30 && deltaY < 30)) {
|
131
|
+
// delay by one tick so we can cancel the 'tap' event if 'scroll' fires
|
132
|
+
// ('tap' fires before 'scroll')
|
133
|
+
tapTimeout = setTimeout(function() {
|
134
|
+
|
135
|
+
// trigger universal 'tap' with the option to cancelTouch()
|
136
|
+
// (cancelTouch cancels processing of single vs double taps for faster 'tap' response)
|
137
|
+
var event = $.Event('tap');
|
138
|
+
event.cancelTouch = cancelAll;
|
139
|
+
if ( touch.el !== undefined ) touch.el.trigger(event);
|
140
|
+
|
141
|
+
// trigger double tap immediately
|
142
|
+
if (touch.isDoubleTap) {
|
143
|
+
if ( touch.el !== undefined ) touch.el.trigger('doubleTap');
|
144
|
+
touch = {};
|
145
|
+
}
|
146
|
+
|
147
|
+
// trigger single tap after 250ms of inactivity
|
148
|
+
else {
|
149
|
+
touchTimeout = setTimeout(function(){
|
150
|
+
touchTimeout = null;
|
151
|
+
if ( touch.el !== undefined ) touch.el.trigger('singleTap');
|
152
|
+
touch = {};
|
153
|
+
}, 250);
|
154
|
+
}
|
155
|
+
}, 0);
|
156
|
+
} else {
|
157
|
+
touch = {};
|
158
|
+
}
|
159
|
+
deltaX = deltaY = 0;
|
160
|
+
}
|
161
|
+
})
|
162
|
+
// when the browser window loses focus,
|
163
|
+
// for example when a modal dialog is shown,
|
164
|
+
// cancel all ongoing events
|
165
|
+
.on('touchcancel MSPointerCancel pointercancel', cancelAll);
|
166
|
+
|
167
|
+
// scrolling the window indicates intention of the user
|
168
|
+
// to scroll, not tap or swipe, so cancel all ongoing events
|
169
|
+
$(window).on('scroll', cancelAll);
|
170
|
+
});
|
171
|
+
|
172
|
+
['swipe', 'swipeLeft', 'swipeRight', 'swipeUp', 'swipeDown', 'doubleTap', 'tap', 'singleTap', 'longTap'].forEach(function(eventName){
|
173
|
+
$.fn[eventName] = function(callback){ return $(this).on(eventName, callback); };
|
174
|
+
});
|
175
|
+
})(jQuery);
|
@@ -0,0 +1,2 @@
|
|
1
|
+
/*! UIkit 2.27.2 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
2
|
+
!function(e){function t(e,t,n,i){return Math.abs(e-t)>=Math.abs(n-i)?e-t>0?"Left":"Right":n-i>0?"Up":"Down"}function n(){p=null,g.last&&(void 0!==g.el&&g.el.trigger("longTap"),g={})}function i(){p&&clearTimeout(p),p=null}function o(){a&&clearTimeout(a),l&&clearTimeout(l),u&&clearTimeout(u),p&&clearTimeout(p),a=l=u=p=null,g={}}function r(e){return e.pointerType==e.MSPOINTER_TYPE_TOUCH&&e.isPrimary}if(!e.fn.swipeLeft){var a,l,u,p,c,g={},s=750;e(function(){var v,y,w,d=0,f=0;"MSGesture"in window&&(c=new MSGesture,c.target=document.body),e(document).on("MSGestureEnd gestureend",function(e){var t=e.originalEvent.velocityX>1?"Right":e.originalEvent.velocityX<-1?"Left":e.originalEvent.velocityY>1?"Down":e.originalEvent.velocityY<-1?"Up":null;t&&void 0!==g.el&&(g.el.trigger("swipe"),g.el.trigger("swipe"+t))}).on("touchstart MSPointerDown pointerdown",function(t){("MSPointerDown"!=t.type||r(t.originalEvent))&&(w="MSPointerDown"==t.type||"pointerdown"==t.type?t:t.originalEvent.touches[0],v=Date.now(),y=v-(g.last||v),g.el=e("tagName"in w.target?w.target:w.target.parentNode),a&&clearTimeout(a),g.x1=w.pageX,g.y1=w.pageY,y>0&&250>=y&&(g.isDoubleTap=!0),g.last=v,p=setTimeout(n,s),t.originalEvent&&t.originalEvent.pointerId&&c&&("MSPointerDown"==t.type||"pointerdown"==t.type||"touchstart"==t.type)&&c.addPointer(t.originalEvent.pointerId))}).on("touchmove MSPointerMove pointermove",function(e){("MSPointerMove"!=e.type||r(e.originalEvent))&&(w="MSPointerMove"==e.type||"pointermove"==e.type?e:e.originalEvent.touches[0],i(),g.x2=w.pageX,g.y2=w.pageY,d+=Math.abs(g.x1-g.x2),f+=Math.abs(g.y1-g.y2))}).on("touchend MSPointerUp pointerup",function(n){("MSPointerUp"!=n.type||r(n.originalEvent))&&(i(),g.x2&&Math.abs(g.x1-g.x2)>30||g.y2&&Math.abs(g.y1-g.y2)>30?u=setTimeout(function(){void 0!==g.el&&(g.el.trigger("swipe"),g.el.trigger("swipe"+t(g.x1,g.x2,g.y1,g.y2))),g={}},0):"last"in g&&(isNaN(d)||30>d&&30>f?l=setTimeout(function(){var t=e.Event("tap");t.cancelTouch=o,void 0!==g.el&&g.el.trigger(t),g.isDoubleTap?(void 0!==g.el&&g.el.trigger("doubleTap"),g={}):a=setTimeout(function(){a=null,void 0!==g.el&&g.el.trigger("singleTap"),g={}},250)},0):g={},d=f=0))}).on("touchcancel MSPointerCancel pointercancel",o),e(window).on("scroll",o)}),["swipe","swipeLeft","swipeRight","swipeUp","swipeDown","doubleTap","tap","singleTap","longTap"].forEach(function(t){e.fn[t]=function(n){return e(this).on(t,n)}})}}(jQuery);
|
@@ -0,0 +1,335 @@
|
|
1
|
+
/*! UIkit 2.27.2 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
2
|
+
(function(UI) {
|
3
|
+
|
4
|
+
"use strict";
|
5
|
+
|
6
|
+
var stacks = [];
|
7
|
+
|
8
|
+
UI.component('stackMargin', {
|
9
|
+
|
10
|
+
defaults: {
|
11
|
+
cls: 'uk-margin-small-top',
|
12
|
+
rowfirst: false,
|
13
|
+
observe: false
|
14
|
+
},
|
15
|
+
|
16
|
+
boot: function() {
|
17
|
+
|
18
|
+
// init code
|
19
|
+
UI.ready(function(context) {
|
20
|
+
|
21
|
+
UI.$('[data-uk-margin]', context).each(function() {
|
22
|
+
|
23
|
+
var ele = UI.$(this);
|
24
|
+
|
25
|
+
if (!ele.data('stackMargin')) {
|
26
|
+
UI.stackMargin(ele, UI.Utils.options(ele.attr('data-uk-margin')));
|
27
|
+
}
|
28
|
+
});
|
29
|
+
});
|
30
|
+
},
|
31
|
+
|
32
|
+
init: function() {
|
33
|
+
|
34
|
+
var $this = this;
|
35
|
+
|
36
|
+
UI.$win.on('resize orientationchange', (function() {
|
37
|
+
|
38
|
+
var fn = function() {
|
39
|
+
$this.process();
|
40
|
+
};
|
41
|
+
|
42
|
+
UI.$(function() {
|
43
|
+
fn();
|
44
|
+
UI.$win.on('load', fn);
|
45
|
+
});
|
46
|
+
|
47
|
+
return UI.Utils.debounce(fn, 20);
|
48
|
+
})());
|
49
|
+
|
50
|
+
this.on('display.uk.check', function(e) {
|
51
|
+
if (this.element.is(':visible')) this.process();
|
52
|
+
}.bind(this));
|
53
|
+
|
54
|
+
if (this.options.observe) {
|
55
|
+
|
56
|
+
UI.domObserve(this.element, function(e) {
|
57
|
+
if ($this.element.is(':visible')) $this.process();
|
58
|
+
});
|
59
|
+
}
|
60
|
+
|
61
|
+
stacks.push(this);
|
62
|
+
},
|
63
|
+
|
64
|
+
process: function() {
|
65
|
+
|
66
|
+
var $this = this, columns = this.element.children();
|
67
|
+
|
68
|
+
UI.Utils.stackMargin(columns, this.options);
|
69
|
+
|
70
|
+
if (!this.options.rowfirst || !columns.length) {
|
71
|
+
return this;
|
72
|
+
}
|
73
|
+
|
74
|
+
// Mark first column elements
|
75
|
+
var group = {}, minleft = false;
|
76
|
+
|
77
|
+
columns.removeClass(this.options.rowfirst).each(function(offset, $ele){
|
78
|
+
|
79
|
+
$ele = UI.$(this);
|
80
|
+
|
81
|
+
if (this.style.display != 'none') {
|
82
|
+
offset = $ele.offset().left;
|
83
|
+
((group[offset] = group[offset] || []) && group[offset]).push(this);
|
84
|
+
minleft = minleft === false ? offset : Math.min(minleft, offset);
|
85
|
+
}
|
86
|
+
});
|
87
|
+
|
88
|
+
UI.$(group[minleft]).addClass(this.options.rowfirst);
|
89
|
+
|
90
|
+
return this;
|
91
|
+
}
|
92
|
+
|
93
|
+
});
|
94
|
+
|
95
|
+
|
96
|
+
// responsive element e.g. iframes
|
97
|
+
|
98
|
+
(function(){
|
99
|
+
|
100
|
+
var elements = [], check = function(ele) {
|
101
|
+
|
102
|
+
if (!ele.is(':visible')) return;
|
103
|
+
|
104
|
+
var width = ele.parent().width(),
|
105
|
+
iwidth = ele.data('width'),
|
106
|
+
ratio = (width / iwidth),
|
107
|
+
height = Math.floor(ratio * ele.data('height'));
|
108
|
+
|
109
|
+
ele.css({height: (width < iwidth) ? height : ele.data('height')});
|
110
|
+
};
|
111
|
+
|
112
|
+
UI.component('responsiveElement', {
|
113
|
+
|
114
|
+
defaults: {},
|
115
|
+
|
116
|
+
boot: function() {
|
117
|
+
|
118
|
+
// init code
|
119
|
+
UI.ready(function(context) {
|
120
|
+
|
121
|
+
UI.$('iframe.uk-responsive-width, [data-uk-responsive]', context).each(function() {
|
122
|
+
|
123
|
+
var ele = UI.$(this), obj;
|
124
|
+
|
125
|
+
if (!ele.data('responsiveElement')) {
|
126
|
+
obj = UI.responsiveElement(ele, {});
|
127
|
+
}
|
128
|
+
});
|
129
|
+
});
|
130
|
+
},
|
131
|
+
|
132
|
+
init: function() {
|
133
|
+
|
134
|
+
var ele = this.element;
|
135
|
+
|
136
|
+
if (ele.attr('width') && ele.attr('height')) {
|
137
|
+
|
138
|
+
ele.data({
|
139
|
+
width : ele.attr('width'),
|
140
|
+
height: ele.attr('height')
|
141
|
+
}).on('display.uk.check', function(){
|
142
|
+
check(ele);
|
143
|
+
});
|
144
|
+
|
145
|
+
check(ele);
|
146
|
+
|
147
|
+
elements.push(ele);
|
148
|
+
}
|
149
|
+
}
|
150
|
+
});
|
151
|
+
|
152
|
+
UI.$win.on('resize load', UI.Utils.debounce(function(){
|
153
|
+
|
154
|
+
elements.forEach(function(ele){
|
155
|
+
check(ele);
|
156
|
+
});
|
157
|
+
|
158
|
+
}, 15));
|
159
|
+
|
160
|
+
})();
|
161
|
+
|
162
|
+
|
163
|
+
// helper
|
164
|
+
|
165
|
+
UI.Utils.stackMargin = function(elements, options) {
|
166
|
+
|
167
|
+
options = UI.$.extend({
|
168
|
+
cls: 'uk-margin-small-top'
|
169
|
+
}, options);
|
170
|
+
|
171
|
+
elements = UI.$(elements).removeClass(options.cls);
|
172
|
+
|
173
|
+
var min = false;
|
174
|
+
|
175
|
+
elements.each(function(offset, height, pos, $ele){
|
176
|
+
|
177
|
+
$ele = UI.$(this);
|
178
|
+
|
179
|
+
if ($ele.css('display') != 'none') {
|
180
|
+
|
181
|
+
offset = $ele.offset();
|
182
|
+
height = $ele.outerHeight();
|
183
|
+
pos = offset.top + height;
|
184
|
+
|
185
|
+
$ele.data({
|
186
|
+
ukMarginPos: pos,
|
187
|
+
ukMarginTop: offset.top
|
188
|
+
});
|
189
|
+
|
190
|
+
if (min === false || (offset.top < min.top) ) {
|
191
|
+
|
192
|
+
min = {
|
193
|
+
top : offset.top,
|
194
|
+
left : offset.left,
|
195
|
+
pos : pos
|
196
|
+
};
|
197
|
+
}
|
198
|
+
}
|
199
|
+
|
200
|
+
}).each(function($ele) {
|
201
|
+
|
202
|
+
$ele = UI.$(this);
|
203
|
+
|
204
|
+
if ($ele.css('display') != 'none' && $ele.data('ukMarginTop') > min.top && $ele.data('ukMarginPos') > min.pos) {
|
205
|
+
$ele.addClass(options.cls);
|
206
|
+
}
|
207
|
+
});
|
208
|
+
};
|
209
|
+
|
210
|
+
UI.Utils.matchHeights = function(elements, options) {
|
211
|
+
|
212
|
+
elements = UI.$(elements).css('min-height', '');
|
213
|
+
options = UI.$.extend({ row : true }, options);
|
214
|
+
|
215
|
+
var matchHeights = function(group){
|
216
|
+
|
217
|
+
if (group.length < 2) return;
|
218
|
+
|
219
|
+
var max = 0;
|
220
|
+
|
221
|
+
group.each(function() {
|
222
|
+
max = Math.max(max, UI.$(this).outerHeight());
|
223
|
+
}).each(function() {
|
224
|
+
|
225
|
+
var element = UI.$(this),
|
226
|
+
height = max - (element.css('box-sizing') == 'border-box' ? 0 : (element.outerHeight() - element.height()));
|
227
|
+
|
228
|
+
element.css('min-height', height + 'px');
|
229
|
+
});
|
230
|
+
};
|
231
|
+
|
232
|
+
if (options.row) {
|
233
|
+
|
234
|
+
elements.first().width(); // force redraw
|
235
|
+
|
236
|
+
setTimeout(function(){
|
237
|
+
|
238
|
+
var lastoffset = false, group = [];
|
239
|
+
|
240
|
+
elements.each(function() {
|
241
|
+
|
242
|
+
var ele = UI.$(this), offset = ele.offset().top;
|
243
|
+
|
244
|
+
if (offset != lastoffset && group.length) {
|
245
|
+
|
246
|
+
matchHeights(UI.$(group));
|
247
|
+
group = [];
|
248
|
+
offset = ele.offset().top;
|
249
|
+
}
|
250
|
+
|
251
|
+
group.push(ele);
|
252
|
+
lastoffset = offset;
|
253
|
+
});
|
254
|
+
|
255
|
+
if (group.length) {
|
256
|
+
matchHeights(UI.$(group));
|
257
|
+
}
|
258
|
+
|
259
|
+
}, 0);
|
260
|
+
|
261
|
+
} else {
|
262
|
+
matchHeights(elements);
|
263
|
+
}
|
264
|
+
};
|
265
|
+
|
266
|
+
(function(cacheSvgs){
|
267
|
+
|
268
|
+
UI.Utils.inlineSvg = function(selector, root) {
|
269
|
+
|
270
|
+
var images = UI.$(selector || 'img[src$=".svg"]', root || document).each(function(){
|
271
|
+
|
272
|
+
var img = UI.$(this),
|
273
|
+
src = img.attr('src');
|
274
|
+
|
275
|
+
if (!cacheSvgs[src]) {
|
276
|
+
|
277
|
+
var d = UI.$.Deferred();
|
278
|
+
|
279
|
+
UI.$.get(src, {nc: Math.random()}, function(data){
|
280
|
+
d.resolve(UI.$(data).find('svg'));
|
281
|
+
});
|
282
|
+
|
283
|
+
cacheSvgs[src] = d.promise();
|
284
|
+
}
|
285
|
+
|
286
|
+
cacheSvgs[src].then(function(svg) {
|
287
|
+
|
288
|
+
var $svg = UI.$(svg).clone();
|
289
|
+
|
290
|
+
if (img.attr('id')) $svg.attr('id', img.attr('id'));
|
291
|
+
if (img.attr('class')) $svg.attr('class', img.attr('class'));
|
292
|
+
if (img.attr('style')) $svg.attr('style', img.attr('style'));
|
293
|
+
|
294
|
+
if (img.attr('width')) {
|
295
|
+
$svg.attr('width', img.attr('width'));
|
296
|
+
if (!img.attr('height')) $svg.removeAttr('height');
|
297
|
+
}
|
298
|
+
|
299
|
+
if (img.attr('height')){
|
300
|
+
$svg.attr('height', img.attr('height'));
|
301
|
+
if (!img.attr('width')) $svg.removeAttr('width');
|
302
|
+
}
|
303
|
+
|
304
|
+
img.replaceWith($svg);
|
305
|
+
});
|
306
|
+
});
|
307
|
+
};
|
308
|
+
|
309
|
+
// init code
|
310
|
+
UI.ready(function(context) {
|
311
|
+
UI.Utils.inlineSvg('[data-uk-svg]', context);
|
312
|
+
});
|
313
|
+
|
314
|
+
})({});
|
315
|
+
|
316
|
+
UI.Utils.getCssVar = function(name) {
|
317
|
+
|
318
|
+
/* usage in css: .var-name:before { content:"xyz" } */
|
319
|
+
|
320
|
+
var val, doc = document.documentElement, element = doc.appendChild(document.createElement('div'));
|
321
|
+
|
322
|
+
element.classList.add('var-'+name);
|
323
|
+
|
324
|
+
try {
|
325
|
+
val = JSON.parse(val = getComputedStyle(element, ':before').content.replace(/^["'](.*)["']$/, '$1'));
|
326
|
+
} catch (e) {
|
327
|
+
val = undefined;
|
328
|
+
}
|
329
|
+
|
330
|
+
doc.removeChild(element);
|
331
|
+
|
332
|
+
return val;
|
333
|
+
}
|
334
|
+
|
335
|
+
})(UIkit);
|