libreenfete-squelettes/js/scripts_footer.js

1 line
6.7 KiB
JavaScript
Raw Normal View History

2017-01-09 10:47:45 +01:00
!function(){"use strict";function e(e,n,t){var i=new f(n);switch(e){case"open":i.open(t);break;case"close":i.close(t);break;case"toggle":i.toggle(t);break;default:m.error("Method "+e+" does not exist on jQuery.sidr")}}function n(e){return"status"===e?d:b[e]?b[e].apply(this,Array.prototype.slice.call(arguments,1)):"function"!=typeof e&&"string"!=typeof e&&e?void y.error("Method "+e+" does not exist on jQuery.sidr"):b.toggle.apply(this,arguments)}function t(e,n){if("function"==typeof n.source){var t=n.source(name);e.html(t)}else if("string"==typeof n.source&&r.isUrl(n.source))C.get(n.source,function(n){e.html(n)});else if("string"==typeof n.source){var i="",o=n.source.split(",");if(C.each(o,function(e,n){i+='<div class="sidr-inner">'+C(n).html()+"</div>"}),n.renaming){var s=C("<div />").html(i);s.find("*").each(function(e,n){var t=C(n);r.addPrefixes(t)}),i=s.html()}e.html(i)}else null!==n.source&&C.error("Invalid Sidr Source");return e}function i(e){var i=r.transitions,o=C.extend({name:"sidr",speed:200,side:"left",source:null,renaming:!0,body:"body",displace:!0,timing:"ease",method:"toggle",bind:"touchstart click",onOpen:function(){},onClose:function(){},onOpenEnd:function(){},onCloseEnd:function(){}},e),s=o.name,a=C("#"+s);return 0===a.length&&(a=C("<div />").attr("id",s).appendTo(C("body"))),i.supported&&a.css(i.property,o.side+" "+o.speed/1e3+"s "+o.timing),a.addClass("sidr").addClass(o.side).data({speed:o.speed,side:o.side,body:o.body,displace:o.displace,timing:o.timing,method:o.method,onOpen:o.onOpen,onClose:o.onClose,onOpenEnd:o.onOpenEnd,onCloseEnd:o.onCloseEnd}),a=t(a,o),this.each(function(){var e=C(this),t=e.data("sidr"),i=!1;t||(d.moving=!1,d.opened=!1,e.data("sidr",s),e.bind(o.bind,function(e){e.preventDefault(),i||(i=!0,n(o.method,s),setTimeout(function(){i=!1},100))}))})}var o={};o.classCallCheck=function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")},o.createClass=function(){function e(e,n){for(var t=0;t<n.length;t++){var i=n[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(n,t,i){return t&&e(n.prototype,t),i&&e(n,i),n}}();var s,a,d={moving:!1,opened:!1},r={isUrl:function(e){var n=new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.?)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i");return!!n.test(e)},addPrefixes:function(e){this.addPrefix(e,"id"),this.addPrefix(e,"class"),e.removeAttr("style")},addPrefix:function(e,n){var t=e.attr(n);"string"==typeof t&&""!==t&&"sidr-inner"!==t&&e.attr(n,t.replace(/([A-Za-z0-9_.\-]+)/g,"sidr-"+n+"-$1"))},transitions:function(){var e=document.body||document.documentElement,n=e.style,t=!1,i="transition";return i in n?t=!0:!function(){var e=["moz","webkit","o","ms"],o=void 0,s=void 0;i=i.charAt(0).toUpperCase()+i.substr(1),t=function(){for(s=0;s<e.length;s++)if(o=e[s],o+i in n)return!0;return!1}(),i=t?"-"+o.toLowerCase()+"-"+i.toLowerCase():null}(),{supported:t,property:i}}()},u=jQuery,l="sidr-animating",c="open",h="close",p="webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend",f=function(){function e(n){o.classCallCheck(this,e),this.name=n,this.item=u("#"+n),this.openClass="sidr"===n?"sidr-open":"sidr-open "+n+"-open",this.menuWidth=this.item.outerWidth(!0),this.speed=this.item.data("speed"),this.side=this.item.data("side"),this.displace=this.item.data("displace"),this.timing=this.item.data("timing"),this.method=this.item.data("method"),this.onOpenCallback=this.item.data("onOpen"),this.onCloseCallback=this.item.data("onClose"),this.onOpenEndCallback=this.item.data("onOpenEnd"),this.onCloseEndCallback=this.item.data("onCloseEnd"),this.body=u(this.item.data("body"))}return o.createClass(e,[{key:"getAnimation",value:function(e,n){var t={},i=this.side;return"open"===e&&"body"===n?t[i]=this.menuWidth+"px":"close"===e&&"menu"===n?t[i]="-"+this.menuWidth+"px":t[i]=0,t}},{key:"prepareBody",value:function(e){var n="open"===e?"hidden":"";if(this.body.is("body")){