diff --git a/js/hopscotch-0.1.js b/js/hopscotch-0.1.js index 1920d3e6..80527ad1 100644 --- a/js/hopscotch-0.1.js +++ b/js/hopscotch-0.1.js @@ -2061,6 +2061,19 @@ helpers[id] = null; }; + this.invokeHelper = function(id) { + var args = [], + i, + len; + + for (i = 1, len = arguments.length; i < len; ++i) { + args.push(arguments[i]); + } + if (helpers[id]) { + helpers[id].call(null, args); + } + }; + /** * setCookieName * diff --git a/js/hopscotch-0.1.min.js b/js/hopscotch-0.1.min.js index 8325a77f..d4188ab5 100644 --- a/js/hopscotch-0.1.min.js +++ b/js/hopscotch-0.1.min.js @@ -1,11 +1,28 @@ -(function(u,v){var w,x,C,D,y,E=window.Sizzle||null,b,q,s,m,j=u[v],F=!1,G="undefined"!==typeof window.jQuery,r="undefined"!==typeof window.sessionStorage,g=window.document;m={smoothScroll:!0,scrollDuration:1E3,scrollTopMargin:200,showCloseButton:!0,showPrevButton:!1,showNextButton:!0,bubbleWidth:280,bubblePadding:15,arrowWidth:20,skipIfNoElement:!0,cookieName:"hopscotch.tour.state"};j||(Array.isArray||(Array.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)}),b={addClass:function(a, +/** + * + * Copyright 2013 LinkedIn Corp. All rights reserved. + + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + + * http://www.apache.org/licenses/LICENSE-2.0 + + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +(function(u,v){var w,x,C,D,y,E=window.Sizzle||null,b,r,m,n,j=u[v],F=!1,G="undefined"!==typeof window.jQuery,s="undefined"!==typeof window.sessionStorage,g=window.document;n={smoothScroll:!0,scrollDuration:1E3,scrollTopMargin:200,showCloseButton:!0,showPrevButton:!1,showNextButton:!0,bubbleWidth:280,bubblePadding:15,arrowWidth:20,skipIfNoElement:!0,cookieName:"hopscotch.tour.state"};j||(Array.isArray||(Array.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)}),b={addClass:function(a, b){var c,d,f,i;if(a.className){d=b.split(/\s+/);c=" "+a.className+" ";f=0;for(i=d.length;fc.indexOf(" "+d[f]+" ")&&(c+=d[f]+" ");a.className=c.replace(/^\s+|\s+$/g,"")}else a.className=b},removeClass:function(a,b){var c,d,f,i;d=b.split(/\s+/);c=" "+a.className+" ";f=0;for(i=d.length;f -h||h>=i.steps.length?null:i.steps[h]},u=function(){e.nextStep(!1)},B=function(a,c){var d,e,g;0<=h+a&&h+ae?d:e,f=b.getScrollTop(),e=f+b.getWindowHeight(),h=a-l("scrollTopMargin"),z,i,A;a>=f&&(a<=f+l("scrollTopMargin")||d<=e)?k&&k():l("smoothScroll")?"undefined"!==typeof YAHOO&&"undefined"!==typeof YAHOO.env&&"undefined"!==typeof YAHOO.env.ua&&"undefined"!==typeof YAHOO.util&&"undefined"!==typeof YAHOO.util.Scroll?(a=YAHOO.env.ua.webkit?g.body:g.documentElement, +this.removeCallout(b)};this.removeCallout=function(b){var c=a[b];a[b]=null;c&&c.destroy()}},w=function(a){var e=this,c,d,f,i,h,j,p,s,t=function(a){c||(c=new x(f));a&&(b.extend(c.opt,{bubblePadding:l("bubblePadding"),bubbleWidth:l("bubbleWidth"),showNextButton:l("showNextButton"),showPrevButton:l("showPrevButton"),showCloseButton:l("showCloseButton"),arrowWidth:l("arrowWidth")}),c.updateButtons());return c},l=function(a){return"undefined"===typeof f?n[a]:b.valOrDefault(f[a],n[a])},q=function(){return 0> +h||h>=i.steps.length?null:i.steps[h]},u=function(){e.nextStep(!1)},B=function(a,c){var d,e,g;0<=h+a&&h+ae?d:e,f=b.getScrollTop(),e=f+b.getWindowHeight(),h=a-l("scrollTopMargin"),z,i,A;a>=f&&(a<=f+l("scrollTopMargin")||d<=e)?k&&k():l("smoothScroll")?"undefined"!==typeof YAHOO&&"undefined"!==typeof YAHOO.env&&"undefined"!==typeof YAHOO.env.ua&&"undefined"!==typeof YAHOO.util&&"undefined"!==typeof YAHOO.util.Scroll?(a=YAHOO.env.ua.webkit?g.body:g.documentElement, d=YAHOO.util.Easing?YAHOO.util.Easing.easeOut:void 0,a=new YAHOO.util.Scroll(a,{scroll:{to:[0,h]}},l("scrollDuration")/1E3,d),a.onComplete.subscribe(k),a.animate()):G?$("body, html").animate({scrollTop:h},l("scrollDuration"),k):(0>h&&(h=0),z=f>a?-1:1,i=Math.abs(f-h)/(l("scrollDuration")/10),A=function(){var a=b.getScrollTop(),c=a+z*i;0=h||0>z&&c<=h?(c=h,k&&k(),window.scrollTo(0,c)):(window.scrollTo(0,c),b.getScrollTop()===a?k&&k():setTimeout(A,10))},A()):(window.scrollTo(0,h),k&&k())}else k(); -c.nextOnTargetClick&&b.addEvtListener(j,"click",u)});c.multipage&&(e+=":mp");b.setState(l("cookieName"),e,1)};this.getCalloutManager=function(){"undefined"===typeof d&&(d=new C);return d};this.startTour=function(a,c){var d,e=this;if(!i){i=a;var f={},g;for(g in a)a.hasOwnProperty(g)&&("id"!==g&&"steps"!==g)&&(f[g]=a[g]);r.call(this,f,!0);if(f=b.getState(l("cookieName")))f=f.split(":"),j=f[0],n=f[1],n=parseInt(n,10),2=i.steps.length)throw"Specified step number out of bounds."; -h=c}if(!b.documentIsReady())return F=!0,this;!h&&i.id===j&&"undefined"!==typeof n?h=n:h||(h=0);a:{var f=function(a){-1!==a&&b.getStepTarget(i.steps[a])?(b.invokeEventCallbacks("start"),d=t(),d.hide(!1),e.isActive=!0,b.getStepTarget(p())?e.showStep(a):(b.invokeEventCallbacks("error"),l("skipIfNoElement")&&e.nextStep(!1))):e.endTour(!1,!1)},k;g=!1;h=h||0;k=p();if(k=b.getStepTarget(k))f(h);else{if(0=i.steps.length)throw"Specified step number out of bounds."; +h=c}if(!b.documentIsReady())return F=!0,this;!h&&i.id===j&&"undefined"!==typeof p?h=p:h||(h=0);a:{var f=function(a){-1!==a&&b.getStepTarget(i.steps[a])?(b.invokeEventCallbacks("start"),d=t(),d.hide(!1),e.isActive=!0,b.getStepTarget(q())?e.showStep(a):(b.invokeEventCallbacks("error"),l("skipIfNoElement")&&e.nextStep(!1))):e.endTour(!1,!1)},k;g=!1;h=h||0;k=q();if(k=b.getStepTarget(k))f(h);else{if(0
- +