diff --git a/js/hopscotch-min.js b/js/hopscotch-min.js index eff94497..62244a5f 100644 --- a/js/hopscotch-min.js +++ b/js/hopscotch-min.js @@ -1 +1 @@ -(function(c,d){var m,e,j,i,g,a,l=c[d],h="undefined",b=false,k=(typeof window.sessionStorage!==h),f=document.body.style;if(l){return}a=function(){if(b){l.startTour()}};if(window.addEventListener){window.addEventListener("load",a)}else{if(window.attachEvent){window.attachEvent("onload",a)}}i={addClass:function(p,r){var o,q,n;if(p.className.length===0){p.className=r}else{o=p.className.split(" ");for(q=0,n=o.length;q=0){i.addClass(u,"prev")}else{i.addClass(u,"next")}return u},p=function(v,u,x){var w="hide";if(x){w="hide-all"}if(typeof u===h){u=true}if(u){i.removeClass(v,w)}else{i.addClass(v,w)}},q=function(A,x,H){var D,u,B,w,C,y,z=6,G=i.getStepTarget(x),v=A.element,F=A.arrowEl,E=i.getPixelValue(x.arrowOffset);H=i.valOrDefault(H,true);D=i.getPixelValue(x.width)||s.bubbleWidth;B=i.valOrDefault(x.padding,s.bubblePadding);i.removeClass(v,"fade-in-down fade-in-up fade-in-left fade-in-right");w=G.getBoundingClientRect();if(x.orientation==="top"){u=v.offsetHeight;C=(w.top-u)-s.arrowWidth;y=w.left}else{if(x.orientation==="bottom"){C=w.bottom+s.arrowWidth;y=w.left}else{if(x.orientation==="left"){C=w.top;y=w.left-D-2*B-2*z-s.arrowWidth}else{if(x.orientation==="right"){C=w.top;y=w.right+s.arrowWidth}}}}if(!E){F.style.top="";F.style.left=""}else{if(x.orientation==="top"||x.orientation==="bottom"){F.style.top="";F.style.left=E+"px"}else{if(x.orientation==="left"||x.orientation==="right"){F.style.left="";F.style.top=E+"px"}}}y+=i.getPixelValue(x.xOffset);C+=i.getPixelValue(x.yOffset);if(!x.fixedElement){C+=i.getScrollTop();y+=i.getScrollLeft()}v.style.position=(x.fixedElement?"fixed":"absolute");v.style.top=C+"px";v.style.left=y+"px"},t=function(){var y=document.createElement("div"),z=document.createElement("div"),x=document.createElement("div"),w=this,A=false,v,u;this.element=y;this.containerEl=z;this.titleEl=document.createElement("h3");this.numberEl=document.createElement("span");this.contentEl=document.createElement("p");y.id="hopscotch-bubble";i.addClass(y,"animated");z.id="hopscotch-bubble-container";this.numberEl.id="hopscotch-bubble-number";z.appendChild(this.numberEl);x.appendChild(this.titleEl);x.appendChild(this.contentEl);x.id="hopscotch-bubble-content";z.appendChild(x);y.appendChild(z);this.initNavButtons();this.initCloseButton();this.initArrow();v=function(){if(A||!o){return}A=true;u=setTimeout(function(){q(w,n,false);A=false},200)};if(window.addEventListener){window.addEventListener("resize",v)}else{if(window.attachEvent){window.attachEvent("onresize",v)}}this.hide(false);document.body.appendChild(y);return this};this.initNavButtons=function(){var u=document.createElement("div");this.prevBtnEl=r("hopscotch-prev",j.prevBtn);this.nextBtnEl=r("hopscotch-next",j.nextBtn);this.doneBtnEl=r("hopscotch-done",j.doneBtn);i.addClass(this.doneBtnEl,"hide");u.appendChild(this.prevBtnEl);u.appendChild(this.nextBtnEl);u.appendChild(this.doneBtnEl);i.addClickListener(this.prevBtnEl,function(v){l.prevStep()});i.addClickListener(this.nextBtnEl,function(v){l.nextStep()});i.addClickListener(this.doneBtnEl,l.endTour);u.id="hopscotch-actions";this.buttonsEl=u;this.containerEl.appendChild(u);return this};this.initCloseButton=function(){var u=document.createElement("a");u.id="hopscotch-bubble-close";u.href="#";u.title=j.closeTooltip;u.innerHTML=j.closeTooltip;i.addClickListener(u,function(w){var v=l.getCurrStepNum(),x=l.getCurrTour(),y=(v===x.steps.length-1);i.invokeCallbacks("close",[x.id,v]);l.endTour(true,y);if(w.preventDefault){w.preventDefault()}else{if(event){event.returnValue=false}}});this.closeBtnEl=u;this.containerEl.appendChild(u);return this};this.initArrow=function(){var u,v;this.arrowEl=document.createElement("div");this.arrowEl.id="hopscotch-bubble-arrow-container";v=document.createElement("div");v.className="hopscotch-bubble-arrow-border";u=document.createElement("div");u.className="hopscotch-bubble-arrow";this.arrowEl.appendChild(v);this.arrowEl.appendChild(u);this.element.appendChild(this.arrowEl);return this};this.renderStep=function(w,B,x,y,C){var D=this,v=i.valOrDefault(w.showNextButton,s.showNextButton),u=i.valOrDefault(w.showPrevButton,s.showPrevButton),A,z;n=w;this.setTitle(w.title?w.title:"");this.setContent(w.content?w.content:"");this.setNum(B);this.orientation=w.orientation;this.showPrevButton(this.prevBtnEl&&u&&(B>0||x>0));this.showNextButton(this.nextBtnEl&&v&&!y);this.nextBtnEl.value=w.showSkip?j.skipBtn:j.nextBtn;if(y){i.removeClass(this.doneBtnEl,"hide")}else{i.addClass(this.doneBtnEl,"hide")}this.setArrow(w.orientation);A=i.getPixelValue(w.width)||s.bubbleWidth;z=i.valOrDefault(w.padding,s.bubblePadding);this.containerEl.style.width=A+"px";this.containerEl.style.padding=z+"px";this.element.style.zIndex=(w.zindex?w.zindex:"");if(w.orientation==="top"){setTimeout(function(){q(D,w);if(C){if(!w.fixedElement){C()}else{D.show()}}},5)}else{q(this,w);if(C){if(!w.fixedElement){C()}else{D.show()}}}return this};this.setTitle=function(u){if(u){this.titleEl.innerHTML=u;i.removeClass(this.titleEl,"hide")}else{i.addClass(this.titleEl,"hide")}return this};this.setContent=function(u){if(u){this.contentEl.innerHTML=u;i.removeClass(this.contentEl,"hide")}else{i.addClass(this.contentEl,"hide")}return this};this.setNum=function(u){if(j.stepNums&&u0)?E[z]:E},n=function(){return u.steps[p].length>0},A=function(){var E=u.steps[p].length;if(z0){--z;return true}else{if(p>0){E=u.steps[--p].length;if(E){z=E-1}else{z=undefined}return true}}return false},w=function(P){var N=s(),X=N.element,T=i.getPixelValue(X.style.top),S=T+i.getPixelValue(X.offsetHeight),Q=i.getStepTarget(B()),Y=Q.getBoundingClientRect(),V=Y.top+i.getScrollTop(),R=Y.bottom+i.getScrollTop(),L=(TR)?S:R,U=i.getScrollTop(),G=U+i.getWindowHeight(),H=L-q.scrollTopMargin,O=this,F,K,J,W,I,M;if(typeof YAHOO!==h&&typeof YAHOO.env!==h&&typeof YAHOO.env.ua!==h&&typeof YAHOO.util!==h&&typeof YAHOO.util.Scroll!==h){F=YAHOO.env.ua.webkit?document.body:document.documentElement;J=YAHOO.util.Easing?YAHOO.util.Easing.easeOut:undefined;K=new YAHOO.util.Scroll(F,{scroll:{to:[0,H]}},q.scrollDuration/1000,J);K.onComplete.subscribe(P);K.animate();return}if(H<0){H=0}if(L>=U&&L<=U+q.scrollTopMargin){if(P){P()}return}if(LG){if(q.smoothScroll){W=(U>L)?-1:1;I=Math.abs(U-H)/(q.scrollDuration/10);M=setInterval(function(){var aa=i.getScrollTop(),Z=aa+(W*I);if((W>0&&Z>=H)||W<0&&Z<=H){Z=H;clearInterval(M);if(P){P()}window.scrollTo(0,Z);return}window.scrollTo(0,Z);if(i.getScrollTop()===aa){clearInterval(M);if(P){P()}}},10)}else{window.scrollTo(0,H);if(P){P()}}}else{if(P){P()}return}},D=function(){if(o){this.configure(o)}};this.loadTour=function(J){var H={},F,K,G,E,I;u=J;for(K in J){if(J.hasOwnProperty(K)&&K!=="id"&&K!=="steps"){H[K]=J[K]}}this.resetDefaultOptions();r.call(this,H,true);E=i.getState(q.cookieName);if(E){I=E.split(":");C=I[0];t=I[1];v=undefined;G=t.split("-");if(G.length>1){t=parseInt(G[0],10);v=parseInt(G[1],10)}else{t=parseInt(t,10)}if(I.length>2&&I[2]==="mp"){if(v&&v0){v=0}else{v=undefined}}}}}F=s();F.showPrevButton(q.showPrevButton,true);F.showNextButton(q.showNextButton,true);return this};this.startTour=function(H,G){var E,F;if(!u){throw"Need to load a tour before you start it!"}if(document.readyState!=="complete"){b=true;return this}if(typeof H!==h){p=H;z=G}else{if(u.id===C&&typeof t!==h){p=t;z=v;F=B();if(!i.getStepTarget(F)){x();F=B();if(!i.getStepTarget(F)){this.endTour(false,false);return this}}}else{p=0}}if(!z&&n()){z=0}i.invokeCallbacks("start",[u.id,p]);this.showStep(p,z);E=s();this.isActive=true;if(q.animate){E.initAnimate()}if(!i.getStepTarget(B())){i.invokeCallbacks("error",[u.id,p]);if(q.skipIfNoElement){this.nextStep(false)}}else{this.showStep(p,z)}return this};this.showStep=function(N,F){var H=u.steps,G=H[N],E=H.length,L=u.id+":"+N,K=s(),J=i.valOrDefault(G.delay,0),M=this,I;p=N;z=F;if(typeof F!==h&&n()){G=G[F];L+="-"+F}I=(N===E-1)||(F>=G.length-1);setTimeout(function(){K.renderStep(G,N,F,I,function(){w(function(){K.show.call(K)});if(G.onShow){G.onShow()}});i.invokeCallbacks("show",[u.id,p])},J);if(G.multipage){L+=":mp"}i.setState(q.cookieName,L,1);return this};this.prevStep=function(){var G=B(),F=false,E=s();if(G.onPrev){G.onPrev()}i.invokeCallbacks("prev",[u.id,p]);if(q.skipIfNoElement){while(!F&&x()){G=B();F=i.getStepTarget(G);if(!F){i.invokeCallbacks("error",[u.id,p])}}if(!F){return this.endTour(true,false)}}else{if(x()){G=B();if(!i.getStepTarget(G)){i.invokeCallbacks("error",[u.id,p]);return this.endTour(true,false)}}}E.hide(false);this.showStep(p,z);return this};this.nextStep=function(I){var H=B(),G=p,F=false,E=s();I=i.valOrDefault(I,true);if(q.skipIfNoElement){while(!F&&A()){H=B();F=i.getStepTarget(H);if(!F){i.invokeCallbacks("error",[u.id,p])}}if(!F){return this.endTour(true,false)}}else{if(A()){H=B();if(!i.getStepTarget(H)){i.invokeCallbacks("error",[u.id,p]);return this.endTour(true,false)}}}if(I){if(H.onNext){H.onNext()}i.invokeCallbacks("next",[u.id,G])}E.hide(false);this.showStep(p,z);return this};this.endTour=function(G,F){var E=s();G=i.valOrDefault(G,true);F=i.valOrDefault(F,true);p=0;z=undefined;t=undefined;E.hide();if(G){i.clearState(q.cookieName)}l.isActive=false;if(F){i.invokeCallbacks("end",[u.id])}l.removeCallbacks(true);return this};this.getCurrTour=function(){return u};this.getCurrStepNum=function(){return p};this.getCurrSubstepNum=function(){return z};this.addCallback=function(G,E,F){if(E){g[G].push({cb:E,fromTour:F})}return this};this.removeCallbacks=function(F){var I,G,E,H;for(H in g){if(F){I=g[H];for(G=0,E=I.length;G=0){i.addClass(u,"prev")}else{i.addClass(u,"next")}return u},p=function(v,u,x){var w="hide";if(x){w="hide-all"}if(typeof u===h){u=true}if(u){i.removeClass(v,w)}else{i.addClass(v,w)}},q=function(A,x){var D,u,B,w,C,y,z=6,G=i.getStepTarget(x),v=A.element,F=A.arrowEl,E=i.getPixelValue(x.arrowOffset);D=i.getPixelValue(x.width)||s.bubbleWidth;B=i.valOrDefault(x.padding,s.bubblePadding);i.removeClass(v,"fade-in-down fade-in-up fade-in-left fade-in-right");w=G.getBoundingClientRect();if(x.orientation==="top"){u=v.offsetHeight;C=(w.top-u)-s.arrowWidth;y=w.left}else{if(x.orientation==="bottom"){C=w.bottom+s.arrowWidth;y=w.left}else{if(x.orientation==="left"){C=w.top;y=w.left-D-2*B-2*z-s.arrowWidth}else{if(x.orientation==="right"){C=w.top;y=w.right+s.arrowWidth}}}}if(!E){F.style.top="";F.style.left=""}else{if(x.orientation==="top"||x.orientation==="bottom"){F.style.top="";F.style.left=E+"px"}else{if(x.orientation==="left"||x.orientation==="right"){F.style.left="";F.style.top=E+"px"}}}y+=i.getPixelValue(x.xOffset);C+=i.getPixelValue(x.yOffset);if(!x.fixedElement){C+=i.getScrollTop();y+=i.getScrollLeft()}v.style.position=(x.fixedElement?"fixed":"absolute");v.style.top=C+"px";v.style.left=y+"px"},t=function(){var y=document.createElement("div"),z=document.createElement("div"),x=document.createElement("div"),w=this,A=false,v,u;this.element=y;this.containerEl=z;this.titleEl=document.createElement("h3");this.numberEl=document.createElement("span");this.contentEl=document.createElement("p");y.id="hopscotch-bubble";i.addClass(y,"animated");z.id="hopscotch-bubble-container";this.numberEl.id="hopscotch-bubble-number";z.appendChild(this.numberEl);x.appendChild(this.titleEl);x.appendChild(this.contentEl);x.id="hopscotch-bubble-content";z.appendChild(x);y.appendChild(z);this.initNavButtons();this.initCloseButton();this.initArrow();v=function(){if(A||!o){return}A=true;u=setTimeout(function(){q(w,n,false);A=false},200)};if(window.addEventListener){window.addEventListener("resize",v)}else{if(window.attachEvent){window.attachEvent("onresize",v)}}this.hide(false);document.body.appendChild(y);return this};this.initNavButtons=function(){var u=document.createElement("div");this.prevBtnEl=r("hopscotch-prev",j.prevBtn);this.nextBtnEl=r("hopscotch-next",j.nextBtn);this.doneBtnEl=r("hopscotch-done",j.doneBtn);i.addClass(this.doneBtnEl,"hide");u.appendChild(this.prevBtnEl);u.appendChild(this.nextBtnEl);u.appendChild(this.doneBtnEl);i.addClickListener(this.prevBtnEl,function(v){l.prevStep()});i.addClickListener(this.nextBtnEl,function(v){l.nextStep()});i.addClickListener(this.doneBtnEl,l.endTour);u.id="hopscotch-actions";this.buttonsEl=u;this.containerEl.appendChild(u);return this};this.initCloseButton=function(){var u=document.createElement("a");u.id="hopscotch-bubble-close";u.href="#";u.title=j.closeTooltip;u.innerHTML=j.closeTooltip;i.addClickListener(u,function(w){var v=l.getCurrStepNum(),x=l.getCurrTour(),y=(v===x.steps.length-1);i.invokeCallbacks("close",[x.id,v]);l.endTour(true,y);if(w.preventDefault){w.preventDefault()}else{if(event){event.returnValue=false}}});this.closeBtnEl=u;this.containerEl.appendChild(u);return this};this.initArrow=function(){var u,v;this.arrowEl=document.createElement("div");this.arrowEl.id="hopscotch-bubble-arrow-container";v=document.createElement("div");v.className="hopscotch-bubble-arrow-border";u=document.createElement("div");u.className="hopscotch-bubble-arrow";this.arrowEl.appendChild(v);this.arrowEl.appendChild(u);this.element.appendChild(this.arrowEl);return this};this.renderStep=function(w,B,x,y,C){var D=this,v=i.valOrDefault(w.showNextButton,s.showNextButton),u=i.valOrDefault(w.showPrevButton,s.showPrevButton),A,z;n=w;this.setTitle(w.title?w.title:"");this.setContent(w.content?w.content:"");this.setNum(B);this.orientation=w.orientation;this.showPrevButton(this.prevBtnEl&&u&&(B>0||x>0));this.showNextButton(this.nextBtnEl&&v&&!y);this.nextBtnEl.value=w.showSkip?j.skipBtn:j.nextBtn;if(y){i.removeClass(this.doneBtnEl,"hide")}else{i.addClass(this.doneBtnEl,"hide")}this.setArrow(w.orientation);A=i.getPixelValue(w.width)||s.bubbleWidth;z=i.valOrDefault(w.padding,s.bubblePadding);this.containerEl.style.width=A+"px";this.containerEl.style.padding=z+"px";this.element.style.zIndex=(w.zindex?w.zindex:"");if(w.orientation==="top"){setTimeout(function(){q(D,w);if(C){if(!w.fixedElement){C()}else{D.show()}}},5)}else{q(this,w);if(C){if(!w.fixedElement){C()}else{D.show()}}}return this};this.setTitle=function(u){if(u){this.titleEl.innerHTML=u;i.removeClass(this.titleEl,"hide")}else{i.addClass(this.titleEl,"hide")}return this};this.setContent=function(u){if(u){this.contentEl.innerHTML=u;i.removeClass(this.contentEl,"hide")}else{i.addClass(this.contentEl,"hide")}return this};this.setNum=function(u){if(j.stepNums&&u0)?E[z]:E},n=function(){return u.steps[p].length>0},A=function(){var E=u.steps[p].length;if(z0){--z;return true}else{if(p>0){E=u.steps[--p].length;if(E){z=E-1}else{z=undefined}return true}}return false},w=function(P){var N=s(),X=N.element,T=i.getPixelValue(X.style.top),S=T+i.getPixelValue(X.offsetHeight),Q=i.getStepTarget(B()),Y=Q.getBoundingClientRect(),V=Y.top+i.getScrollTop(),R=Y.bottom+i.getScrollTop(),L=(TR)?S:R,U=i.getScrollTop(),G=U+i.getWindowHeight(),H=L-q.scrollTopMargin,O=this,F,K,J,W,I,M;if(typeof YAHOO!==h&&typeof YAHOO.env!==h&&typeof YAHOO.env.ua!==h&&typeof YAHOO.util!==h&&typeof YAHOO.util.Scroll!==h){F=YAHOO.env.ua.webkit?document.body:document.documentElement;J=YAHOO.util.Easing?YAHOO.util.Easing.easeOut:undefined;K=new YAHOO.util.Scroll(F,{scroll:{to:[0,H]}},q.scrollDuration/1000,J);K.onComplete.subscribe(P);K.animate();return}if(H<0){H=0}if(L>=U&&L<=U+q.scrollTopMargin){if(P){P()}return}if(LG){if(q.smoothScroll){W=(U>L)?-1:1;I=Math.abs(U-H)/(q.scrollDuration/10);M=setInterval(function(){var aa=i.getScrollTop(),Z=aa+(W*I);if((W>0&&Z>=H)||W<0&&Z<=H){Z=H;clearInterval(M);if(P){P()}window.scrollTo(0,Z);return}window.scrollTo(0,Z);if(i.getScrollTop()===aa){clearInterval(M);if(P){P()}}},10)}else{window.scrollTo(0,H);if(P){P()}}}else{if(P){P()}return}},D=function(){if(o){this.configure(o)}};this.loadTour=function(J){var H={},F,K,G,E,I;u=J;for(K in J){if(J.hasOwnProperty(K)&&K!=="id"&&K!=="steps"){H[K]=J[K]}}this.resetDefaultOptions();r.call(this,H,true);E=i.getState(q.cookieName);if(E){I=E.split(":");C=I[0];t=I[1];v=undefined;G=t.split("-");if(G.length>1){t=parseInt(G[0],10);v=parseInt(G[1],10)}else{t=parseInt(t,10)}if(I.length>2&&I[2]==="mp"){if(v&&v0){v=0}else{v=undefined}}}}}F=s();F.showPrevButton(q.showPrevButton,true);F.showNextButton(q.showNextButton,true);return this};this.startTour=function(H,G){var E,F;if(!u){throw"Need to load a tour before you start it!"}if(document.readyState!=="complete"){b=true;return this}if(typeof H!==h){p=H;z=G}else{if(u.id===C&&typeof t!==h){p=t;z=v;F=B();if(!i.getStepTarget(F)){x();F=B();if(!i.getStepTarget(F)){this.endTour(false,false);return this}}}else{p=0}}if(!z&&n()){z=0}i.invokeCallbacks("start",[u.id,p]);this.showStep(p,z);E=s();this.isActive=true;if(q.animate){E.initAnimate()}if(!i.getStepTarget(B())){i.invokeCallbacks("error",[u.id,p]);if(q.skipIfNoElement){this.nextStep(false)}}else{this.showStep(p,z)}return this};this.showStep=function(N,F){var H=u.steps,G=H[N],E=H.length,L=u.id+":"+N,K=s(),J=i.valOrDefault(G.delay,0),M=this,I;p=N;z=F;if(typeof F!==h&&n()){G=G[F];L+="-"+F}I=(N===E-1)||(F>=G.length-1);setTimeout(function(){K.renderStep(G,N,F,I,function(){w(function(){K.show.call(K)});if(G.onShow){G.onShow()}});i.invokeCallbacks("show",[u.id,p])},J);if(G.multipage){L+=":mp"}i.setState(q.cookieName,L,1);return this};this.prevStep=function(){var G=B(),F=false,E=s();if(G.onPrev){G.onPrev()}i.invokeCallbacks("prev",[u.id,p]);if(q.skipIfNoElement){while(!F&&x()){G=B();F=i.getStepTarget(G);if(!F){i.invokeCallbacks("error",[u.id,p])}}if(!F){return this.endTour(true,false)}}else{if(x()){G=B();if(!i.getStepTarget(G)){i.invokeCallbacks("error",[u.id,p]);return this.endTour(true,false)}}}E.hide(false);this.showStep(p,z);return this};this.nextStep=function(I){var H=B(),G=p,F=false,E=s();I=i.valOrDefault(I,true);if(q.skipIfNoElement){while(!F&&A()){H=B();F=i.getStepTarget(H);if(!F){i.invokeCallbacks("error",[u.id,p])}}if(!F){return this.endTour(true,false)}}else{if(A()){H=B();if(!i.getStepTarget(H)){i.invokeCallbacks("error",[u.id,p]);return this.endTour(true,false)}}}if(I){if(H.onNext){H.onNext()}i.invokeCallbacks("next",[u.id,G])}E.hide(false);this.showStep(p,z);return this};this.endTour=function(G,F){var E=s();G=i.valOrDefault(G,true);F=i.valOrDefault(F,true);p=0;z=undefined;t=undefined;E.hide();if(G){i.clearState(q.cookieName)}l.isActive=false;if(F){i.invokeCallbacks("end",[u.id])}l.removeCallbacks(true);return this};this.getCurrTour=function(){return u};this.getCurrStepNum=function(){return p};this.getCurrSubstepNum=function(){return z};this.addCallback=function(G,E,F){if(E){g[G].push({cb:E,fromTour:F})}return this};this.removeCallbacks=function(F){var I,G,E,H;for(H in g){if(F){I=g[H];for(G=0,E=I.length;G