/** @license Sideshow - An incredible Javascript interactive help Library Version: 0.4.2 Date: 2015-03-10 Author: Alcides Queiroz [alcidesqueiroz(at)gmail(dot)com] Available under Apache License 2.0 (https://raw2.github.com/fortesinformatica/sideshow/master/LICENSE) **/ !function(t,e,i,s){!function(e,i){var s=i();"function"==typeof define&&define.amd?define(i):t[e]=s}("sideshow",function(){function n(t,e){this.name="SSException",this.message="[SIDESHOW_E#"+("00000000"+t).substr(-8)+"] "+e}function o(t,e){console.warn("[SIDESHOW_W#"+("00000000"+t).substr(-8)+"] "+e)}function r(t){console.warn("[DEPRECATION_WARNING] "+t)}function a(t){if(t.constructor!==String)return t;var e=""===t?"0":t;return+e.replace("px","")}function h(t){return S.config.language in t?t[S.config.language]:(o("2001","String not found for the selected language, getting the first available."),t[Object.keys(t)[0]])}function d(){m.keyup(u)}function l(){m.unbind("keyup",u)}function u(t){(27==t.keyCode||112==t.keyCode)&&S.close()}function c(){m.keyup(function(t){113==t.keyCode&&(t.shiftKey?S.start({listAll:!0}):S.start())})}function f(){e('[class*="sideshow"]').not(".sideshow-mask-part, .sideshow-mask-corner-part, .sideshow-subject-mask").remove()}if(void 0===e)throw new n("2","jQuery is required for Sideshow to work.");if(void 0===i)throw new n("3","Jazz is required for Sideshow to work.");if(void 0===s)throw new n("4","Pagedown (the Markdown parser used by Sideshow) is required for Sideshow to work.");var p,g,m,w,b="Sideshow",v=150,C=600,S={get VERSION(){return"0.4.2"}},x=[],k={lockMaskUpdate:!1,changingStep:!1,skippingStep:!1,running:!1},I=[],y=i.Enum("VISIBLE","FADING_IN","FADING_OUT","NOT_DISPLAYED","NOT_RENDERED","TRANSPARENT");n.prototype=new Error,n.prototype.constructor=n;var T={availableWizards:{en:"Available Tutorials","pt-br":"Tutoriais Disponíveis",es:"Tutoriales Disponibles"},relatedWizards:{en:"Related Wizards","pt-br":"Tutoriais Relacionados",es:"Tutoriales Relacionados"},noAvailableWizards:{en:"There's no tutorials available.","pt-br":"Não há tutoriais disponíveis para esta tela.",es:"No hay tutoriales disponibles."},close:{en:"Close","pt-br":"Fechar",es:"Cerrar"},estimatedTime:{en:"Estimated Time","pt-br":"Tempo Estimado",es:"Tiempo Estimado"},next:{en:"Next","pt-br":"Continuar",es:"Continuar"},finishWizard:{en:"Finish Wizard","pt-br":"Concluir Tutorial",es:"Concluir Tutorial"}};S.config={},S.config.userPreferencesRoute=null,S.config.loggedInUser=null,S.config.language="en",S.config.autoSkipIntro=!1,S.ControlVariables={},S.ControlVariables.set=function(t,e){var i={};return this.isDefined(t)?i=this.getNameValuePair(t):x.push(i),i.name=t,i.value=e,t+"="+e},S.ControlVariables.setIfUndefined=function(t,e){return this.isDefined(t)?void 0:this.set(t,e)},S.ControlVariables.isDefined=function(t){return void 0!==this.getNameValuePair(t)},S.ControlVariables.get=function(t){var e=this.getNameValuePair(t);return e?e.value:void 0},S.ControlVariables.getNameValuePair=function(t){for(var e=0;e0)){var d=this._storyline.steps[this.getStepPosition()+1];r.nextButton.setText(d?h(T.next)+": "+this._storyline.steps[this.getStepPosition()+1].title:h(T.finishWizard)),r.nextButton.show(),t.autoContinue===!1&&r.nextButton.disable()}else r.nextButton.hide();t.targets&&t.targets.length>0&&(z.setTargets(t.targets),z.render(),z.positionate(),z.fadeIn()),r.show(!0),O.CompositeMask.singleInstance.scrollIfNecessary(W.position,W.dimension)||(r.positionate(),r.fadeIn()),e&&e(),k.changingStep=!1}}),M.method("next",function(t,e){if(!k.changingStep||k.skippingStep){k.changingStep=!0;var i=this.currentStep;e=e||this._storyline.steps[this.getStepPosition(this.currentStep)+1];var s=this;this.hideStep(function(){if(e)s.showStep(e,function(){t&&t()});else{i&&i.listeners&&i.listeners.afterStep&&i.listeners.afterStep();var n=w;w=null;var o=s.listeners;o&&o.afterWizardEnds&&o.afterWizardEnds(),S.showRelatedWizardsList(n)||S.close()}})}}),M.method("hideStep",function(t){B.singleInstance.fadeOut(function(){P.singleInstance.hide()}),z.fadeOut(),O.SubjectMask.singleInstance.update(W.position,W.dimension,W.borderRadius),O.SubjectMask.singleInstance.fadeIn(t)}),M.method("getStepPosition",function(t){return this._storyline.steps.indexOf(t||this.currentStep)}),M.method("isEligible",function(){function e(t,e,i){return i?t===e:t.toLowerCase()===e.toLowerCase()}for(var i=t.location,s=0;s0&&!k.skippingStep){for(var e=!0,i=0;i").addClass("sideshow-details-panel").addClass("sideshow-hidden"),this.callSuper("render")}),P.method("positionate",function(){for(var t=O.CompositeMask.singleInstance.parts,e=[[t.top,"height"],[t.right,"width"],[t.bottom,"height"],[t.left,"width"]].sort(function(t,e){return t[0].dimension[t[1]]-e[0].dimension[e[1]]}),i=e.slice(-1)[0],s=2;s>0;s--){var n=e[s],o=n[0].dimension;o.width>250&&o.height>250&&o.width+o.height>2*(i[0].dimension.width+i[0].dimension.height)&&(i=n)}"width"==i[1]?this.$el.css("left",i[0].position.x).css("top",0).css("height",N.dimension.height).css("width",i[0].dimension.width):this.$el.css("left",0).css("top",i[0].position.y).css("height",i[0].dimension.height).css("width",N.dimension.width),this.dimension={width:a(this.$el.css("width")),height:a(this.$el.css("height"))},this.position={x:a(this.$el.css("left")),y:a(this.$el.css("top"))}});var z={};z.arrows=[],z.clear=function(){this.arrows=[]},z.setTargets=function(t,i){if(t.constructor===String&&(t=e(t)),t instanceof e&&t.length>0)t.each(function(){var t=R.build();t.target.$el=e(this),t.target.$el.is(":visible")&&(z.arrows.push(t),t.onceVisible=!0)});else if(!i)throw new n("150","Invalid targets.")},z.recreateDOMReferences=function(){for(var t=0;t").addClass("sideshow-subject-arrow").addClass("sideshow-hidden").addClass("sideshow-invisible"),this.callSuper("render")}),R.method("positionate",function(){var t=this.target;t.position={x:t.$el.offset().left-p.scrollLeft(),y:t.$el.offset().top-p.scrollTop()},t.dimension={width:t.$el.outerWidth(),height:t.$el.outerHeight()},this.$el.css("top",t.position.y-30+"px").css("left",t.position.x+a(t.dimension.width)/2-12+"px")}),R.method("show",function(){this.callSuper("show"),this.positionate()}),R.method("fadeIn",function(){this.callSuper("fadeIn"),this.positionate()}),R.method("hasChanged",function(){return this.target.dimension.width!==this.target.$el.outerWidth()||this.target.dimension.height!==this.target.$el.outerHeight()||this.target.position.y!==this.target.$el.offset().top-p.scrollTop()||this.target.position.x!==this.target.$el.offset().left-p.scrollLeft()});var B=i.Class(function(){this.nextButton=_.build()}).extending(E).singleton;B.field("text",""),B.field("title",""),B.field("dimension",{}),B.field("position",{}),B.field("nextButton"),B.method("setText",function(t){this.text=t,this.$el.find(".sideshow-step-text").text(t)}),B.method("setHTML",function(t){this.text=t,this.$el.find(".sideshow-step-text").html(t)}),B.method("setTitle",function(t){this.title=t,this.$el.find("h2:first").text(t)}),B.method("setStepPosition",function(t){this.stepPosition=t,this.$el.find(".sideshow-step-position").text(t)}),B.method("render",function(){this.$el=e("
").addClass("sideshow-step-description").addClass("sideshow-hidden").addClass("sideshow-invisible");var t=e("").addClass("sideshow-step-position");this.$el.append(t),w.showStepPosition===!1&&t.hide(),this.$el.append(e("

")),this.$el.append(e("
").addClass("sideshow-step-text")),this.nextButton.render(this.$el),this.nextButton.$el.click(function(){w.next()}),P.singleInstance.$el.append(this.$el)}),B.method("show",function(t){this.callSuper("show",t)}),B.method("positionate",function(){var t=P.singleInstance;this.dimension.width=t.dimension.width>=900?900:.9*t.dimension.width,this.$el.css("width",this.dimension.width);var e=(a(this.$el.css("padding-left"))+a(this.$el.css("padding-right")))/2,i=(a(this.$el.css("padding-top"))+a(this.$el.css("padding-bottom")))/2;this.dimension.height=a(this.$el.outerHeight()),this.dimension.height>t.dimension.height||this.dimension.width<400?(this.dimension.width=.9*p.width(),this.$el.css("width",this.dimension.width),this.dimension.height=a(this.$el.outerHeight()),this.position.x=(p.width()-this.dimension.width)/2,this.position.y=(p.height()-this.dimension.height)/2):(this.position.x=(t.dimension.width-this.dimension.width)/2,this.position.y=(t.dimension.height-this.dimension.height)/2),this.$el.css("left",this.position.x-e),this.$el.css("top",this.position.y-i)});var _=i.Class().extending(j);_.field("_text"),_.method("disable",function(){this.$el.attr("disabled","disabled")}),_.method("enable",function(){this.$el.attr("disabled",null)}),_.method("setText",function(t){this._text=t,this.$el.text(t)}),_.method("render",function(t){this.$el=e("