You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

4 lines
15 KiB

/*! jQuery slidePanel - v0.2.2 - 2015-10-14
* https://github.com/amazingSurge/jquery-slidePanel
* Copyright (c) 2015 amazingSurge; Licensed GPL */
!function(a,b,c,d){"use strict";function e(){return"undefined"!=typeof c.performance&&c.performance.now?c.performance.now():Date.now()}function f(a){return"string"==typeof a&&-1!=a.indexOf("%")}function g(a){return"string"==typeof a&&-1!=a.indexOf("px")}function h(a){return a&&"matrix"==a.substr(0,6)?a.replace(/^.*\((.*)\)$/g,"$1").replace(/px/g,"").split(/, +/):!1}function i(a){"string"!=typeof a&&(a=JSON.stringify(a));var b,c,d,e=0;if(0===a.length)return e;for(b=0,d=a.length;d>b;b++)c=a.charCodeAt(b),e=(e<<5)-e+c,e|=0;return e}function j(a,b,c,d){function e(a,b){return 1-3*b+3*a}function f(a,b){return 3*b-6*a}function g(a){return 3*a}function h(a,b,c){return((e(b,c)*a+f(b,c))*a+g(b))*a}function i(a,b,c){return 3*e(b,c)*a*a+2*f(b,c)*a+g(b)}function j(b){for(var d=b,e=0;4>e;++e){var f=i(d,a,c);if(0===f)return d;var g=h(d,a,c)-b;d-=g/f}return d}return a===b&&c===d?{css:"linear",fn:function(a){return a}}:{css:"cubic-bezier("+a+","+b+","+c+","+d+")",fn:function(a){return h(j(a),b,d)}}}function k(){return this.initialize.apply(this,Array.prototype.slice.call(arguments))}function l(){return this.initialize.apply(this,Array.prototype.slice.call(arguments))}function m(){return this.initialize.apply(this,Array.prototype.slice.call(arguments))}function n(){return this.initialize.apply(this,Array.prototype.slice.call(arguments))}var o=a.slidePanel=function(){o.show.apply(this,arguments)};Date.now||(Date.now=function(){return(new Date).getTime()});for(var p=["webkit","moz"],q=0;q<p.length&&!c.requestAnimationFrame;++q){var r=p[q];c.requestAnimationFrame=c[r+"RequestAnimationFrame"],c.cancelAnimationFrame=c[r+"CancelAnimationFrame"]||c[r+"CancelRequestAnimationFrame"]}if(/iP(ad|hone|od).*OS (6|7|8)/.test(c.navigator.userAgent)||!c.requestAnimationFrame||!c.cancelAnimationFrame){var s=0;c.requestAnimationFrame=function(a){var b=e(),c=Math.max(s+16,b);return setTimeout(function(){a(s=c)},c-b)},c.cancelAnimationFrame=clearTimeout}var t=function(){function e(b,c){var e=!1,f=b.charAt(0).toUpperCase()+b.slice(1);return g[b]!==d&&(e=b),e||a.each(h,function(a,b){return g[b+f]!==d?(e="-"+b.toLowerCase()+"-"+f,!1):void 0}),c?e:e?!0:!1}function f(a){return e(a,!0)}var g=a("<support>").get(0).style,h=["webkit","Moz","O","ms"],i={transition:{end:{WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",transition:"transitionend"}},animation:{end:{WebkitAnimation:"webkitAnimationEnd",MozAnimation:"animationend",OAnimation:"oAnimationEnd",animation:"animationend"}}},j={csstransforms:function(){return!!e("transform")},csstransforms3d:function(){return!!e("perspective")},csstransitions:function(){return!!e("transition")},cssanimations:function(){return!!e("animation")}},k={};return j.csstransitions()&&(k.transition=new String(f("transition")),k.transition.end=i.transition.end[k.transition]),j.cssanimations()&&(k.animation=new String(f("animation")),k.animation.end=i.animation.end[k.animation]),j.csstransforms()&&(k.transform=new String(f("transform")),k.transform3d=j.csstransforms3d()),k.touch="ontouchstart"in c||c.DocumentTouch&&b instanceof c.DocumentTouch?!0:!1,k.pointer=c.PointerEvent||c.MSPointerEvent?!0:!1,k.prefixPointerEvent=function(a){return c.MSPointerEvent?"MSPointer"+a.charAt(9).toUpperCase()+a.substr(10):a},k}(),u={ease:j(.25,.1,.25,1),linear:j(0,0,1,1),"ease-in":j(.42,0,1,1),"ease-out":j(0,0,.58,1),"ease-in-out":j(.42,0,.58,1)};o.options={skin:null,classes:{base:"slidePanel",show:"slidePanel-show",loading:"slidePanel-loading",content:"slidePanel-content",dragging:"slidePanel-dragging",willClose:"slidePanel-will-close"},closeSelector:null,template:function(a){return'<div class="'+a.classes.base+" "+a.classes.base+"-"+a.direction+'"><div class="'+a.classes.content+'"></div></div>'},loading:{appendTo:"panel",template:function(a){return'<div class="'+a.classes.loading+'"></div>'},showCallback:function(a){this.$el.addClass(a.classes.loading+"-show")},hideCallback:function(a){this.$el.removeClass(a.classes.loading+"-show")}},contentFilter:function(a){return a},useCssTransforms3d:!0,useCssTransforms: