uikit2-rails 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +10 -0
- data/.travis.yml +4 -0
- data/Gemfile +4 -0
- data/README.md +66 -0
- data/Rakefile +1 -0
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/lib/uikit2/rails.rb +8 -0
- data/lib/uikit2/rails/version.rb +5 -0
- data/uikit2-rails.gemspec +25 -0
- data/vendor/assets/fonts/FontAwesome.otf +0 -0
- data/vendor/assets/fonts/fontawesome-webfont.eot +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/uikit.js +3537 -0
- data/vendor/assets/javascripts/uikit/components/accordion.js +172 -0
- data/vendor/assets/javascripts/uikit/components/accordion.min.js +2 -0
- data/vendor/assets/javascripts/uikit/components/autocomplete.js +334 -0
- data/vendor/assets/javascripts/uikit/components/autocomplete.min.js +2 -0
- data/vendor/assets/javascripts/uikit/components/datepicker.js +3166 -0
- data/vendor/assets/javascripts/uikit/components/datepicker.min.js +3 -0
- data/vendor/assets/javascripts/uikit/components/form-password.js +67 -0
- data/vendor/assets/javascripts/uikit/components/form-password.min.js +2 -0
- data/vendor/assets/javascripts/uikit/components/form-select.js +70 -0
- data/vendor/assets/javascripts/uikit/components/form-select.min.js +2 -0
- data/vendor/assets/javascripts/uikit/components/grid.js +523 -0
- data/vendor/assets/javascripts/uikit/components/grid.min.js +2 -0
- data/vendor/assets/javascripts/uikit/components/htmleditor.js +623 -0
- data/vendor/assets/javascripts/uikit/components/htmleditor.min.js +2 -0
- data/vendor/assets/javascripts/uikit/components/lightbox.js +555 -0
- data/vendor/assets/javascripts/uikit/components/lightbox.min.js +2 -0
- data/vendor/assets/javascripts/uikit/components/nestable.js +638 -0
- data/vendor/assets/javascripts/uikit/components/nestable.min.js +2 -0
- data/vendor/assets/javascripts/uikit/components/notify.js +189 -0
- data/vendor/assets/javascripts/uikit/components/notify.min.js +2 -0
- data/vendor/assets/javascripts/uikit/components/pagination.js +147 -0
- data/vendor/assets/javascripts/uikit/components/pagination.min.js +2 -0
- data/vendor/assets/javascripts/uikit/components/parallax.js +417 -0
- data/vendor/assets/javascripts/uikit/components/parallax.min.js +2 -0
- data/vendor/assets/javascripts/uikit/components/search.js +92 -0
- data/vendor/assets/javascripts/uikit/components/search.min.js +2 -0
- data/vendor/assets/javascripts/uikit/components/slider.js +520 -0
- data/vendor/assets/javascripts/uikit/components/slider.min.js +2 -0
- data/vendor/assets/javascripts/uikit/components/slideset.js +502 -0
- data/vendor/assets/javascripts/uikit/components/slideset.min.js +2 -0
- data/vendor/assets/javascripts/uikit/components/slideshow-fx.js +375 -0
- data/vendor/assets/javascripts/uikit/components/slideshow-fx.min.js +2 -0
- data/vendor/assets/javascripts/uikit/components/slideshow.js +545 -0
- data/vendor/assets/javascripts/uikit/components/slideshow.min.js +2 -0
- data/vendor/assets/javascripts/uikit/components/sortable.js +664 -0
- data/vendor/assets/javascripts/uikit/components/sortable.min.js +2 -0
- data/vendor/assets/javascripts/uikit/components/sticky.js +349 -0
- data/vendor/assets/javascripts/uikit/components/sticky.min.js +2 -0
- data/vendor/assets/javascripts/uikit/components/timepicker.js +192 -0
- data/vendor/assets/javascripts/uikit/components/timepicker.min.js +2 -0
- data/vendor/assets/javascripts/uikit/components/tooltip.js +234 -0
- data/vendor/assets/javascripts/uikit/components/tooltip.min.js +2 -0
- data/vendor/assets/javascripts/uikit/components/upload.js +260 -0
- data/vendor/assets/javascripts/uikit/components/upload.min.js +2 -0
- data/vendor/assets/javascripts/uikit/core/alert.js +66 -0
- data/vendor/assets/javascripts/uikit/core/alert.min.js +2 -0
- data/vendor/assets/javascripts/uikit/core/button.js +157 -0
- data/vendor/assets/javascripts/uikit/core/button.min.js +2 -0
- data/vendor/assets/javascripts/uikit/core/core.js +725 -0
- data/vendor/assets/javascripts/uikit/core/core.min.js +2 -0
- data/vendor/assets/javascripts/uikit/core/cover.js +95 -0
- data/vendor/assets/javascripts/uikit/core/cover.min.js +2 -0
- data/vendor/assets/javascripts/uikit/core/dropdown.js +421 -0
- data/vendor/assets/javascripts/uikit/core/dropdown.min.js +2 -0
- data/vendor/assets/javascripts/uikit/core/grid.js +114 -0
- data/vendor/assets/javascripts/uikit/core/grid.min.js +2 -0
- data/vendor/assets/javascripts/uikit/core/modal.js +372 -0
- data/vendor/assets/javascripts/uikit/core/modal.min.js +2 -0
- data/vendor/assets/javascripts/uikit/core/nav.js +136 -0
- data/vendor/assets/javascripts/uikit/core/nav.min.js +2 -0
- data/vendor/assets/javascripts/uikit/core/offcanvas.js +180 -0
- data/vendor/assets/javascripts/uikit/core/offcanvas.min.js +2 -0
- data/vendor/assets/javascripts/uikit/core/scrollspy.js +208 -0
- data/vendor/assets/javascripts/uikit/core/scrollspy.min.js +2 -0
- data/vendor/assets/javascripts/uikit/core/smooth-scroll.js +62 -0
- data/vendor/assets/javascripts/uikit/core/smooth-scroll.min.js +2 -0
- data/vendor/assets/javascripts/uikit/core/switcher.js +304 -0
- data/vendor/assets/javascripts/uikit/core/switcher.min.js +2 -0
- data/vendor/assets/javascripts/uikit/core/tab.js +165 -0
- data/vendor/assets/javascripts/uikit/core/tab.min.js +2 -0
- data/vendor/assets/javascripts/uikit/core/toggle.js +120 -0
- data/vendor/assets/javascripts/uikit/core/toggle.min.js +2 -0
- data/vendor/assets/javascripts/uikit/core/touch.js +173 -0
- data/vendor/assets/javascripts/uikit/core/touch.min.js +2 -0
- data/vendor/assets/javascripts/uikit/core/utility.js +239 -0
- data/vendor/assets/javascripts/uikit/core/utility.min.js +2 -0
- data/vendor/assets/stylesheets/uikit.almost-flat.css +8551 -0
- data/vendor/assets/stylesheets/uikit.css +8252 -0
- data/vendor/assets/stylesheets/uikit.gradient.css +8614 -0
- data/vendor/assets/stylesheets/uikit/components/accordion.almost-flat.css +39 -0
- data/vendor/assets/stylesheets/uikit/components/accordion.almost-flat.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/accordion.css +37 -0
- data/vendor/assets/stylesheets/uikit/components/accordion.gradient.css +39 -0
- data/vendor/assets/stylesheets/uikit/components/accordion.gradient.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/accordion.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/autocomplete.almost-flat.css +52 -0
- data/vendor/assets/stylesheets/uikit/components/autocomplete.almost-flat.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/autocomplete.css +50 -0
- data/vendor/assets/stylesheets/uikit/components/autocomplete.gradient.css +52 -0
- data/vendor/assets/stylesheets/uikit/components/autocomplete.gradient.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/autocomplete.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/datepicker.almost-flat.css +129 -0
- data/vendor/assets/stylesheets/uikit/components/datepicker.almost-flat.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/datepicker.css +123 -0
- data/vendor/assets/stylesheets/uikit/components/datepicker.gradient.css +139 -0
- data/vendor/assets/stylesheets/uikit/components/datepicker.gradient.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/datepicker.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/dotnav.almost-flat.css +128 -0
- data/vendor/assets/stylesheets/uikit/components/dotnav.almost-flat.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/dotnav.css +124 -0
- data/vendor/assets/stylesheets/uikit/components/dotnav.gradient.css +128 -0
- data/vendor/assets/stylesheets/uikit/components/dotnav.gradient.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/dotnav.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/form-advanced.almost-flat.css +78 -0
- data/vendor/assets/stylesheets/uikit/components/form-advanced.almost-flat.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/form-advanced.css +78 -0
- data/vendor/assets/stylesheets/uikit/components/form-advanced.gradient.css +78 -0
- data/vendor/assets/stylesheets/uikit/components/form-advanced.gradient.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/form-advanced.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/form-file.almost-flat.css +34 -0
- data/vendor/assets/stylesheets/uikit/components/form-file.almost-flat.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/form-file.css +34 -0
- data/vendor/assets/stylesheets/uikit/components/form-file.gradient.css +34 -0
- data/vendor/assets/stylesheets/uikit/components/form-file.gradient.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/form-file.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/form-password.almost-flat.css +34 -0
- data/vendor/assets/stylesheets/uikit/components/form-password.almost-flat.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/form-password.css +34 -0
- data/vendor/assets/stylesheets/uikit/components/form-password.gradient.css +34 -0
- data/vendor/assets/stylesheets/uikit/components/form-password.gradient.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/form-password.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/form-select.almost-flat.css +35 -0
- data/vendor/assets/stylesheets/uikit/components/form-select.almost-flat.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/form-select.css +35 -0
- data/vendor/assets/stylesheets/uikit/components/form-select.gradient.css +35 -0
- data/vendor/assets/stylesheets/uikit/components/form-select.gradient.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/form-select.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/htmleditor.almost-flat.css +222 -0
- data/vendor/assets/stylesheets/uikit/components/htmleditor.almost-flat.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/htmleditor.css +164 -0
- data/vendor/assets/stylesheets/uikit/components/htmleditor.gradient.css +229 -0
- data/vendor/assets/stylesheets/uikit/components/htmleditor.gradient.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/htmleditor.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/nestable.almost-flat.css +135 -0
- data/vendor/assets/stylesheets/uikit/components/nestable.almost-flat.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/nestable.css +132 -0
- data/vendor/assets/stylesheets/uikit/components/nestable.gradient.css +139 -0
- data/vendor/assets/stylesheets/uikit/components/nestable.gradient.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/nestable.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/notify.almost-flat.css +98 -0
- data/vendor/assets/stylesheets/uikit/components/notify.almost-flat.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/notify.css +92 -0
- data/vendor/assets/stylesheets/uikit/components/notify.gradient.css +98 -0
- data/vendor/assets/stylesheets/uikit/components/notify.gradient.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/notify.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/placeholder.almost-flat.css +29 -0
- data/vendor/assets/stylesheets/uikit/components/placeholder.almost-flat.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/placeholder.css +29 -0
- data/vendor/assets/stylesheets/uikit/components/placeholder.gradient.css +29 -0
- data/vendor/assets/stylesheets/uikit/components/placeholder.gradient.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/placeholder.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/progress.almost-flat.css +104 -0
- data/vendor/assets/stylesheets/uikit/components/progress.almost-flat.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/progress.css +94 -0
- data/vendor/assets/stylesheets/uikit/components/progress.gradient.css +112 -0
- data/vendor/assets/stylesheets/uikit/components/progress.gradient.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/progress.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/search.almost-flat.css +191 -0
- data/vendor/assets/stylesheets/uikit/components/search.almost-flat.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/search.css +189 -0
- data/vendor/assets/stylesheets/uikit/components/search.gradient.css +191 -0
- data/vendor/assets/stylesheets/uikit/components/search.gradient.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/search.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/slidenav.almost-flat.css +98 -0
- data/vendor/assets/stylesheets/uikit/components/slidenav.almost-flat.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/slidenav.css +98 -0
- data/vendor/assets/stylesheets/uikit/components/slidenav.gradient.css +98 -0
- data/vendor/assets/stylesheets/uikit/components/slidenav.gradient.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/slidenav.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/slider.almost-flat.css +85 -0
- data/vendor/assets/stylesheets/uikit/components/slider.almost-flat.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/slider.css +85 -0
- data/vendor/assets/stylesheets/uikit/components/slider.gradient.css +85 -0
- data/vendor/assets/stylesheets/uikit/components/slider.gradient.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/slider.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/slideshow.almost-flat.css +140 -0
- data/vendor/assets/stylesheets/uikit/components/slideshow.almost-flat.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/slideshow.css +140 -0
- data/vendor/assets/stylesheets/uikit/components/slideshow.gradient.css +140 -0
- data/vendor/assets/stylesheets/uikit/components/slideshow.gradient.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/slideshow.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/sortable.almost-flat.css +62 -0
- data/vendor/assets/stylesheets/uikit/components/sortable.almost-flat.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/sortable.css +62 -0
- data/vendor/assets/stylesheets/uikit/components/sortable.gradient.css +62 -0
- data/vendor/assets/stylesheets/uikit/components/sortable.gradient.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/sortable.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/sticky.almost-flat.css +31 -0
- data/vendor/assets/stylesheets/uikit/components/sticky.almost-flat.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/sticky.css +31 -0
- data/vendor/assets/stylesheets/uikit/components/sticky.gradient.css +31 -0
- data/vendor/assets/stylesheets/uikit/components/sticky.gradient.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/sticky.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/tooltip.almost-flat.css +118 -0
- data/vendor/assets/stylesheets/uikit/components/tooltip.almost-flat.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/tooltip.css +116 -0
- data/vendor/assets/stylesheets/uikit/components/tooltip.gradient.css +118 -0
- data/vendor/assets/stylesheets/uikit/components/tooltip.gradient.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/tooltip.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/upload.almost-flat.css +10 -0
- data/vendor/assets/stylesheets/uikit/components/upload.almost-flat.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/upload.css +10 -0
- data/vendor/assets/stylesheets/uikit/components/upload.gradient.css +10 -0
- data/vendor/assets/stylesheets/uikit/components/upload.gradient.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/upload.min.css +2 -0
- metadata +295 -0
@@ -0,0 +1,2 @@
|
|
1
|
+
/*! UIkit 2.22.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
2
|
+
!function(i){var s;window.UIkit&&(s=i(UIkit)),"function"==typeof define&&define.amd&&define("uikit-slideshow",["uikit"],function(){return s||i(UIkit)})}(function(i){"use strict";var s,t=0;i.component("slideshow",{defaults:{animation:"fade",duration:500,height:"auto",start:0,autoplay:!1,autoplayInterval:7e3,videoautoplay:!0,videomute:!0,slices:15,pauseOnHover:!0,kenburns:!1,kenburnsanimations:["uk-animation-middle-left","uk-animation-top-right","uk-animation-bottom-left","uk-animation-top-center","","uk-animation-bottom-right"]},current:!1,interval:null,hovering:!1,boot:function(){i.ready(function(s){i.$("[data-uk-slideshow]",s).each(function(){var s=i.$(this);s.data("slideshow")||i.slideshow(s,i.Utils.options(s.attr("data-uk-slideshow")))})})},init:function(){var s,e,n=this;this.container=this.element.hasClass("uk-slideshow")?this.element:i.$(this.find(".uk-slideshow")),this.slides=this.container.children(),this.slidesCount=this.slides.length,this.current=this.options.start,this.animating=!1,this.triggers=this.find("[data-uk-slideshow-item]"),this.fixFullscreen=navigator.userAgent.match(/(iPad|iPhone|iPod)/g)&&this.container.hasClass("uk-slideshow-fullscreen"),this.options.kenburns&&(e=this.options.kenburns===!0?"15s":this.options.kenburns,String(e).match(/(ms|s)$/)||(e+="ms"),"string"==typeof this.options.kenburnsanimations&&(this.options.kenburnsanimations=this.options.kenburnsanimations.split(","))),this.slides.each(function(a){var o=i.$(this),r=o.children("img,video,iframe").eq(0);if(o.data("media",r),o.data("sizer",r),r.length){var d;switch(r[0].nodeName){case"IMG":var u=i.$('<div class="uk-cover-background uk-position-cover"></div>').css({"background-image":"url("+r.attr("src")+")"});r.css({width:"100%",height:"auto"}),o.prepend(u).data("cover",u);break;case"IFRAME":var h=r[0].src,c="sw-"+ ++t;r.attr("src","").on("load",function(){if((a!==n.current||a==n.current&&!n.options.videoautoplay)&&n.pausemedia(r),n.options.videomute){n.mutemedia(r);var i=setInterval(function(s){return function(){n.mutemedia(r),++s>=4&&clearInterval(i)}}(0),250)}}).data("slideshow",n).attr("data-player-id",c).attr("src",[h,h.indexOf("?")>-1?"&":"?","enablejsapi=1&api=1&player_id="+c].join("")).addClass("uk-position-absolute"),i.support.touch||r.css("pointer-events","none"),d=!0,i.cover&&(i.cover(r),r.attr("data-uk-cover","{}"));break;case"VIDEO":r.addClass("uk-cover-object uk-position-absolute"),d=!0,n.options.videomute&&n.mutemedia(r)}if(d){s=i.$("<canvas></canvas>").attr({width:r[0].width,height:r[0].height});var l=i.$('<img style="width:100%;height:auto;">').attr("src",s[0].toDataURL());o.prepend(l),o.data("sizer",l)}}else o.data("sizer",o);n.hasKenBurns(o)&&o.data("cover").css({"-webkit-animation-duration":e,"animation-duration":e})}),this.on("click.uikit.slideshow","[data-uk-slideshow-item]",function(s){s.preventDefault();var t=i.$(this).attr("data-uk-slideshow-item");if(n.current!=t){switch(t){case"next":case"previous":n["next"==t?"next":"previous"]();break;default:n.show(parseInt(t,10))}n.stop()}}),this.slides.attr("aria-hidden","true").eq(this.current).addClass("uk-active").attr("aria-hidden","false"),this.triggers.filter('[data-uk-slideshow-item="'+this.current+'"]').addClass("uk-active"),i.$win.on("resize load",i.Utils.debounce(function(){n.resize(),n.fixFullscreen&&(n.container.css("height",window.innerHeight),n.slides.css("height",window.innerHeight))},100)),setTimeout(function(){n.resize()},80),this.options.autoplay&&this.start(),this.options.videoautoplay&&this.slides.eq(this.current).data("media")&&this.playmedia(this.slides.eq(this.current).data("media")),this.options.kenburns&&this.applyKenBurns(this.slides.eq(this.current)),this.container.on({mouseenter:function(){n.options.pauseOnHover&&(n.hovering=!0)},mouseleave:function(){n.hovering=!1}}),this.on("swipeRight swipeLeft",function(i){n["swipeLeft"==i.type?"next":"previous"]()}),this.on("display.uk.check",function(){n.element.is(":visible")&&(n.resize(),n.fixFullscreen&&(n.container.css("height",window.innerHeight),n.slides.css("height",window.innerHeight)))})},resize:function(){if(!this.container.hasClass("uk-slideshow-fullscreen")){var s=this.options.height;"auto"===this.options.height&&(s=0,this.slides.css("height","").each(function(){s=Math.max(s,i.$(this).height())})),this.container.css("height",s),this.slides.css("height",s)}},show:function(t,e){if(!this.animating&&this.current!=t){this.animating=!0;var n=this,a=this.slides.eq(this.current),o=this.slides.eq(t),r=e?e:this.current<t?-1:1,d=a.data("media"),u=s[this.options.animation]?this.options.animation:"fade",h=o.data("media"),c=function(){n.animating&&(d&&d.is("video,iframe")&&n.pausemedia(d),h&&h.is("video,iframe")&&n.playmedia(h),o.addClass("uk-active").attr("aria-hidden","false"),a.removeClass("uk-active").attr("aria-hidden","true"),n.animating=!1,n.current=t,i.Utils.checkDisplay(o,'[class*="uk-animation-"]:not(.uk-cover-background.uk-position-cover)'),n.trigger("show.uk.slideshow",[o]))};n.applyKenBurns(o),i.support.animation||(u="none"),a=i.$(a),o=i.$(o),s[u].apply(this,[a,o,r]).then(c),n.triggers.removeClass("uk-active"),n.triggers.filter('[data-uk-slideshow-item="'+t+'"]').addClass("uk-active")}},applyKenBurns:function(i){if(this.hasKenBurns(i)){var s=this.options.kenburnsanimations,t=this.kbindex||0;i.data("cover").attr("class","uk-cover-background uk-position-cover").width(),i.data("cover").addClass(["uk-animation-scale","uk-animation-reverse",s[t].trim()].join(" ")),this.kbindex=s[t+1]?t+1:0}},hasKenBurns:function(i){return this.options.kenburns&&i.data("cover")},next:function(){this.show(this.slides[this.current+1]?this.current+1:0)},previous:function(){this.show(this.slides[this.current-1]?this.current-1:this.slides.length-1)},start:function(){this.stop();var i=this;this.interval=setInterval(function(){i.hovering||i.next()},this.options.autoplayInterval)},stop:function(){this.interval&&clearInterval(this.interval)},playmedia:function(i){if(i&&i[0])switch(i[0].nodeName){case"VIDEO":this.options.videomute||(i[0].muted=!1),i[0].play();break;case"IFRAME":this.options.videomute||i[0].contentWindow.postMessage('{ "event": "command", "func": "unmute", "method":"setVolume", "value":1}',"*"),i[0].contentWindow.postMessage('{ "event": "command", "func": "playVideo", "method":"play"}',"*")}},pausemedia:function(i){switch(i[0].nodeName){case"VIDEO":i[0].pause();break;case"IFRAME":i[0].contentWindow.postMessage('{ "event": "command", "func": "pauseVideo", "method":"pause"}',"*")}},mutemedia:function(i){switch(i[0].nodeName){case"VIDEO":i[0].muted=!0;break;case"IFRAME":i[0].contentWindow.postMessage('{ "event": "command", "func": "mute", "method":"setVolume", "value":0}',"*")}}}),s={none:function(){var s=i.$.Deferred();return s.resolve(),s.promise()},scroll:function(s,t,e){var n=i.$.Deferred();return s.css("animation-duration",this.options.duration+"ms"),t.css("animation-duration",this.options.duration+"ms"),t.css("opacity",1).one(i.support.animation.end,function(){s.removeClass(1===e?"uk-slideshow-scroll-backward-out":"uk-slideshow-scroll-forward-out"),t.css("opacity","").removeClass(1===e?"uk-slideshow-scroll-backward-in":"uk-slideshow-scroll-forward-in"),n.resolve()}.bind(this)),s.addClass(1==e?"uk-slideshow-scroll-backward-out":"uk-slideshow-scroll-forward-out"),t.addClass(1==e?"uk-slideshow-scroll-backward-in":"uk-slideshow-scroll-forward-in"),t.width(),n.promise()},swipe:function(s,t,e){var n=i.$.Deferred();return s.css("animation-duration",this.options.duration+"ms"),t.css("animation-duration",this.options.duration+"ms"),t.css("opacity",1).one(i.support.animation.end,function(){s.removeClass(1===e?"uk-slideshow-swipe-backward-out":"uk-slideshow-swipe-forward-out"),t.css("opacity","").removeClass(1===e?"uk-slideshow-swipe-backward-in":"uk-slideshow-swipe-forward-in"),n.resolve()}.bind(this)),s.addClass(1==e?"uk-slideshow-swipe-backward-out":"uk-slideshow-swipe-forward-out"),t.addClass(1==e?"uk-slideshow-swipe-backward-in":"uk-slideshow-swipe-forward-in"),t.width(),n.promise()},scale:function(s,t){var e=i.$.Deferred();return s.css("animation-duration",this.options.duration+"ms"),t.css("animation-duration",this.options.duration+"ms"),t.css("opacity",1),s.one(i.support.animation.end,function(){s.removeClass("uk-slideshow-scale-out"),t.css("opacity",""),e.resolve()}.bind(this)),s.addClass("uk-slideshow-scale-out"),s.width(),e.promise()},fade:function(s,t){var e=i.$.Deferred();return s.css("animation-duration",this.options.duration+"ms"),t.css("animation-duration",this.options.duration+"ms"),t.css("opacity",1),s.one(i.support.animation.end,function(){s.removeClass("uk-slideshow-fade-out"),t.css("opacity",""),e.resolve()}.bind(this)),s.addClass("uk-slideshow-fade-out"),s.width(),e.promise()}},i.slideshow.animations=s,window.addEventListener("message",function(s){var t,e=s.data;if("string"==typeof e)try{e=JSON.parse(e)}catch(n){e={}}s.origin&&s.origin.indexOf("vimeo")>-1&&"ready"==e.event&&e.player_id&&(t=i.$('[data-player-id="'+e.player_id+'"]'),t.length&&t.data("slideshow").mutemedia(t))},!1)});
|
@@ -0,0 +1,664 @@
|
|
1
|
+
/*! UIkit 2.22.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
2
|
+
/*
|
3
|
+
* Based on nativesortable - Copyright (c) Brian Grinstead - https://github.com/bgrins/nativesortable
|
4
|
+
*/
|
5
|
+
(function(addon) {
|
6
|
+
|
7
|
+
var component;
|
8
|
+
|
9
|
+
if (window.UIkit) {
|
10
|
+
component = addon(UIkit);
|
11
|
+
}
|
12
|
+
|
13
|
+
if (typeof define == "function" && define.amd) {
|
14
|
+
define("uikit-sortable", ["uikit"], function(){
|
15
|
+
return component || addon(UIkit);
|
16
|
+
});
|
17
|
+
}
|
18
|
+
|
19
|
+
})(function(UI){
|
20
|
+
|
21
|
+
"use strict";
|
22
|
+
|
23
|
+
var supportsTouch = ('ontouchstart' in window) || (window.DocumentTouch && document instanceof DocumentTouch),
|
24
|
+
draggingPlaceholder, currentlyDraggingElement, currentlyDraggingTarget, dragging, moving, clickedlink, delayIdle, touchedlists, moved;
|
25
|
+
|
26
|
+
function closestSortable(ele) {
|
27
|
+
|
28
|
+
ele = UI.$(ele);
|
29
|
+
|
30
|
+
do {
|
31
|
+
if (ele.data('sortable')) {
|
32
|
+
return ele;
|
33
|
+
}
|
34
|
+
ele = UI.$(ele).parent();
|
35
|
+
} while(ele.length);
|
36
|
+
|
37
|
+
return ele;
|
38
|
+
}
|
39
|
+
|
40
|
+
UI.component('sortable', {
|
41
|
+
|
42
|
+
defaults: {
|
43
|
+
|
44
|
+
animation : 150,
|
45
|
+
threshold : 10,
|
46
|
+
|
47
|
+
childClass : 'uk-sortable-item',
|
48
|
+
placeholderClass : 'uk-sortable-placeholder',
|
49
|
+
overClass : 'uk-sortable-over',
|
50
|
+
draggingClass : 'uk-sortable-dragged',
|
51
|
+
dragMovingClass : 'uk-sortable-moving',
|
52
|
+
baseClass : 'uk-sortable',
|
53
|
+
noDragClass : 'uk-sortable-nodrag',
|
54
|
+
emptyClass : 'uk-sortable-empty',
|
55
|
+
dragCustomClass : '',
|
56
|
+
handleClass : false,
|
57
|
+
group : false,
|
58
|
+
|
59
|
+
stop : function() {},
|
60
|
+
start : function() {},
|
61
|
+
change : function() {}
|
62
|
+
},
|
63
|
+
|
64
|
+
boot: function() {
|
65
|
+
|
66
|
+
// auto init
|
67
|
+
UI.ready(function(context) {
|
68
|
+
|
69
|
+
UI.$("[data-uk-sortable]", context).each(function(){
|
70
|
+
|
71
|
+
var ele = UI.$(this);
|
72
|
+
|
73
|
+
if(!ele.data("sortable")) {
|
74
|
+
UI.sortable(ele, UI.Utils.options(ele.attr("data-uk-sortable")));
|
75
|
+
}
|
76
|
+
});
|
77
|
+
});
|
78
|
+
|
79
|
+
UI.$html.on('mousemove touchmove', function(e) {
|
80
|
+
|
81
|
+
if (delayIdle) {
|
82
|
+
|
83
|
+
var src = e.originalEvent.targetTouches ? e.originalEvent.targetTouches[0] : e;
|
84
|
+
|
85
|
+
if (Math.abs(src.pageX - delayIdle.pos.x) > delayIdle.threshold || Math.abs(src.pageY - delayIdle.pos.y) > delayIdle.threshold) {
|
86
|
+
delayIdle.apply(src);
|
87
|
+
}
|
88
|
+
}
|
89
|
+
|
90
|
+
if (draggingPlaceholder) {
|
91
|
+
|
92
|
+
if (!moving) {
|
93
|
+
moving = true;
|
94
|
+
draggingPlaceholder.show();
|
95
|
+
|
96
|
+
draggingPlaceholder.$current.addClass(draggingPlaceholder.$sortable.options.placeholderClass);
|
97
|
+
draggingPlaceholder.$sortable.element.children().addClass(draggingPlaceholder.$sortable.options.childClass);
|
98
|
+
|
99
|
+
UI.$html.addClass(draggingPlaceholder.$sortable.options.dragMovingClass);
|
100
|
+
}
|
101
|
+
|
102
|
+
var offset = draggingPlaceholder.data('mouse-offset'),
|
103
|
+
left = parseInt(e.originalEvent.pageX, 10) + offset.left,
|
104
|
+
top = parseInt(e.originalEvent.pageY, 10) + offset.top;
|
105
|
+
|
106
|
+
draggingPlaceholder.css({'left': left, 'top': top });
|
107
|
+
|
108
|
+
// adjust document scrolling
|
109
|
+
|
110
|
+
if (top + (draggingPlaceholder.height()/3) > document.body.offsetHeight) {
|
111
|
+
return;
|
112
|
+
}
|
113
|
+
|
114
|
+
if (top < UI.$win.scrollTop()) {
|
115
|
+
UI.$win.scrollTop(UI.$win.scrollTop() - Math.ceil(draggingPlaceholder.height()/3));
|
116
|
+
} else if ( (top + (draggingPlaceholder.height()/3)) > (window.innerHeight + UI.$win.scrollTop()) ) {
|
117
|
+
UI.$win.scrollTop(UI.$win.scrollTop() + Math.ceil(draggingPlaceholder.height()/3));
|
118
|
+
}
|
119
|
+
}
|
120
|
+
});
|
121
|
+
|
122
|
+
UI.$html.on('mouseup touchend', function(e) {
|
123
|
+
|
124
|
+
delayIdle = clickedlink = false;
|
125
|
+
|
126
|
+
// dragging?
|
127
|
+
if (!currentlyDraggingElement || !draggingPlaceholder) {
|
128
|
+
// completely reset dragging attempt. will cause weird delay behavior elsewise
|
129
|
+
currentlyDraggingElement = draggingPlaceholder = null;
|
130
|
+
return;
|
131
|
+
}
|
132
|
+
|
133
|
+
// inside or outside of sortable?
|
134
|
+
var sortable = closestSortable(e.target),
|
135
|
+
component = draggingPlaceholder.$sortable,
|
136
|
+
ev = { type: e.type };
|
137
|
+
|
138
|
+
if (sortable[0]) {
|
139
|
+
component.dragDrop(ev, component.element);
|
140
|
+
}
|
141
|
+
component.dragEnd(ev, component.element);
|
142
|
+
});
|
143
|
+
},
|
144
|
+
|
145
|
+
init: function() {
|
146
|
+
|
147
|
+
var $this = this,
|
148
|
+
element = this.element[0];
|
149
|
+
|
150
|
+
touchedlists = [];
|
151
|
+
|
152
|
+
this.checkEmptyList();
|
153
|
+
|
154
|
+
this.element.data('sortable-group', this.options.group ? this.options.group : UI.Utils.uid('sortable-group'));
|
155
|
+
|
156
|
+
var handleDragStart = delegate(function(e) {
|
157
|
+
|
158
|
+
var $target = UI.$(e.target),
|
159
|
+
$link = $target.is('a[href]') ? $target:$target.parents('a[href]');
|
160
|
+
|
161
|
+
if ($target.is(':input')) {
|
162
|
+
return;
|
163
|
+
}
|
164
|
+
|
165
|
+
e.preventDefault();
|
166
|
+
|
167
|
+
if (!supportsTouch && $link.length) {
|
168
|
+
|
169
|
+
$link.one('click', function(e){
|
170
|
+
e.preventDefault();
|
171
|
+
}).one('mouseup', function(){
|
172
|
+
if(!moved) $link.trigger('click');
|
173
|
+
});
|
174
|
+
}
|
175
|
+
|
176
|
+
return $this.dragStart(e, this);
|
177
|
+
});
|
178
|
+
|
179
|
+
var handleDragOver = delegate(function(e) {
|
180
|
+
|
181
|
+
if (!currentlyDraggingElement) {
|
182
|
+
return true;
|
183
|
+
}
|
184
|
+
|
185
|
+
if (e.preventDefault) {
|
186
|
+
e.preventDefault();
|
187
|
+
}
|
188
|
+
|
189
|
+
return false;
|
190
|
+
});
|
191
|
+
|
192
|
+
var handleDragEnter = delegate(UI.Utils.debounce(function(e) {
|
193
|
+
return $this.dragEnter(e, this);
|
194
|
+
}), 40);
|
195
|
+
|
196
|
+
var handleDragLeave = delegate(function(e) {
|
197
|
+
|
198
|
+
// Prevent dragenter on a child from allowing a dragleave on the container
|
199
|
+
var previousCounter = $this.dragenterData(this);
|
200
|
+
$this.dragenterData(this, previousCounter - 1);
|
201
|
+
|
202
|
+
// This is a fix for child elements firing dragenter before the parent fires dragleave
|
203
|
+
if (!$this.dragenterData(this)) {
|
204
|
+
UI.$(this).removeClass($this.options.overClass);
|
205
|
+
$this.dragenterData(this, false);
|
206
|
+
}
|
207
|
+
});
|
208
|
+
|
209
|
+
var handleTouchMove = delegate(function(e) {
|
210
|
+
|
211
|
+
if (!currentlyDraggingElement ||
|
212
|
+
currentlyDraggingElement === this ||
|
213
|
+
currentlyDraggingTarget === this) {
|
214
|
+
return true;
|
215
|
+
}
|
216
|
+
|
217
|
+
$this.element.children().removeClass($this.options.overClass);
|
218
|
+
currentlyDraggingTarget = this;
|
219
|
+
|
220
|
+
$this.moveElementNextTo(currentlyDraggingElement, this);
|
221
|
+
|
222
|
+
return prevent(e);
|
223
|
+
});
|
224
|
+
|
225
|
+
// Bind/unbind standard mouse/touch events as a polyfill.
|
226
|
+
function addDragHandlers() {
|
227
|
+
if (supportsTouch) {
|
228
|
+
element.addEventListener("touchmove", handleTouchMove, false);
|
229
|
+
} else {
|
230
|
+
element.addEventListener('mouseover', handleDragEnter, false);
|
231
|
+
element.addEventListener('mouseout', handleDragLeave, false);
|
232
|
+
}
|
233
|
+
|
234
|
+
// document.addEventListener("selectstart", prevent, false);
|
235
|
+
}
|
236
|
+
|
237
|
+
function removeDragHandlers() {
|
238
|
+
if (supportsTouch) {
|
239
|
+
element.removeEventListener("touchmove", handleTouchMove, false);
|
240
|
+
} else {
|
241
|
+
element.removeEventListener('mouseover', handleDragEnter, false);
|
242
|
+
element.removeEventListener('mouseout', handleDragLeave, false);
|
243
|
+
}
|
244
|
+
|
245
|
+
// document.removeEventListener("selectstart", prevent, false);
|
246
|
+
}
|
247
|
+
|
248
|
+
this.addDragHandlers = addDragHandlers;
|
249
|
+
this.removeDragHandlers = removeDragHandlers;
|
250
|
+
|
251
|
+
function handleDragMove(e) {
|
252
|
+
|
253
|
+
if (!currentlyDraggingElement) {
|
254
|
+
return;
|
255
|
+
}
|
256
|
+
|
257
|
+
$this.dragMove(e, $this);
|
258
|
+
}
|
259
|
+
|
260
|
+
function delegate(fn) {
|
261
|
+
|
262
|
+
return function(e) {
|
263
|
+
|
264
|
+
var touch, target, context;
|
265
|
+
|
266
|
+
if (e) {
|
267
|
+
touch = (supportsTouch && e.touches && e.touches[0]) || { };
|
268
|
+
target = touch.target || e.target;
|
269
|
+
|
270
|
+
// Fix event.target for a touch event
|
271
|
+
if (supportsTouch && document.elementFromPoint) {
|
272
|
+
target = document.elementFromPoint(e.pageX - document.body.scrollLeft, e.pageY - document.body.scrollTop);
|
273
|
+
}
|
274
|
+
}
|
275
|
+
|
276
|
+
if (UI.$(target).hasClass($this.options.childClass)) {
|
277
|
+
fn.apply(target, [e]);
|
278
|
+
} else if (target !== element) {
|
279
|
+
|
280
|
+
// If a child is initiating the event or ending it, then use the container as context for the callback.
|
281
|
+
context = moveUpToChildNode(element, target);
|
282
|
+
|
283
|
+
if (context) {
|
284
|
+
fn.apply(context, [e]);
|
285
|
+
}
|
286
|
+
}
|
287
|
+
};
|
288
|
+
}
|
289
|
+
|
290
|
+
window.addEventListener(supportsTouch ? 'touchmove' : 'mousemove', handleDragMove, false);
|
291
|
+
element.addEventListener(supportsTouch ? 'touchstart': 'mousedown', handleDragStart, false);
|
292
|
+
},
|
293
|
+
|
294
|
+
dragStart: function(e, elem) {
|
295
|
+
|
296
|
+
moved = false;
|
297
|
+
moving = false;
|
298
|
+
dragging = false;
|
299
|
+
|
300
|
+
var $this = this,
|
301
|
+
target = UI.$(e.target);
|
302
|
+
|
303
|
+
if (!supportsTouch && e.button==2) {
|
304
|
+
return;
|
305
|
+
}
|
306
|
+
|
307
|
+
if ($this.options.handleClass) {
|
308
|
+
|
309
|
+
var handle = target.hasClass($this.options.handleClass) ? target : target.closest('.'+$this.options.handleClass, $this.element);
|
310
|
+
|
311
|
+
if (!handle.length) {
|
312
|
+
//e.preventDefault();
|
313
|
+
return;
|
314
|
+
}
|
315
|
+
}
|
316
|
+
|
317
|
+
if (target.is('.'+$this.options.noDragClass) || target.closest('.'+$this.options._noDragClass).length) {
|
318
|
+
return;
|
319
|
+
}
|
320
|
+
|
321
|
+
// prevent dragging if taget is a form field
|
322
|
+
if (target.is(':input')) {
|
323
|
+
return;
|
324
|
+
}
|
325
|
+
|
326
|
+
currentlyDraggingElement = elem;
|
327
|
+
|
328
|
+
// init drag placeholder
|
329
|
+
if (draggingPlaceholder) {
|
330
|
+
draggingPlaceholder.remove();
|
331
|
+
}
|
332
|
+
|
333
|
+
var $current = UI.$(currentlyDraggingElement), offset = $current.offset();
|
334
|
+
|
335
|
+
delayIdle = {
|
336
|
+
|
337
|
+
pos : { x:e.pageX, y:e.pageY },
|
338
|
+
threshold : $this.options.threshold,
|
339
|
+
apply : function(evt) {
|
340
|
+
|
341
|
+
draggingPlaceholder = UI.$('<div class="'+([$this.options.draggingClass, $this.options.dragCustomClass].join(' '))+'"></div>').css({
|
342
|
+
display : 'none',
|
343
|
+
top : offset.top,
|
344
|
+
left : offset.left,
|
345
|
+
width : $current.width(),
|
346
|
+
height : $current.height(),
|
347
|
+
padding : $current.css('padding')
|
348
|
+
}).data({
|
349
|
+
'mouse-offset': {
|
350
|
+
'left' : offset.left - parseInt(evt.pageX, 10),
|
351
|
+
'top' : offset.top - parseInt(evt.pageY, 10)
|
352
|
+
},
|
353
|
+
'origin' : $this.element,
|
354
|
+
'index' : $current.index()
|
355
|
+
}).append($current.html()).appendTo('body');
|
356
|
+
|
357
|
+
draggingPlaceholder.$current = $current;
|
358
|
+
draggingPlaceholder.$sortable = $this;
|
359
|
+
|
360
|
+
$current.data({
|
361
|
+
'start-list': $current.parent(),
|
362
|
+
'start-index': $current.index(),
|
363
|
+
'sortable-group': $this.options.group
|
364
|
+
});
|
365
|
+
|
366
|
+
$this.addDragHandlers();
|
367
|
+
|
368
|
+
$this.options.start(this, currentlyDraggingElement);
|
369
|
+
$this.trigger('start.uk.sortable', [$this, currentlyDraggingElement]);
|
370
|
+
|
371
|
+
moved = true;
|
372
|
+
delayIdle = false;
|
373
|
+
}
|
374
|
+
};
|
375
|
+
},
|
376
|
+
|
377
|
+
dragMove: function(e, elem) {
|
378
|
+
var overEl = UI.$(document.elementFromPoint(e.pageX - document.body.scrollLeft, e.pageY - (window.pageYOffset || document.documentElement.scrollTop))),
|
379
|
+
overRoot = overEl.closest('.'+this.options.baseClass),
|
380
|
+
groupOver = overRoot.data("sortable-group"),
|
381
|
+
$current = UI.$(currentlyDraggingElement),
|
382
|
+
currentRoot = $current.parent(),
|
383
|
+
groupCurrent = $current.data("sortable-group"),
|
384
|
+
overChild;
|
385
|
+
|
386
|
+
if (overRoot[0] !== currentRoot[0] && groupCurrent !== undefined && groupOver === groupCurrent) {
|
387
|
+
|
388
|
+
overRoot.data('sortable').addDragHandlers();
|
389
|
+
|
390
|
+
touchedlists.push(overRoot);
|
391
|
+
overRoot.children().addClass(this.options.childClass);
|
392
|
+
|
393
|
+
// swap root
|
394
|
+
if (overRoot.children().length > 0) {
|
395
|
+
overChild = overEl.closest('.'+this.options.childClass);
|
396
|
+
|
397
|
+
if (overChild.length) {
|
398
|
+
overChild.before($current);
|
399
|
+
} else {
|
400
|
+
overRoot.append($current);
|
401
|
+
}
|
402
|
+
|
403
|
+
} else { // empty list
|
404
|
+
overEl.append($current);
|
405
|
+
}
|
406
|
+
|
407
|
+
UIkit.$doc.trigger('mouseover');
|
408
|
+
}
|
409
|
+
|
410
|
+
this.checkEmptyList();
|
411
|
+
this.checkEmptyList(currentRoot);
|
412
|
+
},
|
413
|
+
|
414
|
+
dragEnter: function(e, elem) {
|
415
|
+
|
416
|
+
if (!currentlyDraggingElement || currentlyDraggingElement === elem) {
|
417
|
+
return true;
|
418
|
+
}
|
419
|
+
|
420
|
+
// Prevent dragenter on a child from allowing a dragleave on the container
|
421
|
+
var previousCounter = this.dragenterData(elem);
|
422
|
+
|
423
|
+
this.dragenterData(elem, previousCounter + 1);
|
424
|
+
|
425
|
+
if (previousCounter === 0) {
|
426
|
+
|
427
|
+
UI.$(elem).addClass(this.options.overClass);
|
428
|
+
|
429
|
+
this.moveElementNextTo(currentlyDraggingElement, elem);
|
430
|
+
}
|
431
|
+
|
432
|
+
return false;
|
433
|
+
},
|
434
|
+
|
435
|
+
dragEnd: function(e, elem) {
|
436
|
+
|
437
|
+
var $this = this;
|
438
|
+
|
439
|
+
// avoid triggering event twice
|
440
|
+
if (currentlyDraggingElement) {
|
441
|
+
// TODO: trigger on right element?
|
442
|
+
this.options.stop(elem);
|
443
|
+
this.trigger('stop.uk.sortable', [this]);
|
444
|
+
}
|
445
|
+
|
446
|
+
currentlyDraggingElement = null;
|
447
|
+
currentlyDraggingTarget = null;
|
448
|
+
|
449
|
+
touchedlists.push(this.element);
|
450
|
+
touchedlists.forEach(function(el, i) {
|
451
|
+
UI.$(el).children().each(function() {
|
452
|
+
if (this.nodeType === 1) {
|
453
|
+
UI.$(this).removeClass($this.options.overClass)
|
454
|
+
.removeClass($this.options.placeholderClass)
|
455
|
+
.removeClass($this.options.childClass);
|
456
|
+
$this.dragenterData(this, false);
|
457
|
+
}
|
458
|
+
});
|
459
|
+
});
|
460
|
+
|
461
|
+
touchedlists = [];
|
462
|
+
|
463
|
+
UI.$html.removeClass(this.options.dragMovingClass);
|
464
|
+
|
465
|
+
this.removeDragHandlers();
|
466
|
+
|
467
|
+
if (draggingPlaceholder) {
|
468
|
+
draggingPlaceholder.remove();
|
469
|
+
draggingPlaceholder = null;
|
470
|
+
}
|
471
|
+
},
|
472
|
+
|
473
|
+
dragDrop: function(e, elem) {
|
474
|
+
|
475
|
+
if (e.type === 'drop') {
|
476
|
+
|
477
|
+
if (e.stopPropagation) {
|
478
|
+
e.stopPropagation();
|
479
|
+
}
|
480
|
+
|
481
|
+
if (e.preventDefault) {
|
482
|
+
e.preventDefault();
|
483
|
+
}
|
484
|
+
}
|
485
|
+
|
486
|
+
this.triggerChangeEvents();
|
487
|
+
},
|
488
|
+
|
489
|
+
triggerChangeEvents: function() {
|
490
|
+
|
491
|
+
// trigger events once
|
492
|
+
if (!currentlyDraggingElement) return;
|
493
|
+
|
494
|
+
var $current = UI.$(currentlyDraggingElement),
|
495
|
+
oldRoot = draggingPlaceholder.data("origin"),
|
496
|
+
newRoot = $current.closest('.'+this.options.baseClass),
|
497
|
+
triggers = [],
|
498
|
+
el = UI.$(currentlyDraggingElement);
|
499
|
+
|
500
|
+
// events depending on move inside lists or across lists
|
501
|
+
if (oldRoot[0] === newRoot[0] && draggingPlaceholder.data('index') != $current.index() ) {
|
502
|
+
triggers.push({sortable: this, mode: 'moved'});
|
503
|
+
} else if (oldRoot[0] != newRoot[0]) {
|
504
|
+
triggers.push({sortable: UI.$(newRoot).data('sortable'), mode: 'added'}, {sortable: UI.$(oldRoot).data('sortable'), mode: 'removed'});
|
505
|
+
}
|
506
|
+
|
507
|
+
triggers.forEach(function (trigger, i) {
|
508
|
+
trigger.sortable.element.trigger('change.uk.sortable', [trigger.sortable, el, trigger.mode]);
|
509
|
+
});
|
510
|
+
},
|
511
|
+
|
512
|
+
dragenterData: function(element, val) {
|
513
|
+
|
514
|
+
element = UI.$(element);
|
515
|
+
|
516
|
+
if (arguments.length == 1) {
|
517
|
+
return parseInt(element.data('child-dragenter'), 10) || 0;
|
518
|
+
} else if (!val) {
|
519
|
+
element.removeData('child-dragenter');
|
520
|
+
} else {
|
521
|
+
element.data('child-dragenter', Math.max(0, val));
|
522
|
+
}
|
523
|
+
},
|
524
|
+
|
525
|
+
moveElementNextTo: function(element, elementToMoveNextTo) {
|
526
|
+
|
527
|
+
dragging = true;
|
528
|
+
|
529
|
+
var $this = this,
|
530
|
+
list = UI.$(element).parent().css('min-height', ''),
|
531
|
+
next = isBelow(element, elementToMoveNextTo) ? elementToMoveNextTo : elementToMoveNextTo.nextSibling,
|
532
|
+
children = list.children(),
|
533
|
+
count = children.length;
|
534
|
+
|
535
|
+
if (!$this.options.animation) {
|
536
|
+
elementToMoveNextTo.parentNode.insertBefore(element, next);
|
537
|
+
UI.Utils.checkDisplay($this.element.parent());
|
538
|
+
return;
|
539
|
+
}
|
540
|
+
|
541
|
+
list.css('min-height', list.height());
|
542
|
+
|
543
|
+
children.stop().each(function(){
|
544
|
+
var ele = UI.$(this),
|
545
|
+
offset = ele.position();
|
546
|
+
|
547
|
+
offset.width = ele.width();
|
548
|
+
|
549
|
+
ele.data('offset-before', offset);
|
550
|
+
});
|
551
|
+
|
552
|
+
elementToMoveNextTo.parentNode.insertBefore(element, next);
|
553
|
+
|
554
|
+
UI.Utils.checkDisplay($this.element.parent());
|
555
|
+
|
556
|
+
children = list.children().each(function() {
|
557
|
+
var ele = UI.$(this);
|
558
|
+
ele.data('offset-after', ele.position());
|
559
|
+
}).each(function() {
|
560
|
+
var ele = UI.$(this),
|
561
|
+
before = ele.data('offset-before');
|
562
|
+
ele.css({'position':'absolute', 'top':before.top, 'left':before.left, 'min-width':before.width });
|
563
|
+
});
|
564
|
+
|
565
|
+
children.each(function(){
|
566
|
+
|
567
|
+
var ele = UI.$(this),
|
568
|
+
before = ele.data('offset-before'),
|
569
|
+
offset = ele.data('offset-after');
|
570
|
+
|
571
|
+
ele.css('pointer-events', 'none').width();
|
572
|
+
|
573
|
+
setTimeout(function(){
|
574
|
+
ele.animate({'top':offset.top, 'left':offset.left}, $this.options.animation, function() {
|
575
|
+
ele.css({'position':'','top':'', 'left':'', 'min-width': '', 'pointer-events':''}).removeClass($this.options.overClass).removeData('child-dragenter');
|
576
|
+
count--;
|
577
|
+
if (!count) {
|
578
|
+
list.css('min-height', '');
|
579
|
+
UI.Utils.checkDisplay($this.element.parent());
|
580
|
+
}
|
581
|
+
});
|
582
|
+
}, 0);
|
583
|
+
});
|
584
|
+
},
|
585
|
+
|
586
|
+
serialize: function() {
|
587
|
+
|
588
|
+
var data = [], item, attribute;
|
589
|
+
|
590
|
+
this.element.children().each(function(j, child) {
|
591
|
+
item = {};
|
592
|
+
for (var i = 0; i < child.attributes.length; i++) {
|
593
|
+
attribute = child.attributes[i];
|
594
|
+
if (attribute.name.indexOf('data-') === 0) {
|
595
|
+
item[attribute.name.substr(5)] = UI.Utils.str2json(attribute.value);
|
596
|
+
}
|
597
|
+
}
|
598
|
+
data.push(item);
|
599
|
+
});
|
600
|
+
|
601
|
+
return data;
|
602
|
+
},
|
603
|
+
|
604
|
+
checkEmptyList: function(list) {
|
605
|
+
|
606
|
+
list = list ? UI.$(list) : this.element;
|
607
|
+
|
608
|
+
if (this.options.emptyClass) {
|
609
|
+
list[!list.children().length ? 'addClass':'removeClass'](this.options.emptyClass);
|
610
|
+
}
|
611
|
+
}
|
612
|
+
});
|
613
|
+
|
614
|
+
// helpers
|
615
|
+
|
616
|
+
function isBelow(el1, el2) {
|
617
|
+
|
618
|
+
var parent = el1.parentNode;
|
619
|
+
|
620
|
+
if (el2.parentNode != parent) {
|
621
|
+
return false;
|
622
|
+
}
|
623
|
+
|
624
|
+
var cur = el1.previousSibling;
|
625
|
+
|
626
|
+
while (cur && cur.nodeType !== 9) {
|
627
|
+
if (cur === el2) {
|
628
|
+
return true;
|
629
|
+
}
|
630
|
+
cur = cur.previousSibling;
|
631
|
+
}
|
632
|
+
|
633
|
+
return false;
|
634
|
+
}
|
635
|
+
|
636
|
+
function moveUpToChildNode(parent, child) {
|
637
|
+
var cur = child;
|
638
|
+
if (cur == parent) { return null; }
|
639
|
+
|
640
|
+
while (cur) {
|
641
|
+
if (cur.parentNode === parent) {
|
642
|
+
return cur;
|
643
|
+
}
|
644
|
+
|
645
|
+
cur = cur.parentNode;
|
646
|
+
if ( !cur || !cur.ownerDocument || cur.nodeType === 11 ) {
|
647
|
+
break;
|
648
|
+
}
|
649
|
+
}
|
650
|
+
return null;
|
651
|
+
}
|
652
|
+
|
653
|
+
function prevent(e) {
|
654
|
+
if (e.stopPropagation) {
|
655
|
+
e.stopPropagation();
|
656
|
+
}
|
657
|
+
if (e.preventDefault) {
|
658
|
+
e.preventDefault();
|
659
|
+
}
|
660
|
+
e.returnValue = false;
|
661
|
+
}
|
662
|
+
|
663
|
+
return UI.sortable;
|
664
|
+
});
|