diff --git a/css/hopscotch.css b/css/hopscotch.css index 44ef1456..877fb059 100644 --- a/css/hopscotch.css +++ b/css/hopscotch.css @@ -21,7 +21,7 @@ div#hopscotch-bubble #hopscotch-bubble-arrow-container.left{top:10px;left:-26px; div#hopscotch-bubble #hopscotch-bubble-arrow-container.left .hopscotch-bubble-arrow-border{border-right:20px solid #000000;border-right:20px solid rgba(0, 0, 0, 0.5);border-bottom:20px solid transparent;border-top:20px solid transparent;} div#hopscotch-bubble #hopscotch-bubble-arrow-container.right{top:10px;right:-46px;}div#hopscotch-bubble #hopscotch-bubble-arrow-container.right .hopscotch-bubble-arrow{border-bottom:20px solid transparent;border-left:20px solid #ffffff;border-top:20px solid transparent;position:relative;left:-9px;top:-40px;} div#hopscotch-bubble #hopscotch-bubble-arrow-container.right .hopscotch-bubble-arrow-border{border-left:20px solid #000000;border-left:20px solid rgba(0, 0, 0, 0.5);border-bottom:20px solid transparent;border-top:20px solid transparent;} -div#hopscotch-bubble #hopscotch-actions{text-align:right;} +div#hopscotch-bubble #hopscotch-actions{margin:10px 0 0;text-align:right;} div#hopscotch-bubble input.hopscotch-nav-button{border-width:1px;border-style:solid;cursor:pointer;font-size:12px;line-height:1.35;margin:0;overflow:visible;padding:3px 10px 2px;*padding:2px 10px 1px;text-decoration:none !important;vertical-align:top;width:auto;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;*padding:3px 10px;}div#hopscotch-bubble input.hopscotch-nav-button.next{background:#FFCF0B;background:-moz-linear-gradient(top, #fff5bd 0, #fff5bd 1px, #ffe976 1px, #ffcf0b 100%);background:-o-linear-gradient(top, #fff5bd 0, #fff5bd 1px, #ffe976 1px, #ffcf0b 100%);background:-webkit-gradient(linear, left top, left bottom, color-stop(0, #fff5bd), color-stop(5%, #fff5bd), color-stop(5%, #ffe976), color-stop(100%, #ffcf0b));background:linear-gradient(top, #fff5bd 0, #fff5bd 1px, #ffe976 1px, #ffcf0b 100%);filter:progid:dximagetransform.microsoft.gradient(startColorstr='#FFE976', endColorstr='#FFCF0B', GradientType=0);border-color:#e8b463;color:#333;font-weight:bold;margin:0 0 0 10px;overflow:visible;}div#hopscotch-bubble input.hopscotch-nav-button.next.hide-all{display:none;} div#hopscotch-bubble input.hopscotch-nav-button.next:hover{background:#F6C408;background:-moz-linear-gradient(top, #faeeae 0, #faeeae 1px, #f5db59 1px, #f6c408 100%);background:-o-linear-gradient(top, #faeeae 0, #faeeae 1px, #f5db59 1px, #f6c408 100%);background:-webkit-gradient(linear, left top, left bottom, color-stop(0, #faeeae), color-stop(5%, #faeeae), color-stop(5%, #f5db59), color-stop(100%, #f6c408));background:linear-gradient(top, #faeeae 0, #faeeae 1px, #f5db59 1px, #f6c408 100%);filter:progid:dximagetransform.microsoft.gradient(startColorstr='#F5DB59', endColorstr='#F6C408', GradientType=0);} div#hopscotch-bubble input.hopscotch-nav-button.next:active{background:#F5DD61;background:-moz-linear-gradient(top, #f6c202 0, #f5dd61 100%);background:-o-linear-gradient(top, #f6c202 0, #f5dd61 100%);background:-webkit-gradient(linear, left top, left bottom, color-stop(0, #f6c202), color-stop(100%, #f5dd61));background:linear-gradient(top, #f6c202 0, #f5dd61 100%);filter:progid:dximagetransform.microsoft.gradient(startColorstr='#F6C202', endColorstr='#F5DD61', GradientType=0);} diff --git a/css/hopscotch.less b/css/hopscotch.less index e3028d3d..08df0f4b 100644 --- a/css/hopscotch.less +++ b/css/hopscotch.less @@ -179,6 +179,7 @@ div#hopscotch-bubble { } #hopscotch-actions { + margin: 10px 0 0; text-align: right; } diff --git a/js/hopscotch-min.js b/js/hopscotch-min.js index 632f1597..738c3715 100644 --- a/js/hopscotch-min.js +++ b/js/hopscotch-min.js @@ -1 +1 @@ -(function(c,d){var n,f,k,j,h,a,m=c[d],i="undefined",b=false,l=(typeof window.sessionStorage!==i),g=document.body.style,e=(typeof g.MozTransition!==i||typeof g.MsTransition!==i||typeof g.webkitTransition!==i||typeof g.OTransition!==i||typeof g.transition!==i);if(m){return}a=function(){docLoaded=true;if(b){m.startTour()}};if(window.addEventListener){window.addEventListener("load",a)}else{if(window.attachEvent){window.attachEvent("onload",a)}}j={addClass:function(q,s){var p,r,o;if(q.className.length===0){q.className=s}else{p=q.className.split(" ");for(r=0,o=p.length;r=0){j.addClass(u,"prev")}else{j.addClass(u,"next")}return u},q=function(v,u,x){var w="hide";if(x){w="hide-all"}if(typeof u===i){u=true}if(u){j.removeClass(v,w)}else{j.addClass(v,w)}},r=function(B,x,I){var E,u,C,w,z,A,D,y,H=j.getStepTarget(x),v=B.element,G=B.arrowEl,F=j.getPixelValue(x.arrowOffset);I=j.valOrDefault(I,true);E=j.getPixelValue(x.width)||t.bubbleWidth;C=j.valOrDefault(x.padding,t.bubblePadding);bubbleBorder=j.valOrDefault(x.padding,t.bubbleBorder);j.removeClass(v,"bounce-down bounce-up bounce-left bounce-right");w=H.getBoundingClientRect();if(x.orientation==="top"){u=v.offsetHeight;D=(w.top-u)-t.arrowWidth;y=w.left;A="bounce-down"}else{if(x.orientation==="bottom"){D=w.bottom+t.arrowWidth;y=w.left;A="bounce-up"}else{if(x.orientation==="left"){D=w.top;y=w.left-E-2*C-2*bubbleBorder-t.arrowWidth;A="bounce-right"}else{if(x.orientation==="right"){D=w.top;y=w.right+t.arrowWidth;A="bounce-left"}}}}if(!F){G.style.top="";G.style.left=""}else{if(x.orientation==="top"||x.orientation==="bottom"){G.style.left=F+"px"}else{if(x.orientation==="left"||x.orientation==="right"){G.style.top=F+"px"}}}y+=j.getPixelValue(x.xOffset);D+=j.getPixelValue(x.yOffset);D+=j.getScrollTop();y+=j.getScrollLeft();if(t.animate){v.style.top=D+"px";v.style.left=y+"px"}else{v.style.top=D+"px";v.style.left=y+"px";if(I){z=t.smoothScroll?t.scrollDuration:0;setTimeout(function(){j.addClass(v,A)},z);setTimeout(function(){j.removeClass(v,A)},z+2000)}}};this.init=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";j.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();if(t&&t.showCloseButton){this.initCloseButton()}this.initArrow();v=function(){if(A||!p){return}A=true;u=setTimeout(function(){r(w,o,false);A=false},200)};if(window.addEventListener){window.addEventListener("resize",v)}else{if(window.attachEvent){window.attachEvent("onresize",v)}}this.hide();document.body.appendChild(y);return this};this.initNavButtons=function(){var u=document.createElement("div");this.prevBtnEl=s("hopscotch-prev",k.prevBtn);this.nextBtnEl=s("hopscotch-next",k.nextBtn);this.doneBtnEl=s("hopscotch-done",k.doneBtn);j.addClass(this.doneBtnEl,"hide");u.appendChild(this.prevBtnEl);u.appendChild(this.nextBtnEl);u.appendChild(this.doneBtnEl);j.addClickListener(this.prevBtnEl,function(v){m.prevStep()});j.addClickListener(this.nextBtnEl,function(v){m.nextStep()});j.addClickListener(this.doneBtnEl,m.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=k.closeTooltip;u.innerHTML=k.closeTooltip;j.addClickListener(u,function(w){var v=hopscotch.getCurrStepNum(),x=hopscotch.getCurrTour(),y=(v===x.steps.length-1);j.invokeCallbacks("close",[x.id,v]);m.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=j.valOrDefault(w.showNextButton,t.showNextButton),u=j.valOrDefault(w.showPrevButton,t.showPrevButton),A,z;o=w;this.setTitle(w.title?w.title:"");this.setContent(w.content?w.content:"");this.setNum(B);this.showPrevButton(this.prevBtnEl&&u&&(B>0||x>0));this.showNextButton(this.nextBtnEl&&v&&!y);this.nextBtnEl.value=w.showSkip?k.skipBtn:k.nextBtn;if(w.showSkip){}if(y){j.removeClass(this.doneBtnEl,"hide")}else{j.addClass(this.doneBtnEl,"hide")}this.setArrow(w.orientation);A=j.getPixelValue(w.width)||t.bubbleWidth;z=j.valOrDefault(w.padding,t.bubblePadding);this.containerEl.style.width=A+"px";this.containerEl.style.padding=z+"px";if(w.orientation==="top"){setTimeout(function(){r(D,w);if(C){C()}},5)}else{r(this,w);if(C){C()}}return this};this.setTitle=function(u){if(u){this.titleEl.innerHTML=u;j.removeClass(this.titleEl,"hide")}else{j.addClass(this.titleEl,"hide")}return this};this.setContent=function(u){if(u){this.contentEl.innerHTML=u;j.removeClass(this.contentEl,"hide")}else{j.addClass(this.contentEl,"hide")}return this};this.setNum=function(u){if(k.stepNums&&u0)?E[A]:E},B=function(){var E=v.steps[q].length;if(A0){--A;return true}else{if(q>0){E=v.steps[--q].length;if(E){A=E-1}else{A=undefined}return true}}return false},o=function(){return v.steps[q].length>0},x=function(){var U=t().element,Q=j.getPixelValue(U.style.top),P=Q+j.getPixelValue(U.offsetHeight),N=j.getStepTarget(C()),V=N.getBoundingClientRect(),S=V.top+j.getScrollTop(),O=V.bottom+j.getScrollTop(),L=(QO)?P:O,R=j.getScrollTop(),G=R+j.getWindowHeight(),H=L-r.scrollTopMargin,F,K,J,T,I,M;if(typeof YAHOO!==i&&typeof YAHOO.env!==i&&typeof YAHOO.env.ua!==i&&typeof YAHOO.util!==i&&typeof YAHOO.util.Scroll!==i){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]}},r.scrollDuration/1000,J);K.animate();return}if(H<0){H=0}if(L>=R&&L<=R+r.scrollTopMargin){return}if(LG){if(r.smoothScroll){T=(R>L)?-1:1;I=Math.abs(R-H)/(r.scrollDuration/10);M=setInterval(function(){var X=j.getScrollTop(),W=X+(T*I);if((T>0&&W>=H)||T<0&&W<=H){W=H;clearInterval(M)}window.scrollTo(0,W);if(j.getScrollTop()===X){clearInterval(M)}},10)}else{window.scrollTo(0,H)}}};this.init=function(){if(p){this.configure(p)}return this};this.loadTour=function(J){var H={},F,K,G,E,I;v=J;for(K in J){if(J.hasOwnProperty(K)&&K!=="id"&&K!=="steps"){H[K]=J[K]}}r={};s.call(this,H,true);E=j.getState(r.cookieName);if(E){I=E.split(":");D=I[0];u=I[1];w=undefined;G=u.split("-");if(G.length>1){u=parseInt(G[0],10);w=parseInt(G[1],10)}else{u=parseInt(u,10)}if(I.length>2&&I[2]==="mp"){if(w&&w0){w=0}else{w=undefined}}}}}F=t();F.showPrevButton(r.showPrevButton,true);F.showNextButton(r.showNextButton,true);return this};this.startTour=function(H,G){var E,F;if(!v){throw"Need to load a tour before you start it!"}if(document.readyState!=="complete"){b=true;return}if(typeof H!==i){q=H;A=G}else{if(v.id===D&&typeof u!==i){q=u;A=w;F=C();if(!j.getStepTarget(F)){y();F=C();if(!j.getStepTarget(F)){this.endTour(false);return}}}else{q=0}}if(!A&&o()){A=0}if(q===0&&!A){j.invokeCallbacks("start",[v.id])}this.showStep(q,A);E=t().show();if(r.animate){E.initAnimate()}this.isActive=true;return this};this.showStep=function(I,G){var L=v.steps,J=L[I],H=L.length,F=v.id+":"+I,E=t(),K;q=I;A=G;if(typeof G!==i&&o()){J=J[G];F+="-"+G}K=(I===H-1)||(G>=J.length-1);E.renderStep(J,I,G,K,x);if(J.multiPage){F+=":mp"}j.setState(r.cookieName,F,1);return this};this.prevStep=function(){var F=C(),E=false;j.invokeCallbacks("prev",[v.id,q]);if(F.onPrev){F.onPrev()}if(r.skipIfNoElement){while(!E&&y()){F=C();E=j.getStepTarget(F)}if(!E){this.endTour()}}else{if(y()){F=C();if(!j.getStepTarget(F)){j.invokeCallbacks("error",[v.id,q]);return}}}this.showStep(q,A);return this};this.nextStep=function(){var F=C(),E=false;j.invokeCallbacks("next",[v.id,q]);if(F.onNext){F.onNext()}if(r.skipIfNoElement){while(!E&&B()){F=C();E=j.getStepTarget(F)}if(!E){this.endTour()}}else{if(B()){F=C();if(!j.getStepTarget(F)){j.invokeCallbacks("error",[v.id,q]);this.endTour();return}}}this.showStep(q,A);return this};this.endTour=function(G,F){var E=t();G=j.valOrDefault(G,true);F=j.valOrDefault(F,true);q=0;A=undefined;u=undefined;E.hide();if(G){j.clearState(r.cookieName)}this.isActive=false;if(F){j.invokeCallbacks("end",[v.id])}hopscotch.removeCallbacks(true);return this};this.getCurrTour=function(){return v};this.getCurrStepNum=function(){return q};this.getCurrSubstepNum=function(){return A};this.addCallback=function(G,E,F){if(E){h[G].push({cb:E,fromTour:F})}return this};this.removeCallbacks=function(F){var I,G,E,H;for(H in h){if(F){I=h[H];for(G=0,E=I.length;G=0){j.addClass(u,"prev")}else{j.addClass(u,"next")}return u},q=function(v,u,x){var w="hide";if(x){w="hide-all"}if(typeof u===i){u=true}if(u){j.removeClass(v,w)}else{j.addClass(v,w)}},r=function(B,x,I){var E,u,C,w,z,A,D,y,H=j.getStepTarget(x),v=B.element,G=B.arrowEl,F=j.getPixelValue(x.arrowOffset);I=j.valOrDefault(I,true);E=j.getPixelValue(x.width)||t.bubbleWidth;C=j.valOrDefault(x.padding,t.bubblePadding);bubbleBorder=j.valOrDefault(x.padding,t.bubbleBorder);j.removeClass(v,"bounce-down bounce-up bounce-left bounce-right");w=H.getBoundingClientRect();if(x.orientation==="top"){u=v.offsetHeight;D=(w.top-u)-t.arrowWidth;y=w.left;A="bounce-down"}else{if(x.orientation==="bottom"){D=w.bottom+t.arrowWidth;y=w.left;A="bounce-up"}else{if(x.orientation==="left"){D=w.top;y=w.left-E-2*C-2*bubbleBorder-t.arrowWidth;A="bounce-right"}else{if(x.orientation==="right"){D=w.top;y=w.right+t.arrowWidth;A="bounce-left"}}}}if(!F){G.style.top="";G.style.left=""}else{if(x.orientation==="top"||x.orientation==="bottom"){G.style.left=F+"px"}else{if(x.orientation==="left"||x.orientation==="right"){G.style.top=F+"px"}}}y+=j.getPixelValue(x.xOffset);D+=j.getPixelValue(x.yOffset);D+=j.getScrollTop();y+=j.getScrollLeft();if(t.animate){v.style.top=D+"px";v.style.left=y+"px"}else{v.style.top=D+"px";v.style.left=y+"px";if(I){z=t.smoothScroll?t.scrollDuration:0;setTimeout(function(){j.addClass(v,A)},z);setTimeout(function(){j.removeClass(v,A)},z+2000)}}};this.init=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";j.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||!p){return}A=true;u=setTimeout(function(){r(w,o,false);A=false},200)};if(window.addEventListener){window.addEventListener("resize",v)}else{if(window.attachEvent){window.attachEvent("onresize",v)}}this.hide();document.body.appendChild(y);return this};this.initNavButtons=function(){var u=document.createElement("div");this.prevBtnEl=s("hopscotch-prev",k.prevBtn);this.nextBtnEl=s("hopscotch-next",k.nextBtn);this.doneBtnEl=s("hopscotch-done",k.doneBtn);j.addClass(this.doneBtnEl,"hide");u.appendChild(this.prevBtnEl);u.appendChild(this.nextBtnEl);u.appendChild(this.doneBtnEl);j.addClickListener(this.prevBtnEl,function(v){m.prevStep()});j.addClickListener(this.nextBtnEl,function(v){m.nextStep()});j.addClickListener(this.doneBtnEl,m.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=k.closeTooltip;u.innerHTML=k.closeTooltip;j.addClickListener(u,function(w){var v=hopscotch.getCurrStepNum(),x=hopscotch.getCurrTour(),y=(v===x.steps.length-1);j.invokeCallbacks("close",[x.id,v]);m.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=j.valOrDefault(w.showNextButton,t.showNextButton),u=j.valOrDefault(w.showPrevButton,t.showPrevButton),A,z;o=w;this.setTitle(w.title?w.title:"");this.setContent(w.content?w.content:"");this.setNum(B);this.showPrevButton(this.prevBtnEl&&u&&(B>0||x>0));this.showNextButton(this.nextBtnEl&&v&&!y);this.nextBtnEl.value=w.showSkip?k.skipBtn:k.nextBtn;if(w.showSkip){}if(y){j.removeClass(this.doneBtnEl,"hide")}else{j.addClass(this.doneBtnEl,"hide")}this.setArrow(w.orientation);A=j.getPixelValue(w.width)||t.bubbleWidth;z=j.valOrDefault(w.padding,t.bubblePadding);this.containerEl.style.width=A+"px";this.containerEl.style.padding=z+"px";if(w.orientation==="top"){setTimeout(function(){r(D,w);if(C){C()}},5)}else{r(this,w);if(C){C()}}return this};this.setTitle=function(u){if(u){this.titleEl.innerHTML=u;j.removeClass(this.titleEl,"hide")}else{j.addClass(this.titleEl,"hide")}return this};this.setContent=function(u){if(u){this.contentEl.innerHTML=u;j.removeClass(this.contentEl,"hide")}else{j.addClass(this.contentEl,"hide")}return this};this.setNum=function(u){if(k.stepNums&&u0)?E[A]:E},B=function(){var E=v.steps[q].length;if(A0){--A;return true}else{if(q>0){E=v.steps[--q].length;if(E){A=E-1}else{A=undefined}return true}}return false},o=function(){return v.steps[q].length>0},x=function(){var U=t().element,Q=j.getPixelValue(U.style.top),P=Q+j.getPixelValue(U.offsetHeight),N=j.getStepTarget(C()),V=N.getBoundingClientRect(),S=V.top+j.getScrollTop(),O=V.bottom+j.getScrollTop(),L=(QO)?P:O,R=j.getScrollTop(),G=R+j.getWindowHeight(),H=L-r.scrollTopMargin,F,K,J,T,I,M;if(typeof YAHOO!==i&&typeof YAHOO.env!==i&&typeof YAHOO.env.ua!==i&&typeof YAHOO.util!==i&&typeof YAHOO.util.Scroll!==i){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]}},r.scrollDuration/1000,J);K.animate();return}if(H<0){H=0}if(L>=R&&L<=R+r.scrollTopMargin){return}if(LG){if(r.smoothScroll){T=(R>L)?-1:1;I=Math.abs(R-H)/(r.scrollDuration/10);M=setInterval(function(){var X=j.getScrollTop(),W=X+(T*I);if((T>0&&W>=H)||T<0&&W<=H){W=H;clearInterval(M)}window.scrollTo(0,W);if(j.getScrollTop()===X){clearInterval(M)}},10)}else{window.scrollTo(0,H)}}};this.init=function(){if(p){this.configure(p)}return this};this.loadTour=function(J){var H={},F,K,G,E,I;v=J;for(K in J){if(J.hasOwnProperty(K)&&K!=="id"&&K!=="steps"){H[K]=J[K]}}this.resetDefaultOptions();s.call(this,H,true);E=j.getState(r.cookieName);if(E){I=E.split(":");D=I[0];u=I[1];w=undefined;G=u.split("-");if(G.length>1){u=parseInt(G[0],10);w=parseInt(G[1],10)}else{u=parseInt(u,10)}if(I.length>2&&I[2]==="mp"){if(w&&w0){w=0}else{w=undefined}}}}}F=t();F.showPrevButton(r.showPrevButton,true);F.showNextButton(r.showNextButton,true);return this};this.startTour=function(H,G){var E,F;if(!v){throw"Need to load a tour before you start it!"}if(document.readyState!=="complete"){b=true;return}if(typeof H!==i){q=H;A=G}else{if(v.id===D&&typeof u!==i){q=u;A=w;F=C();if(!j.getStepTarget(F)){y();F=C();if(!j.getStepTarget(F)){this.endTour(false);return}}}else{q=0}}if(!A&&o()){A=0}if(q===0&&!A){j.invokeCallbacks("start",[v.id])}this.showStep(q,A);E=t().show();if(r.animate){E.initAnimate()}this.isActive=true;return this};this.showStep=function(I,G){var L=v.steps,J=L[I],H=L.length,F=v.id+":"+I,E=t(),K;q=I;A=G;if(typeof G!==i&&o()){J=J[G];F+="-"+G}K=(I===H-1)||(G>=J.length-1);E.renderStep(J,I,G,K,x);if(J.multipage){F+=":mp"}j.setState(r.cookieName,F,1);return this};this.prevStep=function(){var F=C(),E=false;j.invokeCallbacks("prev",[v.id,q]);if(F.onPrev){F.onPrev()}if(r.skipIfNoElement){while(!E&&y()){F=C();E=j.getStepTarget(F)}if(!E){this.endTour()}}else{if(y()){F=C();if(!j.getStepTarget(F)){j.invokeCallbacks("error",[v.id,q]);return}}}this.showStep(q,A);return this};this.nextStep=function(){var F=C(),E=false;j.invokeCallbacks("next",[v.id,q]);if(F.onNext){F.onNext()}if(r.skipIfNoElement){while(!E&&B()){F=C();E=j.getStepTarget(F)}if(!E){this.endTour()}}else{if(B()){F=C();if(!j.getStepTarget(F)){j.invokeCallbacks("error",[v.id,q]);this.endTour();return}}}this.showStep(q,A);return this};this.endTour=function(G,F){var E=t();G=j.valOrDefault(G,true);F=j.valOrDefault(F,true);q=0;A=undefined;u=undefined;E.hide();if(G){j.clearState(r.cookieName)}m.isActive=false;if(F){j.invokeCallbacks("end",[v.id])}hopscotch.removeCallbacks(true);return this};this.getCurrTour=function(){return v};this.getCurrStepNum=function(){return q};this.getCurrSubstepNum=function(){return A};this.addCallback=function(G,E,F){if(E){h[G].push({cb:E,fromTour:F})}return this};this.removeCallbacks=function(F){var I,G,E,H;for(H in h){if(F){I=h[H];for(G=0,E=I.length;G");t.attr({id:v,type:"button",value:u});t.addClass("hopscotch-nav-button");if(v.indexOf("prev")>=0){t.addClass("prev")}else{t.addClass("next")}return t},p=function(u,t,w){var v=w?"hide-all":"hide";if(typeof t===h){t=true}if(t){u.removeClass(v)}else{u.addClass(v)}},q=function(A,v,H){var D,t,B,u,y,z,C,w,F=i.getStepTarget(v)[0],G=A.$element,x=A.$arrowEl,E=i.getPixelValue(v.arrowOffset);H=i.valOrDefault(H,true);D=i.getPixelValue(v.width)||s.bubbleWidth;B=i.valOrDefault(v.padding,s.bubblePadding);bubbleBorder=i.valOrDefault(v.padding,s.bubbleBorder);G.removeClass("bounce-down bounce-up bounce-left bounce-right");u=F.getBoundingClientRect();if(v.orientation==="top"){t=G.height();C=(u.top-t)-s.arrowWidth;w=u.left;z="bounce-down"}else{if(v.orientation==="bottom"){C=u.bottom+s.arrowWidth;w=u.left;z="bounce-up"}else{if(v.orientation==="left"){C=u.top;w=u.left-D-2*B-2*bubbleBorder-s.arrowWidth;z="bounce-right"}else{if(v.orientation==="right"){C=u.top;w=u.right+s.arrowWidth;z="bounce-left"}}}}if(!E){x.css({top:"",left:""})}else{if(v.orientation==="top"||v.orientation==="bottom"){x.css("left",E+"px")}else{if(v.orientation==="left"||v.orientation==="right"){x.css("top",E+"px")}}}w+=i.getPixelValue(v.xOffset);C+=i.getPixelValue(v.yOffset);C+=i.getScrollTop();w+=i.getScrollLeft();if(s.animate){if(!d&&s.animate){G.animate({top:C+"px",left:w+"px"})}else{G.css("top",C+"px");G.css("left",w+"px")}}else{G.css("top",C+"px");G.css("left",w+"px");if(H){y=s.smoothScroll?s.scrollDuration:0;setTimeout(function(){G.addClass(z)},y);setTimeout(function(){G.removeClass(z)},y+2000)}}};this.init=function(){var w=$("
"),u=$("
"),x=$("
"),v=this,y=false,t;this.$element=w;this.$containerEl=u;this.$titleEl=$("

