diff --git a/README.md b/README.md index 9b17704b2..31fdb609c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Intro.js v2.3.0 +# Intro.js v2.4.0 > Better introductions for websites and features with a step-by-step guide for your projects. @@ -83,7 +83,6 @@ Want to learn faster and easier? Here we have **Instant IntroJs**, Packt Publish ## Support/Discussion -- [Google Group](https://groups.google.com/d/forum/introjs) - [Stackoverflow](http://stackoverflow.com/questions/tagged/intro.js) ## License diff --git a/changelog.md b/changelog.md index 9ce0b6951..8a5fa9247 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,12 @@ ## Release History + * **v2.4.0** - 2016-12-11 + - New documentation + - New template: Modern + - Added showHint and showHints + - Added Dart and R wrappers + - Minor bug fixes and coding style issues + * **v2.3.0** - 2016-07-01 - Fixing the conflict with Bootstrap 3 - Adding two new options to hide next and previous button in first and last steps diff --git a/component.json b/component.json index da4f10bf6..e45bf6b10 100644 --- a/component.json +++ b/component.json @@ -2,7 +2,7 @@ "name": "intro.js", "repo": "usablica/intro.js", "description": "Better introductions for websites and features with a step-by-step guide for your projects", - "version": "2.3.0", + "version": "2.4.0", "main": "intro.js", "scripts": [ "intro.js" diff --git a/intro.js b/intro.js index 8a44d84a2..9e8eb7f85 100644 --- a/intro.js +++ b/intro.js @@ -1,5 +1,5 @@ /** - * Intro.js v2.3.0 + * Intro.js v2.4.0 * https://github.com/usablica/intro.js * * Copyright (C) 2016 Afshin Mehrabani (@afshinmeh) @@ -18,7 +18,7 @@ } } (this, function (exports) { //Default config/variables - var VERSION = '2.3.0'; + var VERSION = '2.4.0'; /** * IntroJs main class diff --git a/minified/intro.min.js b/minified/intro.min.js index 424e5da7f..5e6a244fb 100644 --- a/minified/intro.min.js +++ b/minified/intro.min.js @@ -1,45 +1,46 @@ (function(C,p){"object"===typeof exports?p(exports):"function"===typeof define&&define.amd?define(["exports"],p):p(C)})(this,function(C){function p(a){this._targetElement=a;this._introItems=[];this._options={nextLabel:"Next →",prevLabel:"← Back",skipLabel:"Skip",doneLabel:"Done",hidePrev:!1,hideNext:!1,tooltipPosition:"bottom",tooltipClass:"",highlightClass:"",exitOnEsc:!0,exitOnOverlayClick:!0,showStepNumbers:!0,keyboardNavigation:!0,showButtons:!0,showBullets:!0,showProgress:!1,scrollToElement:!0, -overlayOpacity:0.8,scrollPadding:30,positionPrecedence:["bottom","top","right","left"],disableInteraction:!1,hintPosition:"top-middle",hintButtonLabel:"Got it",hintAnimation:!0}}function R(a){var b=[],c=this;if(this._options.steps)for(var d=0,f=this._options.steps.length;df.length)return!1;d=0;for(e=f.length;dl.width||0>k.left+k.width/2-q?(s(g,"bottom"),s(g,"top")):(k.height+k.top+x>l.height&&s(g,"bottom"),0>k.top-x&&s(g,"top"));k.width+k.left+q>l.width&&s(g,"right");0>k.left-q&&s(g,"left");0g.height?(c.className="introjs-arrow left-bottom",b.style.top="-"+(a.height-e.height-20)+"px"):c.className="introjs-arrow left";break;case "left":f||!0!=this._options.showStepNumbers||(b.style.top="15px");e.top+a.height>g.height?(b.style.top="-"+(a.height-e.height-20)+"px",c.className="introjs-arrow right-bottom"):c.className="introjs-arrow right";b.style.right=e.width+20+"px";break;case "floating":c.style.display= "none";b.style.left="50%";b.style.top="50%";b.style.marginLeft="-"+a.width/2+"px";b.style.marginTop="-"+a.height/2+"px";"undefined"!=typeof d&&null!=d&&(d.style.left="-"+(a.width/2+18)+"px",d.style.top="-"+(a.height/2+18)+"px");break;case "bottom-right-aligned":c.className="introjs-arrow top-right";O(e,0,a,b);b.style.top=e.height+20+"px";break;case "bottom-middle-aligned":c.className="introjs-arrow top-middle";c=e.width/2-a.width/2;f&&(c+=5);O(e,c,a,b)&&(b.style.right=null,I(e,c,a,g,b));b.style.top= e.height+20+"px";break;default:c.className="introjs-arrow top",I(e,0,a,g,b),b.style.top=e.height+20+"px"}}}function I(a,b,c,d,f){if(a.left+b+c.width>d.width)return f.style.left=d.width-c.width-a.left+"px",!1;f.style.left=b+"px";return!0}function O(a,b,c,d){if(0>a.left+a.width-b-c.width)return d.style.left=-a.left+"px",!1;d.style.right=b+"px";return!0}function s(a,b){-1 a.active").className="";d.querySelector('.introjs-bullets li > a[data-stepnumber="'+a.step+'"]').className="active";d.querySelector(".introjs-progress .introjs-progressbar").setAttribute("style","width:"+P.call(b)+"%;");x.style.opacity=1;e&&(e.style.opacity=1);-1===m.tabIndex?q.focus():m.focus()},350)}else{var p=document.createElement("div"),k=document.createElement("div"),c=document.createElement("div"),n=document.createElement("div"), -s=document.createElement("div"),w=document.createElement("div"),F=document.createElement("div"),u=document.createElement("div");p.className=f;k.className="introjs-tooltipReferenceLayer";r.call(b,p);r.call(b,k);this._targetElement.appendChild(p);this._targetElement.appendChild(k);c.className="introjs-arrow";s.className="introjs-tooltiptext";s.innerHTML=a.intro;w.className="introjs-bullets";!1===this._options.showBullets&&(w.style.display="none");for(var p=document.createElement("ul"),f=0,C=this._introItems.length;f< -C;f++){var y=document.createElement("li"),B=document.createElement("a");B.onclick=function(){b.goToStep(this.getAttribute("data-stepnumber"))};f===a.step-1&&(B.className="active");D(B);B.innerHTML=" ";B.setAttribute("data-stepnumber",this._introItems[f].step);y.appendChild(B);p.appendChild(y)}w.appendChild(p);F.className="introjs-progress";!1===this._options.showProgress&&(F.style.display="none");f=document.createElement("div");f.className="introjs-progressbar";f.setAttribute("style","width:"+ -P.call(this)+"%;");F.appendChild(f);u.className="introjs-tooltipbuttons";!1===this._options.showButtons&&(u.style.display="none");n.className="introjs-tooltip";n.appendChild(s);n.appendChild(w);n.appendChild(F);!0==this._options.showStepNumbers&&(h=document.createElement("span"),h.className="introjs-helperNumberLayer",h.innerHTML=a.step,k.appendChild(h));n.appendChild(c);k.appendChild(n);m=document.createElement("a");m.onclick=function(){b._introItems.length-1!=b._currentStep&&z.call(b)};D(m);m.innerHTML= -this._options.nextLabel;k=document.createElement("a");k.onclick=function(){0!=b._currentStep&&E.call(b)};D(k);k.innerHTML=this._options.prevLabel;q=document.createElement("a");q.className="introjs-button introjs-skipbutton";D(q);q.innerHTML=this._options.skipLabel;q.onclick=function(){b._introItems.length-1==b._currentStep&&"function"===typeof b._introCompleteCallback&&b._introCompleteCallback.call(b);b._introItems.length-1!=b._currentStep&&"function"===typeof b._introExitCallback&&b._introExitCallback.call(b); -A.call(b,b._targetElement)};u.appendChild(q);1n||"none"!==u&&void 0!== -u)h.className+=" introjs-fixParent";h=h.parentNode}U(a.element)||!0!==this._options.scrollToElement||(n=a.element.getBoundingClientRect(),h=H().height,c=n.bottom-(n.bottom-n.top),n=n.bottom-h,0>c||a.element.clientHeight>h?window.scrollBy(0,c-this._options.scrollPadding):window.scrollBy(0,n+70+this._options.scrollPadding));"undefined"!==typeof this._introAfterChangeCallback&&this._introAfterChangeCallback.call(this,a.element)}function v(a,b){var c="";a.currentStyle?c=a.currentStyle[b]:document.defaultView&& -document.defaultView.getComputedStyle&&(c=document.defaultView.getComputedStyle(a,null).getPropertyValue(b));return c&&c.toLowerCase?c.toLowerCase():c}function J(a){var b=a.parentNode;return b&&"HTML"!==b.nodeName?"fixed"==v(a,"position")?!0:J(b):!1}function H(){if(void 0!=window.innerWidth)return{width:window.innerWidth,height:window.innerHeight};var a=document.documentElement;return{width:a.clientWidth,height:a.clientHeight}}function U(a){a=a.getBoundingClientRect();return 0<=a.top&&0<=a.left&& -a.bottom+80<=window.innerHeight&&a.right<=window.innerWidth}function S(a){var b=document.createElement("div"),c="",d=this;b.className="introjs-overlay";if(a.tagName&&"body"!==a.tagName.toLowerCase()){var f=t(a);f&&(c+="width: "+f.width+"px; height:"+f.height+"px; top:"+f.top+"px;left: "+f.left+"px;",b.setAttribute("style",c))}else c+="top: 0;bottom: 0; left: 0;right: 0;position: fixed;",b.setAttribute("style",c);a.appendChild(b);b.onclick=function(){!0==d._options.exitOnOverlayClick&&(void 0!=d._introExitCallback&& -d._introExitCallback.call(d),A.call(d,a))};setTimeout(function(){c+="opacity: "+d._options.overlayOpacity.toString()+";";b.setAttribute("style",c)},10);return!0}function w(){var a=this._targetElement.querySelector(".introjs-hintReference");if(a){var b=a.getAttribute("data-step");a.parentNode.removeChild(a);return b}}function K(){for(var a=0,b=this._introItems.length;ac.length)break a;a=0;for(b=c.length;a a.active").className="",d.querySelector('.introjs-bullets li > a[data-stepnumber="'+a.step+'"]').className="active");d.querySelector(".introjs-progress .introjs-progressbar").setAttribute("style","width:"+P.call(b)+"%;");x.style.opacity=1;e&&(e.style.opacity=1);-1===m.tabIndex?q.focus():m.focus()},350)}else{var p=document.createElement("div"),k=document.createElement("div"),c=document.createElement("div"),n= +document.createElement("div"),s=document.createElement("div"),w=document.createElement("div"),F=document.createElement("div"),u=document.createElement("div");p.className=f;k.className="introjs-tooltipReferenceLayer";r.call(b,p);r.call(b,k);this._targetElement.appendChild(p);this._targetElement.appendChild(k);c.className="introjs-arrow";s.className="introjs-tooltiptext";s.innerHTML=a.intro;w.className="introjs-bullets";!1===this._options.showBullets&&(w.style.display="none");for(var p=document.createElement("ul"), +f=0,C=this._introItems.length;fn||"none"!==u&&void 0!==u)h.className+=" introjs-fixParent";h=h.parentNode}W(a.element)||!0!==this._options.scrollToElement||(n=a.element.getBoundingClientRect(),h=H().height,c=n.bottom-(n.bottom-n.top),n=n.bottom-h,0>c||a.element.clientHeight>h?window.scrollBy(0,c-this._options.scrollPadding):window.scrollBy(0,n+70+this._options.scrollPadding));"undefined"!==typeof this._introAfterChangeCallback&&this._introAfterChangeCallback.call(this,a.element)}function v(a,b){var c=""; +a.currentStyle?c=a.currentStyle[b]:document.defaultView&&document.defaultView.getComputedStyle&&(c=document.defaultView.getComputedStyle(a,null).getPropertyValue(b));return c&&c.toLowerCase?c.toLowerCase():c}function J(a){var b=a.parentNode;return b&&"HTML"!==b.nodeName?"fixed"==v(a,"position")?!0:J(b):!1}function H(){if(void 0!=window.innerWidth)return{width:window.innerWidth,height:window.innerHeight};var a=document.documentElement;return{width:a.clientWidth,height:a.clientHeight}}function W(a){a= +a.getBoundingClientRect();return 0<=a.top&&0<=a.left&&a.bottom+80<=window.innerHeight&&a.right<=window.innerWidth}function U(a){var b=document.createElement("div"),c="",d=this;b.className="introjs-overlay";if(a.tagName&&"body"!==a.tagName.toLowerCase()){var f=t(a);f&&(c+="width: "+f.width+"px; height:"+f.height+"px; top:"+f.top+"px;left: "+f.left+"px;",b.setAttribute("style",c))}else c+="top: 0;bottom: 0; left: 0;right: 0;position: fixed;",b.setAttribute("style",c);a.appendChild(b);b.onclick=function(){!0== +d._options.exitOnOverlayClick&&(void 0!=d._introExitCallback&&d._introExitCallback.call(d),A.call(d,a))};setTimeout(function(){c+="opacity: "+d._options.overlayOpacity.toString()+";";b.setAttribute("style",c)},10);return!0}function w(){var a=this._targetElement.querySelector(".introjs-hintReference");if(a){var b=a.getAttribute("data-step");a.parentNode.removeChild(a);return b}}function Q(a){this._introItems=[];if(this._options.hints){a=0;for(var b=this._options.hints.length;ac.length)return!1;a=0;for(b=c.length;a", "homepage": "http://introjs.com", "repository": {