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";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.uikit.tab",this.options.target,function(e){if(e.preventDefault(),!i.switcher||!i.switcher.animating){var s=i.find(i.options.target).not(this);s.removeClass("uk-active").blur(),i.trigger("change.uk.tab",[t.$(this).addClass("uk-active"),i.current]),i.current=t.$(this),i.options.connect||(s.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.uikit.tab","a",function(e){e.preventDefault(),e.stopPropagation();var s=t.$(this);i.element.children("li:not(.uk-tab-responsive)").eq(s.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"}),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,s,n,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)),s=e.find("a"),"none"==e.css("float")||e.attr("uk-dropdown")||(e.hasClass("uk-disabled")||(n=e[0].outerHTML.replace("<a ",'<a data-index="'+r+'" '),this.responsivetab.lst.append(n)),e.addClass("uk-hidden"));this.responsivetab[this.responsivetab.lst.children("li").length?"removeClass":"addClass"]("uk-hidden")}})}(UIkit);
|
@@ -0,0 +1,120 @@
|
|
1
|
+
/*! UIkit 2.24.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.getToggles();
|
47
|
+
|
48
|
+
this.on("click", function(e) {
|
49
|
+
if ($this.element.is('a[href="#"]')) e.preventDefault();
|
50
|
+
$this.toggle();
|
51
|
+
});
|
52
|
+
|
53
|
+
toggles.push(this);
|
54
|
+
},
|
55
|
+
|
56
|
+
toggle: function() {
|
57
|
+
|
58
|
+
if(!this.totoggle.length) return;
|
59
|
+
|
60
|
+
if (this.options.animation && UI.support.animation) {
|
61
|
+
|
62
|
+
var $this = this, animations = this.options.animation.split(',');
|
63
|
+
|
64
|
+
if (animations.length == 1) {
|
65
|
+
animations[1] = animations[0];
|
66
|
+
}
|
67
|
+
|
68
|
+
animations[0] = animations[0].trim();
|
69
|
+
animations[1] = animations[1].trim();
|
70
|
+
|
71
|
+
this.totoggle.css('animation-duration', this.options.duration+'ms');
|
72
|
+
|
73
|
+
this.totoggle.each(function(){
|
74
|
+
|
75
|
+
var ele = UI.$(this);
|
76
|
+
|
77
|
+
if (ele.hasClass($this.options.cls)) {
|
78
|
+
|
79
|
+
ele.toggleClass($this.options.cls);
|
80
|
+
|
81
|
+
UI.Utils.animate(ele, animations[0]).then(function(){
|
82
|
+
ele.css('animation-duration', '');
|
83
|
+
UI.Utils.checkDisplay(ele);
|
84
|
+
});
|
85
|
+
|
86
|
+
} else {
|
87
|
+
|
88
|
+
UI.Utils.animate(this, animations[1]+' uk-animation-reverse').then(function(){
|
89
|
+
ele.toggleClass($this.options.cls).css('animation-duration', '');
|
90
|
+
UI.Utils.checkDisplay(ele);
|
91
|
+
});
|
92
|
+
|
93
|
+
}
|
94
|
+
|
95
|
+
});
|
96
|
+
|
97
|
+
} else {
|
98
|
+
this.totoggle.toggleClass(this.options.cls);
|
99
|
+
UI.Utils.checkDisplay(this.totoggle);
|
100
|
+
}
|
101
|
+
|
102
|
+
this.updateAria();
|
103
|
+
|
104
|
+
},
|
105
|
+
|
106
|
+
getToggles: function() {
|
107
|
+
this.totoggle = this.options.target ? UI.$(this.options.target):[];
|
108
|
+
this.updateAria();
|
109
|
+
},
|
110
|
+
|
111
|
+
updateAria: function() {
|
112
|
+
if (this.aria && this.totoggle.length) {
|
113
|
+
this.totoggle.each(function(){
|
114
|
+
UI.$(this).attr('aria-hidden', UI.$(this).hasClass('uk-hidden'));
|
115
|
+
});
|
116
|
+
}
|
117
|
+
}
|
118
|
+
});
|
119
|
+
|
120
|
+
})(UIkit);
|
@@ -0,0 +1,2 @@
|
|
1
|
+
/*! UIkit 2.24.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.getToggles(),this.on("click",function(i){t.element.is('a[href="#"]')&&i.preventDefault(),t.toggle()}),i.push(this)},toggle:function(){if(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.each(function(){t.$(this).attr("aria-hidden",t.$(this).hasClass("uk-hidden"))})}})}(UIkit);
|
@@ -0,0 +1,175 @@
|
|
1
|
+
/*! UIkit 2.24.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 (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', 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.24.2 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
2
|
+
!function(e){function t(e,t,n,o){return Math.abs(e-t)>=Math.abs(n-o)?e-t>0?"Left":"Right":n-o>0?"Up":"Down"}function n(){p=null,g.last&&(void 0!==g.el&&g.el.trigger("longTap"),g={})}function o(){p&&clearTimeout(p),p=null}function i(){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,f=0,d=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),!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],o(),g.x2=w.pageX,g.y2=w.pageY,f+=Math.abs(g.x1-g.x2),d+=Math.abs(g.y1-g.y2))}).on("touchend MSPointerUp pointerup",function(n){("MSPointerUp"!=n.type||r(n.originalEvent))&&(o(),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(f)||30>f&&30>d?l=setTimeout(function(){var t=e.Event("tap");t.cancelTouch=i,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={},f=d=0))}).on("touchcancel MSPointerCancel",i),e(window).on("scroll",i)}),["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,289 @@
|
|
1
|
+
/*! UIkit 2.24.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
|
+
},
|
13
|
+
|
14
|
+
boot: function() {
|
15
|
+
|
16
|
+
// init code
|
17
|
+
UI.ready(function(context) {
|
18
|
+
|
19
|
+
UI.$("[data-uk-margin]", context).each(function() {
|
20
|
+
|
21
|
+
var ele = UI.$(this), obj;
|
22
|
+
|
23
|
+
if (!ele.data("stackMargin")) {
|
24
|
+
obj = UI.stackMargin(ele, UI.Utils.options(ele.attr("data-uk-margin")));
|
25
|
+
}
|
26
|
+
});
|
27
|
+
});
|
28
|
+
},
|
29
|
+
|
30
|
+
init: function() {
|
31
|
+
|
32
|
+
var $this = this;
|
33
|
+
|
34
|
+
this.columns = [];
|
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
|
+
UI.$html.on("changed.uk.dom", function(e) {
|
51
|
+
$this.process();
|
52
|
+
});
|
53
|
+
|
54
|
+
this.on("display.uk.check", function(e) {
|
55
|
+
if (this.element.is(":visible")) this.process();
|
56
|
+
}.bind(this));
|
57
|
+
|
58
|
+
stacks.push(this);
|
59
|
+
},
|
60
|
+
|
61
|
+
process: function() {
|
62
|
+
|
63
|
+
this.columns = this.element.children();
|
64
|
+
|
65
|
+
UI.Utils.stackMargin(this.columns, this.options);
|
66
|
+
|
67
|
+
return this;
|
68
|
+
},
|
69
|
+
|
70
|
+
revert: function() {
|
71
|
+
this.columns.removeClass(this.options.cls);
|
72
|
+
return this;
|
73
|
+
}
|
74
|
+
});
|
75
|
+
|
76
|
+
|
77
|
+
// responsive element e.g. iframes
|
78
|
+
|
79
|
+
(function(){
|
80
|
+
|
81
|
+
var elements = [], check = function(ele) {
|
82
|
+
|
83
|
+
if (!ele.is(':visible')) return;
|
84
|
+
|
85
|
+
var width = ele.parent().width(),
|
86
|
+
iwidth = ele.data('width'),
|
87
|
+
ratio = (width / iwidth),
|
88
|
+
height = Math.floor(ratio * ele.data('height'));
|
89
|
+
|
90
|
+
ele.css({'height': (width < iwidth) ? height : ele.data('height')});
|
91
|
+
};
|
92
|
+
|
93
|
+
UI.component('responsiveElement', {
|
94
|
+
|
95
|
+
defaults: {},
|
96
|
+
|
97
|
+
boot: function() {
|
98
|
+
|
99
|
+
// init code
|
100
|
+
UI.ready(function(context) {
|
101
|
+
|
102
|
+
UI.$("iframe.uk-responsive-width, [data-uk-responsive]", context).each(function() {
|
103
|
+
|
104
|
+
var ele = UI.$(this), obj;
|
105
|
+
|
106
|
+
if (!ele.data("responsiveIframe")) {
|
107
|
+
obj = UI.responsiveElement(ele, {});
|
108
|
+
}
|
109
|
+
});
|
110
|
+
});
|
111
|
+
},
|
112
|
+
|
113
|
+
init: function() {
|
114
|
+
|
115
|
+
var ele = this.element;
|
116
|
+
|
117
|
+
if (ele.attr('width') && ele.attr('height')) {
|
118
|
+
|
119
|
+
ele.data({
|
120
|
+
|
121
|
+
'width' : ele.attr('width'),
|
122
|
+
'height': ele.attr('height')
|
123
|
+
|
124
|
+
}).on('display.uk.check', function(){
|
125
|
+
check(ele);
|
126
|
+
});
|
127
|
+
|
128
|
+
check(ele);
|
129
|
+
|
130
|
+
elements.push(ele);
|
131
|
+
}
|
132
|
+
}
|
133
|
+
});
|
134
|
+
|
135
|
+
UI.$win.on('resize load', UI.Utils.debounce(function(){
|
136
|
+
|
137
|
+
elements.forEach(function(ele){
|
138
|
+
check(ele);
|
139
|
+
});
|
140
|
+
|
141
|
+
}, 15));
|
142
|
+
|
143
|
+
})();
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
// helper
|
148
|
+
|
149
|
+
UI.Utils.stackMargin = function(elements, options) {
|
150
|
+
|
151
|
+
options = UI.$.extend({
|
152
|
+
'cls': 'uk-margin-small-top'
|
153
|
+
}, options);
|
154
|
+
|
155
|
+
options.cls = options.cls;
|
156
|
+
|
157
|
+
elements = UI.$(elements).removeClass(options.cls);
|
158
|
+
|
159
|
+
var skip = false,
|
160
|
+
firstvisible = elements.filter(":visible:first"),
|
161
|
+
offset = firstvisible.length ? (firstvisible.position().top + firstvisible.outerHeight()) - 1 : false; // (-1): weird firefox bug when parent container is display:flex
|
162
|
+
|
163
|
+
if (offset === false || elements.length == 1) return;
|
164
|
+
|
165
|
+
elements.each(function() {
|
166
|
+
|
167
|
+
var column = UI.$(this);
|
168
|
+
|
169
|
+
if (column.is(":visible")) {
|
170
|
+
|
171
|
+
if (skip) {
|
172
|
+
column.addClass(options.cls);
|
173
|
+
} else {
|
174
|
+
|
175
|
+
if (column.position().top >= offset) {
|
176
|
+
skip = column.addClass(options.cls);
|
177
|
+
}
|
178
|
+
}
|
179
|
+
}
|
180
|
+
});
|
181
|
+
};
|
182
|
+
|
183
|
+
UI.Utils.matchHeights = function(elements, options) {
|
184
|
+
|
185
|
+
elements = UI.$(elements).css('min-height', '');
|
186
|
+
options = UI.$.extend({ row : true }, options);
|
187
|
+
|
188
|
+
var matchHeights = function(group){
|
189
|
+
|
190
|
+
if (group.length < 2) return;
|
191
|
+
|
192
|
+
var max = 0;
|
193
|
+
|
194
|
+
group.each(function() {
|
195
|
+
max = Math.max(max, UI.$(this).outerHeight());
|
196
|
+
}).each(function() {
|
197
|
+
|
198
|
+
var element = UI.$(this),
|
199
|
+
height = max - (element.css('box-sizing') == 'border-box' ? 0 : (element.outerHeight() - element.height()));
|
200
|
+
|
201
|
+
element.css('min-height', height + 'px');
|
202
|
+
});
|
203
|
+
};
|
204
|
+
|
205
|
+
if (options.row) {
|
206
|
+
|
207
|
+
elements.first().width(); // force redraw
|
208
|
+
|
209
|
+
setTimeout(function(){
|
210
|
+
|
211
|
+
var lastoffset = false, group = [];
|
212
|
+
|
213
|
+
elements.each(function() {
|
214
|
+
|
215
|
+
var ele = UI.$(this), offset = ele.offset().top;
|
216
|
+
|
217
|
+
if (offset != lastoffset && group.length) {
|
218
|
+
|
219
|
+
matchHeights(UI.$(group));
|
220
|
+
group = [];
|
221
|
+
offset = ele.offset().top;
|
222
|
+
}
|
223
|
+
|
224
|
+
group.push(ele);
|
225
|
+
lastoffset = offset;
|
226
|
+
});
|
227
|
+
|
228
|
+
if (group.length) {
|
229
|
+
matchHeights(UI.$(group));
|
230
|
+
}
|
231
|
+
|
232
|
+
}, 0);
|
233
|
+
|
234
|
+
} else {
|
235
|
+
matchHeights(elements);
|
236
|
+
}
|
237
|
+
};
|
238
|
+
|
239
|
+
(function(cacheSvgs){
|
240
|
+
|
241
|
+
UI.Utils.inlineSvg = function(selector, root) {
|
242
|
+
|
243
|
+
var images = UI.$(selector || 'img[src$=".svg"]', root || document).each(function(){
|
244
|
+
|
245
|
+
var img = UI.$(this),
|
246
|
+
src = img.attr('src');
|
247
|
+
|
248
|
+
if (!cacheSvgs[src]) {
|
249
|
+
|
250
|
+
var d = UI.$.Deferred();
|
251
|
+
|
252
|
+
UI.$.get(src, {nc: Math.random()}, function(data){
|
253
|
+
d.resolve(UI.$(data).find('svg'));
|
254
|
+
});
|
255
|
+
|
256
|
+
cacheSvgs[src] = d.promise();
|
257
|
+
}
|
258
|
+
|
259
|
+
cacheSvgs[src].then(function(svg) {
|
260
|
+
|
261
|
+
var $svg = UI.$(svg).clone();
|
262
|
+
|
263
|
+
if (img.attr('id')) $svg.attr('id', img.attr('id'));
|
264
|
+
if (img.attr('class')) $svg.attr('class', img.attr('class'));
|
265
|
+
if (img.attr('style')) $svg.attr('style', img.attr('style'));
|
266
|
+
|
267
|
+
if (img.attr('width')) {
|
268
|
+
$svg.attr('width', img.attr('width'));
|
269
|
+
if (!img.attr('height')) $svg.removeAttr('height');
|
270
|
+
}
|
271
|
+
|
272
|
+
if (img.attr('height')){
|
273
|
+
$svg.attr('height', img.attr('height'));
|
274
|
+
if (!img.attr('width')) $svg.removeAttr('width');
|
275
|
+
}
|
276
|
+
|
277
|
+
img.replaceWith($svg);
|
278
|
+
});
|
279
|
+
});
|
280
|
+
};
|
281
|
+
|
282
|
+
// init code
|
283
|
+
UI.ready(function(context) {
|
284
|
+
UI.Utils.inlineSvg('[data-uk-svg]', context);
|
285
|
+
});
|
286
|
+
|
287
|
+
})({});
|
288
|
+
|
289
|
+
})(UIkit);
|