");this.$numberEl=$("");this.$contentEl=$("

");this.$numberEl.attr("id","hopscotch-bubble-number");x.append(this.$titleEl,this.$contentEl).attr("id","hopscotch-bubble-content");u.attr("id","hopscotch-bubble-container").append(this.$numberEl,x);w.attr("id","hopscotch-bubble").addClass("animated").append(u);this.initNavButtons();if(s&&s.showCloseButton){this.initCloseButton()}this.initArrow();$(window).on("resize",function(){if(y||!o){return}y=true;t=setTimeout(function(){q(v,n,false);y=false},200)});this.hide();$("body").append(w);return this};this.initNavButtons=function(){var t=$("

");this.$prevBtnEl=r("hopscotch-prev",j.prevBtn);this.$nextBtnEl=r("hopscotch-next",j.nextBtn);this.$doneBtnEl=r("hopscotch-done",j.doneBtn);this.$doneBtnEl.addClass("hide");this.$prevBtnEl.click(function(u){l.prevStep()});this.$nextBtnEl.click(function(u){l.nextStep()});this.$doneBtnEl.click(l.endTour);t.attr("id","hopscotch-actions").append(this.$prevBtnEl,this.$nextBtnEl,this.$doneBtnEl);this.buttonsEl=t;this.$containerEl.append(t);return this};this.initCloseButton=function(){var t=$("");t.text(j.closeTooltip).attr({id:"hopscotch-bubble-close",href:"#",title:j.closeTooltip}).click(function(v){var u=hopscotch.getCurrStepNum(),w=hopscotch.getCurrTour(),x=(u===w.steps.length-1);i.invokeCallbacks("close",[w.id,u]);l.endTour(true,x);if(v.preventDefault){v.preventDefault()}else{if(event){event.returnValue=false}}});this.closeBtnEl=t;this.$containerEl.append(t);return this};this.initArrow=function(){var u,t;this.$arrowEl=$("
").attr("id","hopscotch-bubble-arrow-container");t=$("
").addClass("hopscotch-bubble-arrow-border");u=$("
").addClass("hopscotch-bubble-arrow");this.$arrowEl.append(t,u);this.$element.append(this.$arrowEl);return this};this.renderStep=function(v,A,w,x,B){var C=this,u=i.valOrDefault(v.showNextButton,s.showNextButton),t=i.valOrDefault(v.showPrevButton,s.showPrevButton),z,y;n=v;this.setTitle(v.title?v.title:"");this.setContent(v.content?v.content:"");this.setNum(A);this.showPrevButton(this.$prevBtnEl&&t&&(A>0||w>0));this.showNextButton(this.$nextBtnEl&&u&&!x);if(x){this.$doneBtnEl.removeClass("hide")}else{this.$doneBtnEl.addClass("hide")}this.setArrow(v.orientation);z=i.getPixelValue(v.width)||s.bubbleWidth;y=i.valOrDefault(v.padding,s.bubblePadding);this.$containerEl.css({width:z+"px",padding:y+"px"});if(v.orientation==="top"){setTimeout(function(){q(C,v);if(B){B()}},5)}else{q(this,v);if(B){B()}}return this};this.setTitle=function(t){if(t){this.$titleEl.html(t).removeClass("hide")}else{this.$titleEl.addClass("hide")}return this};this.setContent=function(t){if(t){this.$contentEl.html(t).removeClass("hide")}else{this.$contentEl.addClass("hide")}return this};this.setNum=function(t){if(j.stepNums&&t0)?D[z]:D},A=function(){var D=u.steps[p].length;if(z0){--z;return true}else{if(p>0){D=u.steps[--p].length;if(D){z=D-1}else{z=undefined}return true}}return false},n=function(){return u.steps[p].length>0},w=function(){var H=s().$element,D=i.getPixelValue(H.css("top")),I=i.getStepTarget(B())[0],G=I.getBoundingClientRect(),J=G.top+i.getScrollTop(),F=(D1){t=parseInt(E[0],10);v=parseInt(E[1],10)}else{t=parseInt(t,10)}if(tourPair.length>2&&tourPair[2]==="mp"){if(v&&v0){v=0}else{v=undefined}}}}}D=s();D.showPrevButton(q.showPrevButton,true);D.showNextButton(q.showNextButton,true);return this};this.startTour=function(I,H){var E,G,F,D;if(!u){throw"Need to load a tour before you start it!"}if(document.readyState!=="complete"){a=true;return}if(typeof I!==h){p=I;z=H}else{if(u.id===C&&typeof t!==h){p=t;z=v;G=B();if(!i.getStepTarget(G)){x();G=B();if(!i.getStepTarget(G)){this.endTour(false);return}}}else{p=0}}if(!z&&n()){z=0}if(p===0&&!z){i.invokeCallbacks("start",[u.id])}this.showStep(p,z);E=s().show();if(q.animate){E.initAnimate()}this.isActive=true;return this};this.showStep=function(H,F){var K=u.steps,I=K[H],G=K.length,E=u.id+":"+H,D=s(),J;p=H;z=F;if(typeof F!==h&&n()){I=I[F];E+="-"+F}J=(H===G-1)||(F>=I.length-1);D.renderStep(I,H,F,J,w);if(I.multiPage){E+=":mp"}i.setState(q.cookieName,E,1);return this};this.prevStep=function(){var E=B(),D=false;i.invokeCallbacks("prev",[u.id,p]);if(E.onPrev){E.onPrev()}if(q.skipIfNoElement){while(!D&&x()){E=B();D=i.getStepTarget(E)}if(!D){this.endTour()}}else{if(x()){E=B();if(!i.getStepTarget(E)){i.invokeCallbacks("error",[u.id,p]);return}}}this.showStep(p,z);return this};this.nextStep=function(){var E=B(),D=false;i.invokeCallbacks("next",[u.id,p]);if(E.onNext){E.onNext()}if(q.skipIfNoElement){while(!D&&A()){E=B();D=i.getStepTarget(E)}if(!D){this.endTour()}}else{if(A()){E=B();if(!i.getStepTarget(E)){i.invokeCallbacks("error",[u.id,p]);this.endTour();return}}}this.showStep(p,z);return this};this.endTour=function(F,E){var D=s();F=i.valOrDefault(F,true);E=i.valOrDefault(E,true);p=0;z=undefined;t=undefined;D.hide();if(F){i.clearState(q.cookieName)}this.isActive=false;if(E){i.invokeCallbacks("end",[u.id])}hopscotch.removeCallbacks(true);return this};this.getCurrTour=function(){return u};this.getCurrStepNum=function(){return p};this.getCurrSubstepNum=function(){return z};this.hasTakenTour=function(D){if(k){i.getState(q.cookieName+"_history")}return false};this.setHasTakenTour=function(E){var D;if(k&&!this.hasTakenTour(E)){D=i.getState(q.cookieName+"_history");if(D){D+=";"+E}else{D=E}}};this.clearHasTakenTour=function(J){var I,H,E,D,F=q.cookieName+"_history",G=false;if(k){I=i.getState(F);if(I){H=I.split(";");for(E=0,D=H.length;E");t.attr({id:v,type:"button",value:u});t.addClass("hopscotch-nav-button");if(v.indexOf("prev")>=0){t.addClass("prev")}else{t.addClass("next")}return t},p=function(u,t,w){var v=w?"hide-all":"hide";if(typeof t===h){t=true}if(t){u.removeClass(v)}else{u.addClass(v)}},q=function(A,v,H){var D,t,B,u,y,z,C,w,F=i.getStepTarget(v)[0],G=A.$element,x=A.$arrowEl,E=i.getPixelValue(v.arrowOffset);H=i.valOrDefault(H,true);D=i.getPixelValue(v.width)||s.bubbleWidth;B=i.valOrDefault(v.padding,s.bubblePadding);bubbleBorder=i.valOrDefault(v.padding,s.bubbleBorder);G.removeClass("bounce-down bounce-up bounce-left bounce-right");u=F.getBoundingClientRect();if(v.orientation==="top"){t=G.height();C=(u.top-t)-s.arrowWidth;w=u.left;z="bounce-down"}else{if(v.orientation==="bottom"){C=u.bottom+s.arrowWidth;w=u.left;z="bounce-up"}else{if(v.orientation==="left"){C=u.top;w=u.left-D-2*B-2*bubbleBorder-s.arrowWidth;z="bounce-right"}else{if(v.orientation==="right"){C=u.top;w=u.right+s.arrowWidth;z="bounce-left"}}}}if(!E){x.css({top:"",left:""})}else{if(v.orientation==="top"||v.orientation==="bottom"){x.css("left",E+"px")}else{if(v.orientation==="left"||v.orientation==="right"){x.css("top",E+"px")}}}w+=i.getPixelValue(v.xOffset);C+=i.getPixelValue(v.yOffset);C+=i.getScrollTop();w+=i.getScrollLeft();if(s.animate){if(!d&&s.animate){G.animate({top:C+"px",left:w+"px"})}else{G.css("top",C+"px");G.css("left",w+"px")}}else{G.css("top",C+"px");G.css("left",w+"px");if(H){y=s.smoothScroll?s.scrollDuration:0;setTimeout(function(){G.addClass(z)},y);setTimeout(function(){G.removeClass(z)},y+2000)}}};this.init=function(){var w=$("
"),u=$("
"),x=$("
"),v=this,y=false,t;this.$element=w;this.$containerEl=u;this.$titleEl=$("

");this.$numberEl=$("");this.$contentEl=$("

");this.$numberEl.attr("id","hopscotch-bubble-number");x.append(this.$titleEl,this.$contentEl).attr("id","hopscotch-bubble-content");u.attr("id","hopscotch-bubble-container").append(this.$numberEl,x);w.attr("id","hopscotch-bubble").addClass("animated").append(u);this.initNavButtons();this.initCloseButton();this.initArrow();$(window).on("resize",function(){if(y||!o){return}y=true;t=setTimeout(function(){q(v,n,false);y=false},200)});this.hide();$("body").append(w);return this};this.initNavButtons=function(){var t=$("

");this.$prevBtnEl=r("hopscotch-prev",j.prevBtn);this.$nextBtnEl=r("hopscotch-next",j.nextBtn);this.$doneBtnEl=r("hopscotch-done",j.doneBtn);this.$doneBtnEl.addClass("hide");this.$prevBtnEl.click(function(u){l.prevStep()});this.$nextBtnEl.click(function(u){l.nextStep()});this.$doneBtnEl.click(l.endTour);t.attr("id","hopscotch-actions").append(this.$prevBtnEl,this.$nextBtnEl,this.$doneBtnEl);this.buttonsEl=t;this.$containerEl.append(t);return this};this.initCloseButton=function(){var t=$("");t.text(j.closeTooltip).attr({id:"hopscotch-bubble-close",href:"#",title:j.closeTooltip}).click(function(v){var u=hopscotch.getCurrStepNum(),w=hopscotch.getCurrTour(),x=(u===w.steps.length-1);i.invokeCallbacks("close",[w.id,u]);l.endTour(true,x);if(v.preventDefault){v.preventDefault()}else{if(event){event.returnValue=false}}});this.closeBtnEl=t;this.$containerEl.append(t);return this};this.initArrow=function(){var u,t;this.$arrowEl=$("
").attr("id","hopscotch-bubble-arrow-container");t=$("
").addClass("hopscotch-bubble-arrow-border");u=$("
").addClass("hopscotch-bubble-arrow");this.$arrowEl.append(t,u);this.$element.append(this.$arrowEl);return this};this.renderStep=function(v,A,w,x,B){var C=this,u=i.valOrDefault(v.showNextButton,s.showNextButton),t=i.valOrDefault(v.showPrevButton,s.showPrevButton),z,y;n=v;this.setTitle(v.title?v.title:"");this.setContent(v.content?v.content:"");this.setNum(A);this.showPrevButton(this.$prevBtnEl&&t&&(A>0||w>0));this.showNextButton(this.$nextBtnEl&&u&&!x);if(x){this.$doneBtnEl.removeClass("hide")}else{this.$doneBtnEl.addClass("hide")}this.setArrow(v.orientation);z=i.getPixelValue(v.width)||s.bubbleWidth;y=i.valOrDefault(v.padding,s.bubblePadding);this.$containerEl.css({width:z+"px",padding:y+"px"});if(v.orientation==="top"){setTimeout(function(){q(C,v);if(B){B()}},5)}else{q(this,v);if(B){B()}}return this};this.setTitle=function(t){if(t){this.$titleEl.html(t).removeClass("hide")}else{this.$titleEl.addClass("hide")}return this};this.setContent=function(t){if(t){this.$contentEl.html(t).removeClass("hide")}else{this.$contentEl.addClass("hide")}return this};this.setNum=function(t){if(j.stepNums&&t0)?D[z]:D},A=function(){var D=u.steps[p].length;if(z0){--z;return true}else{if(p>0){D=u.steps[--p].length;if(D){z=D-1}else{z=undefined}return true}}return false},n=function(){return u.steps[p].length>0},w=function(){var H=s().$element,D=i.getPixelValue(H.css("top")),I=i.getStepTarget(B())[0],G=I.getBoundingClientRect(),J=G.top+i.getScrollTop(),F=(D1){t=parseInt(E[0],10);v=parseInt(E[1],10)}else{t=parseInt(t,10)}if(tourPair.length>2&&tourPair[2]==="mp"){if(v&&v0){v=0}else{v=undefined}}}}}D=s();D.showPrevButton(q.showPrevButton,true);D.showNextButton(q.showNextButton,true);return this};this.startTour=function(I,H){var E,G,F,D;if(!u){throw"Need to load a tour before you start it!"}if(document.readyState!=="complete"){a=true;return}if(typeof I!==h){p=I;z=H}else{if(u.id===C&&typeof t!==h){p=t;z=v;G=B();if(!i.getStepTarget(G)){x();G=B();if(!i.getStepTarget(G)){this.endTour(false);return}}}else{p=0}}if(!z&&n()){z=0}if(p===0&&!z){i.invokeCallbacks("start",[u.id])}this.showStep(p,z);E=s().show();if(q.animate){E.initAnimate()}this.isActive=true;return this};this.showStep=function(H,F){var K=u.steps,I=K[H],G=K.length,E=u.id+":"+H,D=s(),J;p=H;z=F;if(typeof F!==h&&n()){I=I[F];E+="-"+F}J=(H===G-1)||(F>=I.length-1);D.renderStep(I,H,F,J,w);if(I.multipage){E+=":mp"}i.setState(q.cookieName,E,1);return this};this.prevStep=function(){var E=B(),D=false;i.invokeCallbacks("prev",[u.id,p]);if(E.onPrev){E.onPrev()}if(q.skipIfNoElement){while(!D&&x()){E=B();D=i.getStepTarget(E)}if(!D){this.endTour()}}else{if(x()){E=B();if(!i.getStepTarget(E)){i.invokeCallbacks("error",[u.id,p]);return}}}this.showStep(p,z);return this};this.nextStep=function(){var E=B(),D=false;i.invokeCallbacks("next",[u.id,p]);if(E.onNext){E.onNext()}if(q.skipIfNoElement){while(!D&&A()){E=B();D=i.getStepTarget(E)}if(!D){this.endTour()}}else{if(A()){E=B();if(!i.getStepTarget(E)){i.invokeCallbacks("error",[u.id,p]);this.endTour();return}}}this.showStep(p,z);return this};this.endTour=function(F,E){var D=s();F=i.valOrDefault(F,true);E=i.valOrDefault(E,true);p=0;z=undefined;t=undefined;D.hide();if(F){i.clearState(q.cookieName)}l.isActive=false;if(E){i.invokeCallbacks("end",[u.id])}hopscotch.removeCallbacks(true);return this};this.getCurrTour=function(){return u};this.getCurrStepNum=function(){return p};this.getCurrSubstepNum=function(){return z};this.hasTakenTour=function(D){if(k){i.getState(q.cookieName+"_history")}return false};this.setHasTakenTour=function(E){var D;if(k&&!this.hasTakenTour(E)){D=i.getState(q.cookieName+"_history");if(D){D+=";"+E}else{D=E}}};this.clearHasTakenTour=function(J){var I,H,E,D,F=q.cookieName+"_history",G=false;if(k){I=i.getState(F);if(I){H=I.split(";");for(E=0,D=H.length;E