introjs-rails 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- (function(){function t(e){this._targetElement=e}function n(e){var t=e.querySelectorAll("*[data-intro]"),n=[],o=this;if(t.length<1){return false}for(var u=0,a=t.length;u<a;u++){var l=t[u];n.push({element:l,intro:l.getAttribute("data-intro"),step:parseInt(l.getAttribute("data-step"),10),position:l.getAttribute("data-position")||"bottom"})}n.sort(function(e,t){return e.step-t.step});o._introItems=n;if(f.call(o,e)){r.call(o);var c=e.querySelector(".introjs-skipbutton"),h=e.querySelector(".introjs-nextbutton");window.onkeydown=function(t){if(t.keyCode==27){s.call(o,e)}else if(t.keyCode==37){i.call(o)}else if(t.keyCode==39||t.keyCode==13){r.call(o)}}}return false}function r(){if(typeof this._currentStep==="undefined"){this._currentStep=0}else{++this._currentStep}if(this._introItems.length<=this._currentStep){if(this._introCompleteCallback!=undefined){this._introCompleteCallback.call(this)}s.call(this,this._targetElement);return}u.call(this,this._introItems[this._currentStep].element)}function i(){if(this._currentStep==0){return false}u.call(this,this._introItems[--this._currentStep].element)}function s(e){var t=e.querySelector(".introjs-overlay");t.style.opacity=0;setTimeout(function(){if(t.parentNode){t.parentNode.removeChild(t)}},500);var n=e.querySelector(".introjs-helperLayer");if(n){n.parentNode.removeChild(n)}var r=document.querySelector(".introjs-showElement");if(r){r.className=r.className.replace(/introjs-[a-zA-Z]+/g,"").trim()}e.onkeydown=null;this._currentStep=undefined;if(this._introExitCallback!=undefined){this._introExitCallback.call(this)}}function o(e,t,n){var r=l(t);t.style.top=null;t.style.right=null;t.style.bottom=null;t.style.left=null;switch(e.getAttribute("data-position")){case"top":t.style.left="15px";t.style.top="-"+(r.height+10)+"px";n.className="introjs-arrow bottom";break;case"right":console.log(r);t.style.right="-"+(r.width+10)+"px";n.className="introjs-arrow left";break;case"left":t.style.top="15px";t.style.left="-"+(r.width+10)+"px";n.className="introjs-arrow right";break;case"bottom":default:t.style.bottom="-"+(r.height+10)+"px";n.className="introjs-arrow top";break}}function u(e){var t=this,n=document.querySelector(".introjs-helperLayer"),u=l(e);if(n!=null){var f=n.querySelector(".introjs-helperNumberLayer"),c=n.querySelector(".introjs-tooltiptext"),h=n.querySelector(".introjs-arrow"),p=n.querySelector(".introjs-tooltip");n.setAttribute("style","width: "+(u.width+10)+"px; "+"height:"+(u.height+10)+"px; "+"top:"+(u.top-5)+"px;"+"left: "+(u.left-5)+"px;");f.innerHTML=e.getAttribute("data-step");c.innerHTML=e.getAttribute("data-intro");var d=document.querySelector(".introjs-showElement");d.className=d.className.replace(/introjs-[a-zA-Z]+/g,"").trim();o(e,p,h)}else{var v=document.createElement("div"),m=document.createElement("span"),g=document.createElement("div"),y=document.createElement("div");v.className="introjs-helperLayer";v.setAttribute("style","width: "+(u.width+10)+"px; "+"height:"+(u.height+10)+"px; "+"top:"+(u.top-5)+"px;"+"left: "+(u.left-5)+"px;");this._targetElement.appendChild(v);m.className="introjs-helperNumberLayer";g.className="introjs-arrow";y.className="introjs-tooltip";m.innerHTML=e.getAttribute("data-step");y.innerHTML="<div class='introjs-tooltiptext'>"+e.getAttribute("data-intro")+"</div><div class='introjs-tooltipbuttons'></div>";v.appendChild(m);y.appendChild(g);v.appendChild(y);var b=document.createElement("a");b.onclick=function(){r.call(t)};b.className="introjs-button introjs-nextbutton";b.href="javascript:void(0);";b.innerHTML="Next →";var w=document.createElement("a");w.onclick=function(){i.call(t)};w.className="introjs-button introjs-prevbutton";w.href="javascript:void(0);";w.innerHTML="← Back";var E=document.createElement("a");E.className="introjs-button introjs-skipbutton";E.href="javascript:void(0);";E.innerHTML="Skip";E.onclick=function(){s.call(t,t._targetElement)};var S=y.querySelector(".introjs-tooltipbuttons");S.appendChild(E);S.appendChild(w);S.appendChild(b);o(e,y,g)}e.className+=" introjs-showElement";var x="";if(e.currentStyle){x=e.currentStyle["position"]}else if(document.defaultView&&document.defaultView.getComputedStyle){x=document.defaultView.getComputedStyle(e,null).getPropertyValue("position")}x=x.toLowerCase();if(x!="absolute"&&x!="relative"){e.className+=" introjs-relativePosition"}if(!a(e)){var T=e.getBoundingClientRect();top=T.bottom-T.height,bottom=T.bottom-window.innerHeight;if(top<0){window.scrollBy(0,top-30)}else{window.scrollBy(0,bottom+100)}}}function a(e){var t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom+80<=window.innerHeight&&t.right<=window.innerWidth}function f(e){var t=document.createElement("div"),n="",r=this;t.className="introjs-overlay";if(e.tagName.toLowerCase()=="body"){n+="top: 0;bottom: 0; left: 0;right: 0;position: fixed;";t.setAttribute("style",n)}else{var i=l(e);if(i){n+="width: "+i.width+"px; height:"+i.height+"px; top:"+i.top+"px;left: "+i.left+"px;";t.setAttribute("style",n)}}e.appendChild(t);t.onclick=function(){s.call(r,e)};setTimeout(function(){n+="opacity: .5;";t.setAttribute("style",n)},10);return true}function l(e){var t={};t.width=e.offsetWidth;t.height=e.offsetHeight;var n=0;var r=0;while(e&&!isNaN(e.offsetLeft)&&!isNaN(e.offsetTop)){n+=e.offsetLeft;r+=e.offsetTop;e=e.offsetParent}t.top=r;t.left=n;return t}var e="0.2.0";var c=function(e){if(typeof e==="object"){return new t(e)}else if(typeof e==="string"){var n=document.querySelector(e);if(n){return new t(n)}else{throw new Error("There's no element with given selector.")}}else{return new t(document.body)}};c.version=e;c.fn=t.prototype={clone:function(){return new t(this)},start:function(){n.call(this,this._targetElement);return this},oncomplete:function(e){if(typeof e==="function"){this._introCompleteCallback=e}else{throw new Error("Provided callback for oncomplete was not a function.")}return this},onexit:function(e){if(typeof e==="function"){this._introExitCallback=e}else{throw new Error("Provided callback for onexit was not a function.")}return this}};window["introJs"]=c})()
1
+ (function(){function t(e){this._targetElement=e}function n(e){var t=e.querySelectorAll("*[data-intro]"),n=[],o=this;if(t.length<1){return false}for(var u=0,a=t.length;u<a;u++){var l=t[u];n.push({element:l,intro:l.getAttribute("data-intro"),step:parseInt(l.getAttribute("data-step"),10),position:l.getAttribute("data-position")||"bottom"})}n.sort(function(e,t){return e.step-t.step});o._introItems=n;if(f.call(o,e)){r.call(o);var c=e.querySelector(".introjs-skipbutton"),h=e.querySelector(".introjs-nextbutton");window.onkeydown=function(t){if(t.keyCode==27){s.call(o,e)}else if(t.keyCode==37){i.call(o)}else if(t.keyCode==39||t.keyCode==13){r.call(o)}}}return false}function r(){if(typeof this._currentStep==="undefined"){this._currentStep=0}else{++this._currentStep}if(this._introItems.length<=this._currentStep){if(this._introCompleteCallback!=undefined){this._introCompleteCallback.call(this)}s.call(this,this._targetElement);return}u.call(this,this._introItems[this._currentStep].element)}function i(){if(this._currentStep==0){return false}u.call(this,this._introItems[--this._currentStep].element)}function s(e){var t=e.querySelector(".introjs-overlay");t.style.opacity=0;setTimeout(function(){if(t.parentNode){t.parentNode.removeChild(t)}},500);var n=e.querySelector(".introjs-helperLayer");if(n){n.parentNode.removeChild(n)}var r=document.querySelector(".introjs-showElement");if(r){r.className=r.className.replace(/introjs-[a-zA-Z]+/g,"").trim()}window.onkeydown=null;this._currentStep=undefined;if(this._introExitCallback!=undefined){this._introExitCallback.call(this)}}function o(e,t,n){var r=l(t);t.style.top=null;t.style.right=null;t.style.bottom=null;t.style.left=null;switch(e.getAttribute("data-position")){case"top":t.style.left="15px";t.style.top="-"+(r.height+10)+"px";n.className="introjs-arrow bottom";break;case"right":t.style.right="-"+(r.width+10)+"px";n.className="introjs-arrow left";break;case"left":t.style.top="15px";t.style.left="-"+(r.width+10)+"px";n.className="introjs-arrow right";break;case"bottom":default:t.style.bottom="-"+(r.height+10)+"px";n.className="introjs-arrow top";break}}function u(e){var t=this,n=document.querySelector(".introjs-helperLayer"),u=l(e);if(n!=null){var f=n.querySelector(".introjs-helperNumberLayer"),c=n.querySelector(".introjs-tooltiptext"),h=n.querySelector(".introjs-arrow"),p=n.querySelector(".introjs-tooltip");n.setAttribute("style","width: "+(u.width+10)+"px; "+"height:"+(u.height+10)+"px; "+"top:"+(u.top-5)+"px;"+"left: "+(u.left-5)+"px;");f.innerHTML=e.getAttribute("data-step");c.innerHTML=e.getAttribute("data-intro");var d=document.querySelector(".introjs-showElement");d.className=d.className.replace(/introjs-[a-zA-Z]+/g,"").trim();o(e,p,h)}else{var v=document.createElement("div"),m=document.createElement("span"),g=document.createElement("div"),y=document.createElement("div");v.className="introjs-helperLayer";v.setAttribute("style","width: "+(u.width+10)+"px; "+"height:"+(u.height+10)+"px; "+"top:"+(u.top-5)+"px;"+"left: "+(u.left-5)+"px;");this._targetElement.appendChild(v);m.className="introjs-helperNumberLayer";g.className="introjs-arrow";y.className="introjs-tooltip";m.innerHTML=e.getAttribute("data-step");y.innerHTML="<div class='introjs-tooltiptext'>"+e.getAttribute("data-intro")+"</div><div class='introjs-tooltipbuttons'></div>";v.appendChild(m);y.appendChild(g);v.appendChild(y);var b=document.createElement("a");b.onclick=function(){r.call(t)};b.className="introjs-button introjs-nextbutton";b.href="javascript:void(0);";b.innerHTML="Next →";var w=document.createElement("a");w.onclick=function(){i.call(t)};w.className="introjs-button introjs-prevbutton";w.href="javascript:void(0);";w.innerHTML="← Back";var E=document.createElement("a");E.className="introjs-button introjs-skipbutton";E.href="javascript:void(0);";E.innerHTML="Skip";E.onclick=function(){s.call(t,t._targetElement)};var S=y.querySelector(".introjs-tooltipbuttons");S.appendChild(E);S.appendChild(w);S.appendChild(b);o(e,y,g)}e.className+=" introjs-showElement";var x="";if(e.currentStyle){x=e.currentStyle["position"]}else if(document.defaultView&&document.defaultView.getComputedStyle){x=document.defaultView.getComputedStyle(e,null).getPropertyValue("position")}x=x.toLowerCase();if(x!="absolute"&&x!="relative"){e.className+=" introjs-relativePosition"}if(!a(e)){var T=e.getBoundingClientRect();top=T.bottom-T.height,bottom=T.bottom-window.innerHeight;if(top<0){window.scrollBy(0,top-30)}else{window.scrollBy(0,bottom+100)}}}function a(e){var t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom+80<=window.innerHeight&&t.right<=window.innerWidth}function f(e){var t=document.createElement("div"),n="",r=this;t.className="introjs-overlay";if(e.tagName.toLowerCase()=="body"){n+="top: 0;bottom: 0; left: 0;right: 0;position: fixed;";t.setAttribute("style",n)}else{var i=l(e);if(i){n+="width: "+i.width+"px; height:"+i.height+"px; top:"+i.top+"px;left: "+i.left+"px;";t.setAttribute("style",n)}}e.appendChild(t);t.onclick=function(){s.call(r,e)};setTimeout(function(){n+="opacity: .5;";t.setAttribute("style",n)},10);return true}function l(e){var t={};t.width=e.offsetWidth;t.height=e.offsetHeight;var n=0;var r=0;while(e&&!isNaN(e.offsetLeft)&&!isNaN(e.offsetTop)){n+=e.offsetLeft;r+=e.offsetTop;e=e.offsetParent}t.top=r;t.left=n;return t}var e="0.2.1";var c=function(e){if(typeof e==="object"){return new t(e)}else if(typeof e==="string"){var n=document.querySelector(e);if(n){return new t(n)}else{throw new Error("There's no element with given selector.")}}else{return new t(document.body)}};c.version=e;c.fn=t.prototype={clone:function(){return new t(this)},start:function(){n.call(this,this._targetElement);return this},oncomplete:function(e){if(typeof e==="function"){this._introCompleteCallback=e}else{throw new Error("Provided callback for oncomplete was not a function.")}return this},onexit:function(e){if(typeof e==="function"){this._introExitCallback=e}else{throw new Error("Provided callback for onexit was not a function.")}return this}};window["introJs"]=c})()
@@ -1,5 +1,5 @@
1
1
  module Introjs
2
2
  module Rails
3
- VERSION = "0.2.0"
3
+ VERSION = "0.2.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: introjs-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -125,7 +125,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
125
125
  version: '0'
126
126
  segments:
127
127
  - 0
128
- hash: -2457814536081957212
128
+ hash: -1715141738689852327
129
129
  required_rubygems_version: !ruby/object:Gem::Requirement
130
130
  none: false
131
131
  requirements:
@@ -134,7 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
134
134
  version: '0'
135
135
  segments:
136
136
  - 0
137
- hash: -2457814536081957212
137
+ hash: -1715141738689852327
138
138
  requirements: []
139
139
  rubyforge_project:
140
140
  rubygems_version: 1.8.25