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.
 
 
 
 
 
 

2 lines
18 KiB

!function(t,e){"object"==typeof exports?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t)}(this,function(t){function e(t){this._targetElement=t,this._options={title:"",nextLabel:"Next &rarr;",prevLabel:"&larr; Back",skipLabel:"Skip",doneLabel:"Done",minimizeLabel:"-",tooltipPosition:"bottom",tooltipClass:"",highlightClass:"",exitOnEsc:!0,exitOnOverlayClick:!0,showStepNumbers:!0,keyboardNavigation:!0,showButtons:!0,buttonClass:"introjs-button",showBullets:!0,showProgress:!1,scrollToElement:!0,overlayOpacity:.8,positionPrecedence:["bottom","top","right","left"],disableInteraction:!1,dock:!1,allowMinimize:!1,arrowPadding:0}}function i(i){var t=[],n=this;if(this._options.steps){var e=[],o=0;for(e=this._options.steps.length;o<e;o++){var r=a(this._options.steps[o]);if(r.step=t.length+1,"string"==typeof r.element&&(r.element=document.querySelector(r.element)),void 0===r.element||null==r.element)null==(s=document.querySelector(".introjsFloatingElement"))&&((s=document.createElement("div")).className="introjsFloatingElement",document.body.appendChild(s)),r.element=s,r.position="floating";null!=r.element&&t.push(r)}}else{if((e=i.querySelectorAll("*[data-intro]")).length<1)return!1;for(o=0,r=e.length;o<r;o++){var s=e[o],l=parseInt(s.getAttribute("data-step"),10);0<l&&(t[l-1]={element:s,intro:s.getAttribute("data-intro"),step:parseInt(s.getAttribute("data-step"),10),tooltipClass:s.getAttribute("data-tooltipClass"),highlightClass:s.getAttribute("data-highlightClass"),position:s.getAttribute("data-position")||this._options.tooltipPosition})}for(o=l=0,r=e.length;o<r;o++)if(null==(s=e[o]).getAttribute("data-step")){for(;void 0!==t[l];)l++;t[l]={element:s,intro:s.getAttribute("data-intro"),step:l+1,tooltipClass:s.getAttribute("data-tooltipClass"),highlightClass:s.getAttribute("data-highlightClass"),position:s.getAttribute("data-position")||this._options.tooltipPosition}}}for(o=[],e=0;e<t.length;e++)t[e]&&o.push(t[e]);return(t=o).sort(function(t,e){return t.step-e.step}),n._introItems=t,function(t){var e=document.createElement("div"),i="",n=this;if(e.className="introjs-overlay","body"===t.tagName.toLowerCase())i+="top: 0;bottom: 0; left: 0;right: 0;position: fixed;",e.setAttribute("style",i);else{var o=H(t);o&&(i+="width: "+o.width+"px; height:"+o.height+"px; top:"+o.top+"px;left: "+o.left+"px;",e.setAttribute("style",i))}return t.appendChild(e),e.onclick=function(){1==n._options.exitOnOverlayClick&&(L.call(n,t),null!=n._introExitCallback&&n._introExitCallback.call(n))},setTimeout(function(){i+="opacity: "+n._options.overlayOpacity.toString()+";",e.setAttribute("style",i)},10),!0}.call(n,i)&&(k.call(n),i.querySelector(".introjs-skipbutton"),i.querySelector(".introjs-nextbutton"),n._onKeyDown=function(t){if(27===t.keyCode&&1==n._options.exitOnEsc)L.call(n,i),null!=n._introExitCallback&&n._introExitCallback.call(n);else if(37===t.keyCode)E.call(n);else if(39===t.keyCode)k.call(n);else if(13===t.keyCode){var e=t.target||t.srcElement;e&&0<e.className.indexOf("introjs-prevbutton")?E.call(n):e&&0<e.className.indexOf("introjs-skipbutton")?L.call(n,i):k.call(n),t.preventDefault?t.preventDefault():t.returnValue=!1}},n._onResize=function(t){I.call(n,document.querySelector(".introjs-helperLayer")),I.call(n,document.querySelector(".introjs-tooltipReferenceLayer"))},window.addEventListener?(this._options.keyboardNavigation&&window.addEventListener("keydown",n._onKeyDown,!0),window.addEventListener("resize",n._onResize,!0)):document.attachEvent&&(this._options.keyboardNavigation&&document.attachEvent("onkeydown",n._onKeyDown),document.attachEvent("onresize",n._onResize))),!1}function a(t){if(null==t||"object"!=typeof t||void 0!==t.nodeType)return t;var e,i={};for(e in t)i[e]=a(t[e]);return i}function k(){if(this._direction="forward",void 0===this._currentStep?this._currentStep=0:++this._currentStep,this._introItems.length<=this._currentStep)"function"==typeof this._introCompleteCallback&&this._introCompleteCallback.call(this),L.call(this,this._targetElement);else{var t=this._introItems[this._currentStep];void 0!==this._introBeforeChangeCallback&&this._introBeforeChangeCallback.call(this,t.element),n.call(this,t)}}function E(){if(this._direction="backward",0===this._currentStep)return!1;var t=this._introItems[--this._currentStep];void 0!==this._introBeforeChangeCallback&&this._introBeforeChangeCallback.call(this,t.element),n.call(this,t)}function L(t){var e=t.querySelector(".introjs-overlay");if(null!=e){e.style.opacity=0,setTimeout(function(){e.parentNode&&e.parentNode.removeChild(e)},500);var i=t.querySelector(".introjs-helperLayer");if(i&&i.parentNode.removeChild(i),(i=t.querySelector(".introjs-tooltipReferenceLayer"))&&i.parentNode.removeChild(i),(t=t.querySelector(".introjs-disableInteraction"))&&t.parentNode.removeChild(t),(t=document.querySelector(".introjsFloatingElement"))&&t.parentNode.removeChild(t),(t=document.querySelector(".introjs-showElement"))&&(t.className=t.className.replace(/introjs-[a-zA-Z]+/g,"").replace(/^\s+|\s+$/g,"")),(t=document.querySelectorAll(".introjs-fixParent"))&&0<t.length)for(i=t.length-1;0<=i;i--)t[i].className=t[i].className.replace(/introjs-fixParent/g,"").replace(/^\s+|\s+$/g,"");window.removeEventListener?window.removeEventListener("keydown",this._onKeyDown,!0):document.detachEvent&&document.detachEvent("onkeydown",this._onKeyDown),this._currentStep=void 0}}function T(t,e,i,n){var o="";if(e.style.top=null,e.style.right=null,e.style.bottom=null,e.style.left=null,e.style.marginLeft=null,e.style.marginTop=null,i.style.display="inherit",void 0!==n&&null!=n&&(n.style.top=null,n.style.left=null),this._introItems[this._currentStep]){if(o="string"==typeof(o=this._introItems[this._currentStep]).tooltipClass?o.tooltipClass:this._options.tooltipClass,e.className=("introjs-tooltip "+o).replace(/^\s+|\s+$/g,""),o=this._options.arrowPadding,currentTooltipPosition=this._introItems[this._currentStep].position,("auto"==currentTooltipPosition||"auto"==this._options.tooltipPosition)&&"floating"!=currentTooltipPosition){var r=currentTooltipPosition,s=this._options.positionPrecedence.slice(),l=d(),a=H(e).height+10,c=H(e).width+20,h=H(t),p="floating";h.left+c>l.width||h.left+h.width/2-c<0?(u(s,"bottom"),u(s,"top")):(h.height+h.top+a>l.height&&u(s,"bottom"),h.top-a<0&&u(s,"top")),h.width+h.left+c>l.width&&u(s,"right"),h.left-c<0&&u(s,"left"),0<s.length&&(p=s[0]),r&&"auto"!=r&&-1<s.indexOf(r)&&(p=r),currentTooltipPosition=p}switch(r=H(t),s=H(e).height,l=d(),currentTooltipPosition){case"top":e.style.left="15px",e.style.top="-"+(s+10+o)+"px",i.className="introjs-arrow bottom";break;case"right":e.style.left=H(t).width+20+o+"px",r.top+s>l.height&&(i.className="introjs-arrow left-bottom",e.style.top="-"+(s-r.height-20)+"px"),i.className="introjs-arrow left";break;case"left":1==this._options.showStepNumbers&&(e.style.top="15px"),r.top+s>l.height?(e.style.top="-"+(s-r.height-20)+"px",i.className="introjs-arrow right-bottom"):i.className="introjs-arrow right",e.style.right=r.width+20+o+"px";break;case"floating":i.style.display="none",t=H(e),e.style.left="50%",e.style.top="50%",e.style.marginLeft="-"+t.width/2+"px",e.style.marginTop="-"+t.height/2+"px",void 0!==n&&null!=n&&(n.style.left="-"+(t.width/2+18)+"px",n.style.top="-"+(t.height/2+18)+"px");break;case"bottom-right-aligned":i.className="introjs-arrow top-right",e.style.right="0px",e.style.bottom="-"+(H(e).height+10+o)+"px";break;case"bottom-middle-aligned":n=H(t),t=H(e),i.className="introjs-arrow top-middle",e.style.left=n.width/2-t.width/2+"px",e.style.bottom="-"+(t.height+10+o)+"px";break;default:e.style.bottom="-"+(H(e).height+10+o)+"px",i.className="introjs-arrow top"}}}function u(t,e){-1<t.indexOf(e)&&t.splice(t.indexOf(e),1)}function I(t){if(t&&this._introItems[this._currentStep]){var e=this._introItems[this._currentStep],i=H(e.element),n=10;"floating"==e.position&&(n=0),t.setAttribute("style","width: "+(i.width+n)+"px; height:"+(i.height+n)+"px; top:"+(i.top-5)+"px;left: "+(i.left-5)+"px;"),A.call(this,e.element)}}function q(){var t=document.querySelector(".introjs-disableInteraction");null===t&&((t=document.createElement("div")).className="introjs-disableInteraction",this._targetElement.appendChild(t)),I.call(this,t)}function n(e){void 0!==this._introChangeCallback&&this._introChangeCallback.call(this,e.element);var i=this,t=document.querySelector(".introjs-helperLayer"),n=document.querySelector(".introjs-tooltipReferenceLayer"),o="introjs-helperLayer",r=this._options.buttonClass;if(H(e.element),"string"==typeof e.highlightClass&&(o+=" "+e.highlightClass),"string"==typeof this._options.highlightClass&&(o+=" "+this._options.highlightClass),null!=t){var s=n.querySelector(".introjs-helperNumberLayer"),l=n.querySelector(".introjs-tooltiptext"),a=n.querySelector(".introjs-steptitle"),c=n.querySelector(".introjs-nextsteptitle"),h=n.querySelector(".introjs-arrow"),p=n.querySelector(".introjs-tooltip"),u=n.querySelector(".introjs-skipbutton"),d=n.querySelector(".introjs-prevbutton"),m=n.querySelector(".introjs-nextbutton");if(t.className=o,this._options.dock||(p.style.opacity=0,p.style.display="none"),null!=s){var f=this._introItems[0<=e.step-2?e.step-2:0];(null!=f&&"forward"==this._direction&&"floating"==f.position||"backward"==this._direction&&"floating"==e.position)&&(s.style.opacity=0)}if(I.call(i,t),I.call(i,n),(f=document.querySelectorAll(".introjs-fixParent"))&&0<f.length)for(o=f.length-1;0<=o;o--)f[o].className=f[o].className.replace(/introjs-fixParent/g,"").replace(/^\s+|\s+$/g,"");(f=document.querySelector(".introjs-showElement")).className=f.className.replace(/introjs-[a-zA-Z]+/g,"").replace(/^\s+|\s+$/g,""),i._lastShowElementTimer&&clearTimeout(i._lastShowElementTimer),i._lastShowElementTimer=setTimeout(function(){null!=s&&(s.innerHTML=e.step),l.innerHTML=e.intro,e.title?(a.style.display="block",a.innerHTML=e.title):a.style.display="none";var t=i.getNextStep();t&&t.title?(c.style.display="block",c.innerHTML=t.title):c.style.display="none",p.style.display="block",T.call(i,e.element,p,h,s),n.querySelector(".introjs-bullets li > a.active").className="",n.querySelector('.introjs-bullets li > a[data-stepnumber="'+e.step+'"]').className="active",n.querySelector(".introjs-progress .introjs-progressbar").setAttribute("style","width:"+M.call(i)+"%;"),p.style.opacity=1,s&&(s.style.opacity=1),-1===m.tabIndex?u.focus():m.focus()},350)}else{var y=document.createElement("div"),g=(d=document.createElement("div"),t=document.createElement("div"),document.createElement("div")),b=document.createElement("div"),_=document.createElement("div"),v=document.createElement("div"),w=document.createElement("div"),C=document.createElement("div"),j=document.createElement("div");y.className=o,d.className="introjs-tooltipReferenceLayer",this._options.dock&&(d.className+=" introjs-docked"),I.call(i,y),I.call(i,d),this._targetElement.appendChild(y),this._targetElement.appendChild(d),t.className="introjs-arrow",b.className="introjs-tooltiptext",b.innerHTML=e.intro,!(w.className="introjs-bullets")===this._options.showBullets&&(w.style.display="none");y=document.createElement("ul"),o=0;for(var N=this._introItems.length;o<N;o++){var S=document.createElement("li"),x=document.createElement("a");x.onclick=function(){i.goToStep(this.getAttribute("data-stepnumber"))},o===e.step-1&&(x.className="active"),x.href="javascript:void(0);",x.innerHTML="&nbsp;",x.setAttribute("data-stepnumber",this._introItems[o].step),S.appendChild(x),y.appendChild(S)}w.appendChild(y),!(C.className="introjs-progress")===this._options.showProgress&&(C.style.display="none"),(o=document.createElement("div")).className="introjs-progressbar",o.setAttribute("style","width:"+M.call(this)+"%;"),C.appendChild(o),!(j.className="introjs-tooltipbuttons")===this._options.showButtons&&(j.style.display="none"),this._options.title&&((o=document.createElement("div")).className="introjs-introtitle",o.innerHTML=this._options.title,g.appendChild(o)),_.className="introjs-steptitle",e.title?_.innerHTML=e.title:_.style.display="none",v.className="introjs-nextsteptitle",(o=this.getNextStep())&&o.title?v.innerHTML=o.title:v.style.display="none",g.className="introjs-tooltip",g.appendChild(_),g.appendChild(b),g.appendChild(v),g.appendChild(w),g.appendChild(C),1==this._options.showStepNumbers&&((f=document.createElement("span")).className="introjs-helperNumberLayer",f.innerHTML=e.step,d.appendChild(f)),g.appendChild(t),d.appendChild(g),(m=document.createElement("a")).onclick=function(){i._introItems.length-1!=i._currentStep&&k.call(i)},m.href="javascript:void(0);",m.innerHTML=this._options.nextLabel,(d=document.createElement("a")).onclick=function(){0!=i._currentStep&&E.call(i)},d.href="javascript:void(0);",d.innerHTML=this._options.prevLabel,(u=document.createElement("a")).className=r+" introjs-skipbutton",u.href="javascript:void(0);",u.innerHTML=this._options.skipLabel,u.onclick=function(){i._introItems.length-1==i._currentStep&&"function"==typeof i._introCompleteCallback&&i._introCompleteCallback.call(i),i._introItems.length-1!=i._currentStep&&"function"==typeof i._introExitCallback&&i._introExitCallback.call(i),L.call(i,i._targetElement)},j.appendChild(u),this._options.allowMinimize&&((b=document.createElement("a")).className="introjs-button introjs-minimizebutton",b.href="javascript:void(0);",b.innerHTML=this._options.minimizeLabel,b.onclick=function(){(function(){document.body.className=this._isMinimized?document.body.className.replace(" introjs-minimized",""):document.body.className+" introjs-minimized",this._isMinimized=!this._isMinimized}).call(i)},j.appendChild(b)),1<this._introItems.length&&(j.appendChild(d),j.appendChild(m)),g.appendChild(j),T.call(i,e.element,g,t,f)}for(!0===this._options.disableInteraction&&q.call(i),d.removeAttribute("tabIndex"),m.removeAttribute("tabIndex"),0==this._currentStep&&1<this._introItems.length?(d.className=r+" introjs-prevbutton introjs-disabled",d.tabIndex="-1",m.className=r+" introjs-nextbutton",u.innerHTML=this._options.skipLabel):this._introItems.length-1==this._currentStep||1==this._introItems.length?(u.innerHTML=this._options.doneLabel,u.className+=" introjs-donebutton",d.className=r+" introjs-prevbutton",m.className=r+" introjs-nextbutton introjs-disabled",m.tabIndex="-1"):(d.className=r+" introjs-prevbutton",m.className=r+" introjs-nextbutton",u.innerHTML=this._options.skipLabel),m.focus(),e.element.className+=" introjs-showElement","absolute"!==(r=P(e.element,"position"))&&"relative"!==r&&(e.element.className+=" introjs-relativePosition"),r=e.element.parentNode;null!=r&&"body"!==r.tagName.toLowerCase();)f=P(r,"z-index"),t=parseFloat(P(r,"opacity")),g=P(r,"transform")||P(r,"-webkit-transform")||P(r,"-moz-transform")||P(r,"-ms-transform")||P(r,"-o-transform"),(/[0-9]+/.test(f)||t<1||"none"!==g)&&(r.className+=" introjs-fixParent"),r=r.parentNode;A.call(this,e.element),void 0!==this._introAfterChangeCallback&&this._introAfterChangeCallback.call(this,e.element)}function A(t){if(!(0<=(i=t.getBoundingClientRect()).top&&0<=i.left&&i.bottom+80<=window.innerHeight&&i.right<=window.innerWidth)&&!0===this._options.scrollToElement){var e=t.getBoundingClientRect(),i=d().height,n=e.bottom-(e.bottom-e.top);e=e.bottom-i;n<0||t.clientHeight>i?window.scrollBy(0,n-30):window.scrollBy(0,e+100)}}function P(t,e){var i="";return t.currentStyle?i=t.currentStyle[e]:document.defaultView&&document.defaultView.getComputedStyle&&(i=document.defaultView.getComputedStyle(t,null).getPropertyValue(e)),i&&i.toLowerCase?i.toLowerCase():i}function d(){if(null!=window.innerWidth)return{width:window.innerWidth,height:window.innerHeight};var t=document.documentElement;return{width:t.clientWidth,height:t.clientHeight}}function H(t){var e={};e.width=t.offsetWidth,e.height=t.offsetHeight;for(var i=0,n=0;t&&!isNaN(t.offsetLeft)&&!isNaN(t.offsetTop);)i+=t.offsetLeft,n+=t.offsetTop,t=t.offsetParent;return e.top=n,e.left=i,e}function M(){return parseInt(this._currentStep+1,10)/this._introItems.length*100}function o(t){if("object"==typeof t)return new e(t);if("string"!=typeof t)return new e(document.body);if(t=document.querySelector(t))return new e(t);throw Error("There is no element with given selector.")}return o.version="1.0.0",o.fn=e.prototype={clone:function(){return new e(this)},setOption:function(t,e){return this._options[t]=e,this},setOptions:function(t){var e,i=this._options,n={};for(e in i)n[e]=i[e];for(e in t)n[e]=t[e];return this._options=n,this},start:function(){return i.call(this,this._targetElement),this},goToStep:function(t){return this._currentStep=t-2,void 0!==this._introItems&&k.call(this),this},nextStep:function(){return k.call(this),this},getNextStep:function(){return this._introItems[this._currentStep+1]},previousStep:function(){return E.call(this),this},exit:function(){return L.call(this,this._targetElement),this},refresh:function(){return I.call(this,document.querySelector(".introjs-helperLayer")),I.call(this,document.querySelector(".introjs-tooltipReferenceLayer")),!0===this._options.disableInteraction&&q.call(this),this},onbeforechange:function(t){if("function"!=typeof t)throw Error("Provided callback for onbeforechange was not a function");return this._introBeforeChangeCallback=t,this},onchange:function(t){if("function"!=typeof t)throw Error("Provided callback for onchange was not a function.");return this._introChangeCallback=t,this},onafterchange:function(t){if("function"!=typeof t)throw Error("Provided callback for onafterchange was not a function");return this._introAfterChangeCallback=t,this},oncomplete:function(t){if("function"!=typeof t)throw Error("Provided callback for oncomplete was not a function.");return this._introCompleteCallback=t,this},onexit:function(t){if("function"!=typeof t)throw Error("Provided callback for onexit was not a function.");return this._introExitCallback=t,this}},t.introJs=o});
//# sourceMappingURL=introjs.min.js.map