mirror of
https://github.com/YunoHost-Apps/hubzilla_ynh.git
synced 2024-09-03 19:26:21 +02:00
1 line
10 KiB
JavaScript
1 line
10 KiB
JavaScript
|
(function e(t,i,s){function o(r,h){if(!i[r]){if(!t[r]){var l="function"==typeof require&&require;if(!h&&l)return l(r,!0);if(n)return n(r,!0);throw Error("Cannot find module '"+r+"'")}var u=i[r]={exports:{}};t[r][0].call(u.exports,function(i){var s=t[r][1][i];return o(s?s:i)},u,u.exports,e,t,i,s)}return i[r].exports}for(var n="function"==typeof require&&require,r=0;s.length>r;r++)o(s[r]);return o})({1:[function(t){(function(){var i,s,e,o,n,r=[].slice;i=jQuery,s=t("./modules/bus"),e=t("./modules/leg"),n=i.tourbus=function(){var t,s;return t=arguments.length>=1?r.call(arguments,0):[],s=t[0],o.hasOwnProperty(s)?t=t.slice(1):s instanceof i?s="build":"string"==typeof s?(s="build",t[0]=i(t[0])):i.error("Unknown method of $.tourbus --",t),o[s].apply(this,t)},i.fn.tourbus=function(){var t;return t=arguments.length>=1?r.call(arguments,0):[],this.each(function(){return t.unshift(i(this)),n.apply(null,["build"].concat(r.call(t))),this})},o={build:function(t,e){var o;return null==e&&(e={}),e=i.extend(!0,{},n.defaults,e),o=[],t instanceof i||(t=i(t)),t.each(function(){return o.push(new s(this,e))}),0===o.length&&i.error(""+t.selector+" was not found!"),1===o.length?o[0]:o},destroyAll:function(){var t,i,e,o;e=s._busses,o=[];for(i in e)t=e[i],o.push(t.destroy());return o},expose:function(t){return t.tourbus={Bus:s,Leg:e}}},n.defaults={debug:!1,autoDepart:!1,container:"body","class":null,startAt:0,onDepart:function(){return null},onStop:function(){return null},onLegStart:function(){return null},onLegEnd:function(){return null},leg:{"class":null,scrollTo:null,scrollSpeed:150,scrollContext:100,orientation:"bottom",align:"left",width:"auto",margin:10,top:null,left:null,zindex:9999,arrow:"50%"}}}).call(this)},{"./modules/bus":2,"./modules/leg":3}],2:[function(t,i){(function(){var s,e,o,n,r=[].slice;s=jQuery,o=t("./leg"),n=t("./utils"),i.exports=e=function(){function t(t,i){this.options=i,this.id=this.constructor.uniqueId(),this.elId="tourbus-"+this.id,this.constructor._busses[this.id]=this,this.$original=s(t),this.rawData=this.$original.data(),this.$container=s(n.dataProp(this.rawData.container,this.options.container)),this.$original.data({tourbus:this}),this.currentLegIndex=null,this.legs=[],this.legEls=this.$original.children("li"),this.totalLegs=this.legEls.length,this._configureElement(),this._setupEvents(),n.dataProp(this.rawData.autoDepart,this.options.autoDepart)&&this.$original.trigger("depart.tourbus"),this._log("built tourbus with el",""+t,"and options",this.options)}return t._busses={},t._tours=0,t.uniqueId=function(){return this._tours++},t.prototype.depart=function(){return this.running=!0,this.options.onDepart(this),this._log("departing",this),this.currentLegIndex=n.dataProp(this.rawData.startAt,this.options.startAt),this.showLeg()},t.prototype.stop=function(){return this.running?(s.each(this.legs,s.proxy(this.hideLeg,this)),this.currentLegIndex=null,this.options.onStop(this),this.running=!1):void 0},t.prototype.on=function(t,i,s){return this.$container.on(t,i,s)},t.prototype.currentLeg=function(){return null===this.currentLegIndex?null:this.legs[this.currentLegIndex]},t.prototype.buildLeg=function(t){var i,e,n;return i=s(this.legEls[t]),e=i.data(),this.legs[t]=n=new o({bus:this,original:i,target:e.el||"body",index:t,rawData:e}),n.render(),this.$el.append(n.$el),n._position(),n.hide(),n},t.prototype.showLeg=function(t){var i,s;return null==t&&(t=this.currentLegIndex),i=this.legs[t]||this.buildLeg(t),this._log("showLeg:",i),s=this.options.onLegStart(i,this),s!==!1&&i.show(),++t<this.totalLegs&&!this.legs[t]?this.buildLeg(t):void 0},t.prototype.hideLeg=function(t){var i,s;return null==t&&(t=this.currentLegIndex),i=this.legs[t],i&&i.visible&&(this._log("hideLeg:",i),s=this.options.onLegEnd(i,this),s!==!1&&i.hide()),--t>0&&!this.legs[t]?this.buildLeg(t):void 0},t.prototype.repositionLegs=function(){return s.each(this.legs,function(){return this.reposition()})},t.prototype.next=function(){return this.hideLeg(),this.currentLegIndex++,this.currentLegIndex>this.totalLegs-1?this.$original.trigger("stop.tourbus"):this.showLeg()},t.proto
|