From 0e7d199d8195e7ee65223a99f3bbcea26539e9b5 Mon Sep 17 00:00:00 2001 From: Gordon Koo Date: Tue, 11 Sep 2012 14:26:35 -0700 Subject: [PATCH] minifying from previous commit --- js/hopscotch-min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/hopscotch-min.js b/js/hopscotch-min.js index 079a71c9..0eaf86f9 100644 --- a/js/hopscotch-min.js +++ b/js/hopscotch-min.js @@ -1 +1 @@ -(function(c,e){var o,g,l,k,i,a,n=c[e],j="undefined",b=false,d=(typeof window.jQuery!==j),m=(typeof window.sessionStorage!==j),h=document.body.style,f=(typeof h.MozTransition!==j||typeof h.MsTransition!==j||typeof h.webkitTransition!==j||typeof h.OTransition!==j||typeof h.transition!==j);if(n){return}a=function(){if(b){n.startTour()}};if(window.addEventListener){window.addEventListener("load",a)}else{if(window.attachEvent){window.attachEvent("onload",a)}}k={addClass:function(r,t){var q,s,p;if(r.className.length===0){r.className=t}else{q=r.className.split(" ");for(s=0,p=q.length;s=0){k.addClass(w,"prev")}else{k.addClass(w,"next")}return w},r=function(x,w,z){var y="hide";if(z){y="hide-all"}if(typeof w===j){w=true}if(w){k.removeClass(x,y)}else{k.addClass(x,y)}},s=function(C,z){var F,w,D,y,E,A,B=6,I=k.getStepTarget(z),x=C.element,H=C.arrowEl,G=k.getPixelValue(z.arrowOffset);F=k.getPixelValue(z.width)||u.bubbleWidth;D=k.valOrDefault(z.padding,u.bubblePadding);k.removeClass(x,"fade-in-down fade-in-up fade-in-left fade-in-right");y=I.getBoundingClientRect();if(z.orientation==="top"){w=x.offsetHeight;E=(y.top-w)-u.arrowWidth;A=y.left}else{if(z.orientation==="bottom"){E=y.bottom+u.arrowWidth;A=y.left}else{if(z.orientation==="left"){E=y.top;A=y.left-F-2*D-2*B-u.arrowWidth}else{if(z.orientation==="right"){E=y.top;A=y.right+u.arrowWidth}}}}if(!G){H.style.top="";H.style.left=""}else{if(z.orientation==="top"||z.orientation==="bottom"){H.style.top="";H.style.left=G+"px"}else{if(z.orientation==="left"||z.orientation==="right"){H.style.left="";H.style.top=G+"px"}}}A+=k.getPixelValue(z.xOffset);E+=k.getPixelValue(z.yOffset);if(!z.fixedElement){E+=k.getScrollTop();A+=k.getScrollLeft()}x.style.position=(z.fixedElement?"fixed":"absolute");if(u.animate&&d&&!f){$(x).animate({top:E+"px",left:A+"px"})}else{x.style.top=E+"px";x.style.left=A+"px"}},v=function(){var A=document.createElement("div"),B=document.createElement("div"),z=document.createElement("div"),y=this,C=false,x,w;this.element=A;this.containerEl=B;this.titleEl=document.createElement("h3");this.numberEl=document.createElement("span");this.contentEl=document.createElement("p");A.id="hopscotch-bubble";k.addClass(A,"animated");B.id="hopscotch-bubble-container";this.numberEl.id="hopscotch-bubble-number";B.appendChild(this.numberEl);z.appendChild(this.titleEl);z.appendChild(this.contentEl);z.id="hopscotch-bubble-content";B.appendChild(z);A.appendChild(B);this.initNavButtons();this.initCloseButton();this.initArrow();x=function(){if(C||!q){return}C=true;w=setTimeout(function(){s(y,p,false);C=false},200)};if(window.addEventListener){window.addEventListener("resize",x)}else{if(window.attachEvent){window.attachEvent("onresize",x)}}this.hide();document.body.appendChild(A);return this};this.initNavButtons=function(){var w=document.createElement("div");this.prevBtnEl=t("hopscotch-prev",l.prevBtn);this.nextBtnEl=t("hopscotch-next",l.nextBtn);this.doneBtnEl=t("hopscotch-done",l.doneBtn);k.addClass(this.doneBtnEl,"hide");w.appendChild(this.prevBtnEl);w.appendChild(this.nextBtnEl);w.appendChild(this.doneBtnEl);k.addClickListener(this.prevBtnEl,function(x){n.prevStep(true)});k.addClickListener(this.nextBtnEl,function(x){n.nextStep(true)});k.addClickListener(this.doneBtnEl,n.endTour);w.id="hopscotch-actions";this.buttonsEl=w;this.containerEl.appendChild(w);return this};this.initCloseButton=function(){var w=document.createElement("a");w.id="hopscotch-bubble-close";w.href="#";w.title=l.closeTooltip;w.innerHTML=l.closeTooltip;k.addClickListener(w,function(y){var x=n.getCurrStepNum(),z=n.getCurrTour(),A=(x===z.steps.length-1);k.invokeCallbacks("close",[z.id,x]);n.endTour(true,A);if(y.preventDefault){y.preventDefault()}else{if(event){event.returnValue=false}}});this.closeBtnEl=w;this.containerEl.appendChild(w);return this};this.initArrow=function(){var w,x;this.arrowEl=document.createElement("div");this.arrowEl.id="hopscotch-bubble-arrow-container";x=document.createElement("div");x.className="hopscotch-bubble-arrow-border";w=document.createElement("div");w.className="hopscotch-bubble-arrow";this.arrowEl.appendChild(x);this.arrowEl.appendChild(w);this.element.appendChild(this.arrowEl);return this};this.renderStep=function(y,D,z,A,E){var F=this,x=k.valOrDefault(y.showNextButton,u.showNextButton),w=k.valOrDefault(y.showPrevButton,u.showPrevButton),C,B;p=y;this.setTitle(y.title?y.title:"");this.setContent(y.content?y.content:"");this.setNum(D);this.orientation=y.orientation;this.showPrevButton(this.prevBtnEl&&w&&(D>0||z>0));this.showNextButton(this.nextBtnEl&&x&&!A);this.nextBtnEl.value=y.showSkip?l.skipBtn:l.nextBtn;if(A){k.removeClass(this.doneBtnEl,"hide")}else{k.addClass(this.doneBtnEl,"hide")}this.setArrow(y.orientation);C=k.getPixelValue(y.width)||u.bubbleWidth;B=k.valOrDefault(y.padding,u.bubblePadding);this.containerEl.style.width=C+"px";this.containerEl.style.padding=B+"px";this.element.style.zIndex=(y.zindex?y.zindex:"");if(y.orientation==="top"){setTimeout(function(){s(F,y);if(E){if(!y.fixedElement){E()}else{F.show()}}},5)}else{s(this,y);if(E){if(!y.fixedElement){E()}else{F.show()}}}return this};this.setTitle=function(w){if(w){this.titleEl.innerHTML=w;k.removeClass(this.titleEl,"hide")}else{k.addClass(this.titleEl,"hide")}return this};this.setContent=function(w){if(w){this.contentEl.innerHTML=w;k.removeClass(this.contentEl,"hide")}else{k.addClass(this.contentEl,"hide")}return this};this.setNum=function(w){if(l.stepNums&&w=y.steps.length){return null}else{H=y.steps[t]}return(H.length>0)?H[G]:H},A=function(){return y.steps[t].length>0},s=function(S){var Q=w(),aa=Q.element,W=k.getPixelValue(aa.style.top),V=W+k.getPixelValue(aa.offsetHeight),T=k.getStepTarget(B()),ab=T.getBoundingClientRect(),Y=ab.top+k.getScrollTop(),U=ab.bottom+k.getScrollTop(),O=(WU)?V:U,X=k.getScrollTop(),J=X+k.getWindowHeight(),K=O-q.scrollTopMargin,R=this,I,N,M,Z,L,P;if(O>=X&&(O<=X+q.scrollTopMargin||H<=J)){if(S){S()}return}else{if(!q.smoothScroll){window.scrollTo(0,K);if(S){S()}return}else{if(typeof YAHOO!==j&&typeof YAHOO.env!==j&&typeof YAHOO.env.ua!==j&&typeof YAHOO.util!==j&&typeof YAHOO.util.Scroll!==j){I=YAHOO.env.ua.webkit?document.body:document.documentElement;M=YAHOO.util.Easing?YAHOO.util.Easing.easeOut:undefined;N=new YAHOO.util.Scroll(I,{scroll:{to:[0,K]}},q.scrollDuration/1000,M);N.onComplete.subscribe(S);N.animate()}else{if(d){$("body, html").animate({scrollTop:K},q.scrollDuration,S)}else{if(K<0){K=0}Z=(X>O)?-1:1;L=Math.abs(X-K)/(q.scrollDuration/10);P=setInterval(function(){var ad=k.getScrollTop(),ac=ad+(Z*L);if((Z>0&&ac>=K)||Z<0&&ac<=K){ac=K;clearInterval(P);if(S){S()}window.scrollTo(0,ac);return}window.scrollTo(0,ac);if(k.getScrollTop()===ad){clearInterval(P);if(S){S()}}},10)}}}}},D=function(I,L){var K=this,H=y.steps[t+L],J=w();J.hide();setTimeout(function(){var O=B(),N=t,M=false;if(q.skipIfNoElement){while(!M&&t+L>=0&&t+L=0&&t+L0&&O.onNext){O.onNext()}else{if(L<0&&O.onPrev){O.onPrev()}}k.invokeCallbacks(L>0?"next":"prev",[y.id,N])}K.showStep(t)},H.delay?H.delay:0);return this},r=function(M){var K={},I,N,J,H,L;y=M;for(N in M){if(M.hasOwnProperty(N)&&N!=="id"&&N!=="steps"){K[N]=M[N]}}this.resetDefaultOptions();u.call(this,K,true);H=k.getState(q.cookieName);if(H){L=H.split(":");x=L[0];p=L[1];F=undefined;J=p.split("-");if(J.length>1){p=parseInt(J[0],10);F=parseInt(J[1],10)}else{p=parseInt(p,10)}if(L.length>2&&L[2]==="mp"){if(F&&F0){F=0}else{F=undefined}}}}}return this},C=function(){if(v){this.configure(v)}};this.startTour=function(L,K,J){var H,I;if(!y){r.call(this,L)}if(typeof K!==j){t=K;G=J}if(document.readyState!=="complete"){b=true;return this}if(typeof t===j){if(y.id===x&&typeof p!==j){t=p;G=F;I=B();if(!I||!k.getStepTarget(I)){--t;I=B();if(!k.getStepTarget(I)){this.endTour(false,false);return this}}}else{t=0}}if(!G&&A()){G=0}k.invokeCallbacks("start",[y.id,t]);H=w();H.hide(false);this.isActive=true;if(q.animate){H.initAnimate()}if(!k.getStepTarget(B())){k.invokeCallbacks("error",[y.id,t]);if(q.skipIfNoElement){this.nextStep()}}else{this.showStep(t,G)}return this};this.showStep=function(Q,I){var K=y.steps,J=K[Q],H=K.length,O=y.id+":"+Q,N=w(),R=this,P=k.getStepTarget(J),M,L;t=Q;G=I;if(!q.animate){N.hide(false)}if(typeof I!==j&&A()){J=J[I];O+="-"+I}if(J.nextOnTargetClick){M=function(){R.nextStep();return P.removeEventListener?P.removeEventListener("click",M):P.detachEvent("click",M)}}L=(Q===H-1)||(I>=J.length-1);N.renderStep(J,Q,I,L,function(){s(function(){N.show()});if(J.onShow){J.onShow()}if(J.nextOnTargetClick){k.addClickListener(P,M)}});k.invokeCallbacks("show",[y.id,t]);if(J.multipage){O+=":mp"}k.setState(q.cookieName,O,1);return this};this.prevStep=function(H){D.call(this,H,-1)};this.nextStep=function(H){D.call(this,H,1)};this.endTour=function(J,I){var H=w();J=k.valOrDefault(J,true);I=k.valOrDefault(I,true);t=0;G=undefined;p=undefined;H.hide();if(J){k.clearState(q.cookieName)}n.isActive=false;if(y&&I){k.invokeCallbacks("end",[y.id])}n.removeCallbacks(true);y=null;return this};this.getCurrTour=function(){return y};this.getCurrStepNum=function(){return t};this.getCurrSubstepNum=function(){return G};this.addCallback=function(J,H,I){if(H){i[J].push({cb:H,fromTour:I})}return this};this.removeCallback=function(L,I){var J=i[L],K,H;for(K=0,H=J.length;K=0){k.addClass(w,"prev")}else{k.addClass(w,"next")}return w},r=function(x,w,z){var y="hide";if(z){y="hide-all"}if(typeof w===j){w=true}if(w){k.removeClass(x,y)}else{k.addClass(x,y)}},s=function(z){var E,w,C,y,D,A,B=6,H=k.getStepTarget(z),x=this.element,G=this.arrowEl,F=k.getPixelValue(z.arrowOffset);E=k.getPixelValue(z.width)||u.bubbleWidth;C=k.valOrDefault(z.padding,u.bubblePadding);k.removeClass(x,"fade-in-down fade-in-up fade-in-left fade-in-right");y=H.getBoundingClientRect();if(z.orientation==="top"){w=x.offsetHeight;D=(y.top-w)-u.arrowWidth;A=y.left}else{if(z.orientation==="bottom"){D=y.bottom+u.arrowWidth;A=y.left}else{if(z.orientation==="left"){D=y.top;A=y.left-E-2*C-2*B-u.arrowWidth}else{if(z.orientation==="right"){D=y.top;A=y.right+u.arrowWidth}}}}if(!F){G.style.top="";G.style.left=""}else{if(z.orientation==="top"||z.orientation==="bottom"){G.style.top="";G.style.left=F+"px"}else{if(z.orientation==="left"||z.orientation==="right"){G.style.left="";G.style.top=F+"px"}}}A+=k.getPixelValue(z.xOffset);D+=k.getPixelValue(z.yOffset);if(!z.fixedElement){D+=k.getScrollTop();A+=k.getScrollLeft()}x.style.position=(z.fixedElement?"fixed":"absolute");if(u.animate&&d&&!f){$(x).animate({top:D+"px",left:A+"px"})}else{x.style.top=D+"px";x.style.left=A+"px"}},v=function(){var A=document.createElement("div"),B=document.createElement("div"),z=document.createElement("div"),y=this,C=false,x,w;this.element=A;this.containerEl=B;this.titleEl=document.createElement("h3");this.numberEl=document.createElement("span");this.contentEl=document.createElement("p");A.id="hopscotch-bubble";k.addClass(A,"animated");B.id="hopscotch-bubble-container";this.numberEl.id="hopscotch-bubble-number";B.appendChild(this.numberEl);z.appendChild(this.titleEl);z.appendChild(this.contentEl);z.id="hopscotch-bubble-content";B.appendChild(z);A.appendChild(B);this.initNavButtons();this.initCloseButton();this.initArrow();x=function(){if(C||!q){return}C=true;w=setTimeout(function(){s.call(y,p,false);C=false},200)};if(window.addEventListener){window.addEventListener("resize",x)}else{if(window.attachEvent){window.attachEvent("onresize",x)}}this.hide();document.body.appendChild(A);return this};this.initNavButtons=function(){var w=document.createElement("div");this.prevBtnEl=t("hopscotch-prev",l.prevBtn);this.nextBtnEl=t("hopscotch-next",l.nextBtn);this.doneBtnEl=t("hopscotch-done",l.doneBtn);k.addClass(this.doneBtnEl,"hide");w.appendChild(this.prevBtnEl);w.appendChild(this.nextBtnEl);w.appendChild(this.doneBtnEl);k.addClickListener(this.prevBtnEl,function(x){n.prevStep(true)});k.addClickListener(this.nextBtnEl,function(x){n.nextStep(true)});k.addClickListener(this.doneBtnEl,n.endTour);w.id="hopscotch-actions";this.buttonsEl=w;this.containerEl.appendChild(w);return this};this.initCloseButton=function(){var w=document.createElement("a");w.id="hopscotch-bubble-close";w.href="#";w.title=l.closeTooltip;w.innerHTML=l.closeTooltip;k.addClickListener(w,function(y){var x=n.getCurrStepNum(),z=n.getCurrTour(),A=(x===z.steps.length-1);k.invokeCallbacks("close",[z.id,x]);n.endTour(true,A);if(y.preventDefault){y.preventDefault()}else{if(event){event.returnValue=false}}});this.closeBtnEl=w;this.containerEl.appendChild(w);return this};this.initArrow=function(){var w,x;this.arrowEl=document.createElement("div");this.arrowEl.id="hopscotch-bubble-arrow-container";x=document.createElement("div");x.className="hopscotch-bubble-arrow-border";w=document.createElement("div");w.className="hopscotch-bubble-arrow";this.arrowEl.appendChild(x);this.arrowEl.appendChild(w);this.element.appendChild(this.arrowEl);return this};this.renderStep=function(y,D,z,A,E){var F=this,x=k.valOrDefault(y.showNextButton,u.showNextButton),w=k.valOrDefault(y.showPrevButton,u.showPrevButton),C,B;p=y;this.setTitle(y.title?y.title:"");this.setContent(y.content?y.content:"");this.setNum(D);this.orientation=y.orientation;this.showPrevButton(this.prevBtnEl&&w&&(D>0||z>0));this.showNextButton(this.nextBtnEl&&x&&!A);this.nextBtnEl.value=y.showSkip?l.skipBtn:l.nextBtn;if(A){k.removeClass(this.doneBtnEl,"hide")}else{k.addClass(this.doneBtnEl,"hide")}this.setArrow(y.orientation);C=k.getPixelValue(y.width)||u.bubbleWidth;B=k.valOrDefault(y.padding,u.bubblePadding);this.containerEl.style.width=C+"px";this.containerEl.style.padding=B+"px";this.element.style.zIndex=(y.zindex?y.zindex:"");if(y.orientation==="top"){setTimeout(function(){s.call(F,y);if(E){if(!y.fixedElement){E()}else{F.show()}}},5)}else{s.call(this,y);if(E){if(!y.fixedElement){E()}else{F.show()}}}return this};this.setTitle=function(w){if(w){this.titleEl.innerHTML=w;k.removeClass(this.titleEl,"hide")}else{k.addClass(this.titleEl,"hide")}return this};this.setContent=function(w){if(w){this.contentEl.innerHTML=w;k.removeClass(this.contentEl,"hide")}else{k.addClass(this.contentEl,"hide")}return this};this.setNum=function(w){if(l.stepNums&&w=w.steps.length){return null}else{G=w.steps[q]}return(G.length>0)?G[C]:G},z=function(R){var P=t(),Z=P.element,V=k.getPixelValue(Z.style.top),U=V+k.getPixelValue(Z.offsetHeight),S=k.getStepTarget(D()),aa=S.getBoundingClientRect(),X=aa.top+k.getScrollTop(),T=aa.bottom+k.getScrollTop(),N=(VT)?U:T,W=k.getScrollTop(),I=W+k.getWindowHeight(),J=N-r.scrollTopMargin,Q=this,H,M,L,Y,K,O;if(N>=W&&(N<=W+r.scrollTopMargin||G<=I)){if(R){R()}return}else{if(!r.smoothScroll){window.scrollTo(0,J);if(R){R()}return}else{if(typeof YAHOO!==j&&typeof YAHOO.env!==j&&typeof YAHOO.env.ua!==j&&typeof YAHOO.util!==j&&typeof YAHOO.util.Scroll!==j){H=YAHOO.env.ua.webkit?document.body:document.documentElement;L=YAHOO.util.Easing?YAHOO.util.Easing.easeOut:undefined;M=new YAHOO.util.Scroll(H,{scroll:{to:[0,J]}},r.scrollDuration/1000,L);M.onComplete.subscribe(R);M.animate()}else{if(d){$("body, html").animate({scrollTop:J},r.scrollDuration,R)}else{if(J<0){J=0}Y=(W>N)?-1:1;K=Math.abs(W-J)/(r.scrollDuration/10);O=setInterval(function(){var ac=k.getScrollTop(),ab=ac+(Y*K);if((Y>0&&ab>=J)||Y<0&&ab<=J){ab=J;clearInterval(O);if(R){R()}window.scrollTo(0,ab);return}window.scrollTo(0,ab);if(k.getScrollTop()===ac){clearInterval(O);if(R){R()}}},10)}}}}},x=function(H,K){var J=this,G=w.steps[q+K],I=t();H=k.valOrDefault(H,true);I.hide();setTimeout(function(){var N=D(),M=q,L=false;if(r.skipIfNoElement){while(!L&&q+K>=0&&q+K=0&&q+K0&&N.onNext){N.onNext()}else{if(K<0&&N.onPrev){N.onPrev()}}k.invokeCallbacks(K>0?"next":"prev",[w.id,M])}J.showStep(q)},G.delay?G.delay:0);return this},v=function(L){var J={},H,M,I,G,K;w=L;for(M in L){if(L.hasOwnProperty(M)&&M!=="id"&&M!=="steps"){J[M]=L[M]}}this.resetDefaultOptions();s.call(this,J,true);G=k.getState(r.cookieName);if(G){K=G.split(":");E=K[0];u=K[1];y=undefined;I=u.split("-");if(I.length>1){u=parseInt(I[0],10);y=parseInt(I[1],10)}else{u=parseInt(u,10)}if(K.length>2&&K[2]==="mp"){if(y&&y0){y=0}else{y=undefined}}}}}return this},F=function(G){if(G){this.configure(G)}};this.startTour=function(K,J,I){var G,H;if(!w){v.call(this,K)}if(typeof J!==j){q=J;C=I}if(document.readyState!=="complete"){b=true;return this}if(typeof q===j){if(w.id===E&&typeof u!==j){q=u;C=y;H=D();if(!H||!k.getStepTarget(H)){--q;H=D();if(!k.getStepTarget(H)){this.endTour(false,false);return this}}}else{q=0}}k.invokeCallbacks("start",[w.id,q]);G=t();G.hide(false);this.isActive=true;if(r.animate){G.initAnimate()}if(!k.getStepTarget(D())){k.invokeCallbacks("error",[w.id,q]);if(r.skipIfNoElement){this.nextStep(false)}}else{this.showStep(q,C)}return this};this.showStep=function(L,N){var I=w.steps,H=I[L],G=I.length,O=w.id+":"+L,M=t(),Q=this,P=k.getStepTarget(H),K,J;q=L;C=N;if(!r.animate){M.hide(false)}if(H.nextOnTargetClick){K=function(){Q.nextStep(false);return P.removeEventListener?P.removeEventListener("click",K):P.detachEvent("click",K)}}J=(L===G-1)||(N>=H.length-1);M.renderStep(H,L,N,J,function(){z(function(){M.show()});if(H.onShow){H.onShow()}if(H.nextOnTargetClick){k.addClickListener(P,K)}});k.invokeCallbacks("show",[w.id,q]);if(H.multipage){O+=":mp"}k.setState(r.cookieName,O,1);return this};this.prevStep=function(G){x.call(this,G,-1);return this};this.nextStep=function(G){x.call(this,G,1);return this};this.endTour=function(I,G){var H=t();I=k.valOrDefault(I,true);G=k.valOrDefault(G,true);q=0;C=undefined;u=undefined;H.hide();if(I){k.clearState(r.cookieName)}n.isActive=false;if(w&&G){k.invokeCallbacks("end",[w.id])}n.removeCallbacks(true);w=null;return this};this.getCurrTour=function(){return w};this.getCurrStepNum=function(){return q};this.addCallback=function(I,G,H){if(I&&G){i[I].push({cb:G,fromTour:H})}return this};this.removeCallback=function(K,H){var I=i[K],J,G;for(J=0,G=I.length;J